# Maps, geojson and display in Kibana

**URL:** <https://discuss.elastic.co/t/maps-geojson-and-display-in-kibana/138727>\
**Category:** Kibana\
**Created:** [July 5, 2018, 1:33pm UTC](https://discuss.elastic.co/t/maps-geojson-and-display-in-kibana/138727 "2018-07-05T13:33:15Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![avranCheck](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@avranCheck](https://discuss.elastic.co/u/avranCheck)\
**Post date:** [July 5, 2018, 1:33pm UTC](https://discuss.elastic.co/t/maps-geojson-and-display-in-kibana/138727/1 "2018-07-05T13:33:15Z")

</div>

I want to load geojson files in Kibana. I am following the examples here [https://www.elastic.co/blog/custom-region-maps-in-kibana-6-0](https://www.elastic.co/blog/custom-region-maps-in-kibana-6-0). Need help to figure out from the point of downloading the aus\_state.geojson, how do I "display" in Kibana. I tried to ingest the data using CURL (same way as the shakespeare.json). Not getting far and would appreciate some help.

---

<div class="post-metadata">

**Author:** ![Bill\_McConaghy](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@Bill\_McConaghy](https://discuss.elastic.co/u/Bill_McConaghy)\
**Post date:** [July 5, 2018, 1:41pm UTC](https://discuss.elastic.co/t/maps-geojson-and-display-in-kibana/138727/2 "2018-07-05T13:41:12Z")

</div>

The explanations starting with the "Configuring your source" section in that blog post seem pretty good. Basically, you need to tell Kibana about this new geojson via kibana.yml config, serve the geojson from a web server accessible to Kibana, and then set up an aggregation, configuring it to use your custom setup.

---

<div class="post-metadata">

**Author:** ![avranCheck](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@avranCheck](https://discuss.elastic.co/u/avranCheck)\
**Post date:** [July 5, 2018, 1:53pm UTC](https://discuss.elastic.co/t/maps-geojson-and-display-in-kibana/138727/3 "2018-07-05T13:53:11Z")

</div>

Got to the part where [http://localhost:8000/aus\_state.geojson](http://localhost:8000/aus_state.geojson) is showing the file. Also, made the changes to kibana.yml. When following the tutorial to "The Aggregation Settings" - kind of lost of how to start. Am I to use the Visualize -\> Maps -\> Region Map ? For this I need to reference an index. This is the part I not connecting the dots.

---

<div class="post-metadata">

**Author:** ![Bill\_McConaghy](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@Bill\_McConaghy](https://discuss.elastic.co/u/Bill_McConaghy)\
**Post date:** [July 5, 2018, 5:33pm UTC](https://discuss.elastic.co/t/maps-geojson-and-display-in-kibana/138727/4 "2018-07-05T17:33:13Z")

</div>

Do you have an index pattern created? You will need to do that. The visualization then refers to the index pattern. And yes, that is the correct visualization type I think.

---

<div class="post-metadata">

**Author:** ![avranCheck](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@avranCheck](https://discuss.elastic.co/u/avranCheck)\
**Post date:** [July 5, 2018, 5:44pm UTC](https://discuss.elastic.co/t/maps-geojson-and-display-in-kibana/138727/5 "2018-07-05T17:44:27Z")

</div>

I have a index pattern created,  
PUT /australia  
{  
"mappings": {  
"features": {  
"properties": {  
"geometry": {  
"properties": {  
"STATE\_NAME": {"type": "keyword"},  
"STATE\_CODE": {"type": "integer"}  
}  
}  
}  
}  
}  
}

I see that as a ES index with 0 docs. How do I load ES docs ? Logstash , curl did not work for me. I did successfully load shakespear.json in the same manner, but the aus\_state.geojson gives this error:

```
PS C:\Users\avranc\Documents\demo\maps\aus_states> dir

    Directory: C:\Users\avranc\Documents\demo\maps\aus_states

Mode LastWriteTime Length Name                                                                                                                                               
---- ------------- ------ ----                                                                                                                                               
d----- 7/4/2018 9:32 AM __MACOSX                                                                                                                                           
-a---- 7/4/2018 9:32 AM 3468990 aus_state.geojson                                                                                                                                  
-a---- 7/4/2018 9:32 AM 535363 aus_state.png                                                                                                                                      
-a---- 7/4/2018 9:32 AM 6640 aus_state.rds                                                                                                                                      
-a---- 7/4/2018 9:32 AM 3468990 JSON-aus_state.json                                                                                                                                

PS C:\Users\avranc\Documents\demo\maps\aus_states> Invoke-RestMethod "http://localhost:9200/australia/doc/_bulk?pretty" -Method Post -ContentType 'application/x-ndjson' -InFile "aus_state.geojson"

Invoke-RestMethod : {
  "error" : {
    "root_cause" : [
      {
        "type" : "json_e_o_f_exception",
        "reason" : "Unexpected end-of-input: expected close marker for Object (start marker at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@2bebec83; line: 1, column: 1])\n at 
[Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@2bebec83; line: 1, column: 3]"
      }
    ],
    "type" : "json_e_o_f_exception",
    "reason" : "Unexpected end-of-input: expected close marker for Object (start marker at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@2bebec83; line: 1, column: 1])\n at 
[Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@2bebec83; line: 1, column: 3]"
  },
  "status" : 500
}
At line:1 char:1
+ Invoke-RestMethod "http://localhost:9200/australia/doc/_bulk?pretty" ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
```

---

<div class="post-metadata">

**Author:** ![Bill\_McConaghy](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@Bill\_McConaghy](https://discuss.elastic.co/u/Bill_McConaghy)\
**Post date:** [July 5, 2018, 5:57pm UTC](https://discuss.elastic.co/t/maps-geojson-and-display-in-kibana/138727/6 "2018-07-05T17:57:46Z")

</div>

First off, looks like you have created an index in Elasticsearch but not an index pattern in Kibana. This guide will walk you through creating an index pattern: [https://www.elastic.co/guide/en/kibana/current/tutorial-define-index.html](https://www.elastic.co/guide/en/kibana/current/tutorial-define-index.html)

After that you need data that you want to visualize on a map. The aus\_state.geojson is the mapping information. You will need to add data to Elasticsearch that has geopoint data in it (and that point lies in Australia) if you want to visualize it against the geodata.

---

<div class="post-metadata">

**Author:** ![avranCheck](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@avranCheck](https://discuss.elastic.co/u/avranCheck)\
**Post date:** [July 5, 2018, 7:02pm UTC](https://discuss.elastic.co/t/maps-geojson-and-display-in-kibana/138727/7 "2018-07-05T19:02:59Z")

</div>

> [@avranCheck](#):
>
> How do I load ES docs ? Logstash , curl did not work for me. I did successfully load shakespear.json in the same manner, but the aus\_state.geojson gives this error:

Before I create the Kibana index, how do I load the data in ES? The error above is trying to load the aus\_state.geojson file. I am familiar with creating index in Kibana, so should be good there.

---

<div class="post-metadata">

**Author:** ![Bill\_McConaghy](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@Bill\_McConaghy](https://discuss.elastic.co/u/Bill_McConaghy)\
**Post date:** [July 5, 2018, 7:06pm UTC](https://discuss.elastic.co/t/maps-geojson-and-display-in-kibana/138727/8 "2018-07-05T19:06:45Z")

</div>

That file aus\_state.geojson is not data that is intended to be loaded into ES, it is just the geoshapes. You need to supply your own data to load into ES. The blog post has an example.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 2, 2018, 7:06pm UTC](https://discuss.elastic.co/t/maps-geojson-and-display-in-kibana/138727/9 "2018-08-02T19:06:49Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
