Insert Shapefile or large Geojson file in elasticsearch


(Rahul Tandon) #1

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.

(Ignacio Vera) #2

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

(Rahul Tandon) #3

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

(Ignacio Vera) #4

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.

(Rahul Tandon) #5

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

(Rahul Tandon) #6

Have you seen data available on link?

(Ignacio Vera) #7

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.

(Rahul Tandon) #8

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

(Ignacio Vera) #9

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 to send the data to ElasticSearch.

(Rahul Tandon) #10

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

(Ignacio Vera) #11

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

(Rahul Tandon) #12

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

(Ignacio Vera) #13

Thanks for the info!