# Insert Shapefile or large Geojson file in elasticsearch

**URL:** <https://discuss.elastic.co/t/insert-shapefile-or-large-geojson-file-in-elasticsearch/175977>\
**Category:** Elasticsearch\
**Created:** [April 9, 2019, 8:06am UTC](https://discuss.elastic.co/t/insert-shapefile-or-large-geojson-file-in-elasticsearch/175977 "2019-04-09T08:06:01Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul\_Tandon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rahul_tandon/32/39380_2.png) [@Rahul\_Tandon](https://discuss.elastic.co/u/Rahul_Tandon)\
**Post date:** [April 9, 2019, 8:06am UTC](https://discuss.elastic.co/t/insert-shapefile-or-large-geojson-file-in-elasticsearch/175977/1 "2019-04-09T08:06:01Z")

</div>

I have a shapefile with 50 geometries that i want to insert into elasticsearch index to view it on kibana.I tried to converted it into geojson and try to insert because geomeries are 50 and number of points in each geometry are large i can not insert it using dev tools.

Please suggest me how can i do that.

---

<div class="post-metadata">

**Author:** ![Ignacio\_Vera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ignacio_vera/32/36674_2.png) [@Ignacio\_Vera](https://discuss.elastic.co/u/Ignacio_Vera)\
**Post date:** [April 9, 2019, 8:42am UTC](https://discuss.elastic.co/t/insert-shapefile-or-large-geojson-file-in-elasticsearch/175977/2 "2019-04-09T08:42:57Z")

</div>

Have you tried to convert the geometry to WKT? It is somewhat less verbose than GeoJSON.

I will recommend write a small program using the [Java High Level Rest Client](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.7/java-rest-high.html)

---

<div class="post-metadata">

**Author:** ![Rahul\_Tandon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rahul_tandon/32/39380_2.png) [@Rahul\_Tandon](https://discuss.elastic.co/u/Rahul_Tandon)\
**Post date:** [April 9, 2019, 8:44am UTC](https://discuss.elastic.co/t/insert-shapefile-or-large-geojson-file-in-elasticsearch/175977/3 "2019-04-09T08:44:57Z")

</div>

Yes i tried WKT as well but its not working for large and multiple geometries.

---

<div class="post-metadata">

**Author:** ![Ignacio\_Vera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ignacio_vera/32/36674_2.png) [@Ignacio\_Vera](https://discuss.elastic.co/u/Ignacio_Vera)\
**Post date:** [April 9, 2019, 8:59am UTC](https://discuss.elastic.co/t/insert-shapefile-or-large-geojson-file-in-elasticsearch/175977/4 "2019-04-09T08:59:48Z")

</div>

Is it possible for you to share the geometry you are trying to index? If so use Gist or something similar, preferably in WKT format.

---

<div class="post-metadata">

**Author:** ![Rahul\_Tandon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rahul_tandon/32/39380_2.png) [@Rahul\_Tandon](https://discuss.elastic.co/u/Rahul_Tandon)\
**Post date:** [April 9, 2019, 9:22am UTC](https://discuss.elastic.co/t/insert-shapefile-or-large-geojson-file-in-elasticsearch/175977/5 "2019-04-09T09:22:28Z")

</div>

I can not share through git due to some restriction,but you can find data on below site.

> **[Boundaries - Wards (2015-) | City of Chicago | Data Portal](https://data.cityofchicago.org/Facilities-Geographic-Boundaries/Boundaries-Wards-2015-/sp34-6z76)**
>
> Ward boundaries in Chicago from May 2015 onward, corresponding to the dates when a new City Council is sworn in, based on the immediately preceding elections. Neither this description nor the dataset should be relied upon in situations where legal...

---

<div class="post-metadata">

**Author:** ![Rahul\_Tandon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rahul_tandon/32/39380_2.png) [@Rahul\_Tandon](https://discuss.elastic.co/u/Rahul_Tandon)\
**Post date:** [April 9, 2019, 1:44pm UTC](https://discuss.elastic.co/t/insert-shapefile-or-large-geojson-file-in-elasticsearch/175977/6 "2019-04-09T13:44:00Z")

</div>

Have you seen data available on link?

---

<div class="post-metadata">

**Author:** ![Ignacio\_Vera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ignacio_vera/32/36674_2.png) [@Ignacio\_Vera](https://discuss.elastic.co/u/Ignacio_Vera)\
**Post date:** [April 10, 2019, 7:50am UTC](https://discuss.elastic.co/t/insert-shapefile-or-large-geojson-file-in-elasticsearch/175977/7 "2019-04-10T07:50:42Z")

</div>

I had a look into the data provided in your link. the first question I have is if you want to insert all wards in one document or one document per ward.

In any case I think you will need to write a small program to process the data before sending it to Elasticsearch. For example the GeoJSON uses `FeatureCollection` which is not supported so you need to extract those features.

---

<div class="post-metadata">

**Author:** ![Rahul\_Tandon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rahul_tandon/32/39380_2.png) [@Rahul\_Tandon](https://discuss.elastic.co/u/Rahul_Tandon)\
**Post date:** [April 10, 2019, 7:57am UTC](https://discuss.elastic.co/t/insert-shapefile-or-large-geojson-file-in-elasticsearch/175977/8 "2019-04-10T07:57:23Z")

</div>

I want to insert one document per ward.Please explain in detail procedure to process the data.

---

<div class="post-metadata">

**Author:** ![Ignacio\_Vera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ignacio_vera/32/36674_2.png) [@Ignacio\_Vera](https://discuss.elastic.co/u/Ignacio_Vera)\
**Post date:** [April 10, 2019, 8:52am UTC](https://discuss.elastic.co/t/insert-shapefile-or-large-geojson-file-in-elasticsearch/175977/9 "2019-04-10T08:52:11Z")

</div>

This depends so much in your tools and what you are more comfortable with. If I had to do it I will use the csv file linked in the page. It provides the WKT for a ward and the ward number. Then I will use the [Java High Level Rest Client](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.7/java-rest-high.html) to send the data to ElasticSearch.

---

<div class="post-metadata">

**Author:** ![Rahul\_Tandon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rahul_tandon/32/39380_2.png) [@Rahul\_Tandon](https://discuss.elastic.co/u/Rahul_Tandon)\
**Post date:** [April 15, 2019, 10:52am UTC](https://discuss.elastic.co/t/insert-shapefile-or-large-geojson-file-in-elasticsearch/175977/10 "2019-04-15T10:52:11Z")

</div>

I am able to insert geojson as per given format but it is not visualizing in kibana.

---

<div class="post-metadata">

**Author:** ![Ignacio\_Vera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ignacio_vera/32/36674_2.png) [@Ignacio\_Vera](https://discuss.elastic.co/u/Ignacio_Vera)\
**Post date:** [April 16, 2019, 9:28am UTC](https://discuss.elastic.co/t/insert-shapefile-or-large-geojson-file-in-elasticsearch/175977/11 "2019-04-16T09:28:03Z")

</div>

I am afraid that visualising `geo_shape` fields is not yet possible in Kibana.

---

<div class="post-metadata">

**Author:** ![Rahul\_Tandon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rahul_tandon/32/39380_2.png) [@Rahul\_Tandon](https://discuss.elastic.co/u/Rahul_Tandon)\
**Post date:** [April 16, 2019, 9:29am UTC](https://discuss.elastic.co/t/insert-shapefile-or-large-geojson-file-in-elasticsearch/175977/12 "2019-04-16T09:29:42Z")

</div>

points and polygons are possible but multipolygon is not supported in Kibana.I confirmed with kibana team.

---

<div class="post-metadata">

**Author:** ![Ignacio\_Vera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ignacio_vera/32/36674_2.png) [@Ignacio\_Vera](https://discuss.elastic.co/u/Ignacio_Vera)\
**Post date:** [April 16, 2019, 9:30am UTC](https://discuss.elastic.co/t/insert-shapefile-or-large-geojson-file-in-elasticsearch/175977/13 "2019-04-16T09:30:40Z")

</div>

Thanks for the info!

---

<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:** [May 14, 2019, 9:30am UTC](https://discuss.elastic.co/t/insert-shapefile-or-large-geojson-file-in-elasticsearch/175977/14 "2019-05-14T09:30:46Z")

</div>

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