Doubts Visualization MULTIPOLYGONS kibana

Hello, I'm new here, I've been using elasticsearch for a month and I wanted to solve some doubts, despite reading the documentation and searching I do not get what I'm looking for.
I am trying to index information in JSON-LD format and what I want is to visualize the geographic data but these are multipolygons and polygons, I am seeing the form with geo_shape but it gives me an error in the mapping. Yesterday I made some examples with geo_point for the cases in which they are points and I visualize them correctly. If someone could help me out I would appreciate it very much.
These are the examples that i'm trying:

**************** 1 example correct ****************************
PUT /museums
{
"mappings": {
"_doc": {
"properties": {
"location": {
"type": "geo_point"
}
}
}
}
}

POST /museums/_doc/_bulk?refresh
{"index":{"_id":1}}
{"location": "52.374081,4.912350", "name": "NEMO Science Museum"}
{"index":{"_id":2}}
{"location": "52.369219,4.901618", "name": "Museum Het Rembrandthuis"}
{"index":{"_id":3}}
{"location": "52.371667,4.914722", "name": "Nederlands Scheepvaartmuseum"}
{"index":{"_id":4}}
{"location": "51.222900,4.405200", "name": "Letterenhuis"}
{"index":{"_id":5}}
{"location": "48.861111,2.336389", "name": "Musée du Louvre"}
{"index":{"_id":6}}
{"location": "48.860000,2.327000", "name": "Musée d'Orsay"}

POST /museums/_search?size=0
{
"aggregations" : {
"large-grid" : {
"geohash_grid" : {
"field" : "location",
"precision" : 3
}
}
}
}


******************* 2 example NO correct *****************

PUT /museums_2
{
"mappings": {
"_doc": {
"properties": {
"location": {
"type": "geo_shape"
}
}
}
}
}

DELETE /museums_2
GET museums_2/_mapping

POST /museums_2/_doc/_bulk?refresh
{"index":{"_id":1}}
{"location":{"type":"linestring","coordinates":[[-77.03653,38.897676],[-77.009051,38.889939]]}}
POST /museums_2/_search?size=0
{
"aggregations" : {
"large-grid" : {
"geohash_grid" : {
"field" : "location",
"precision" : 3
}
}
}
}

I would like to be able to visualize linestring as the first example and then move on to multipolygonos and know how.

Thank you!

There are 2 problems in your 2 example

  1. DELETE /museums_2 removes the mapping created above. When you perform the insert after deleting the mapping, then location will not be indexed as a geo_shape
  2. geohash_grid aggregation does not currently support geo_shape type. Follow https://github.com/elastic/elasticsearch/issues/21293 to monitor the status of allowing geo_shape support with geohash_grid aggregation.

The existing map visualizations in Kibana do not support the display of geo_shape documents.

Elastic is building a new Maps application that will render geo_point and geo_shape features. It will be coming in 6.7 and 7.0 releases. The 7.0.0 Beta 1 release is now available for download if you would like to try out the new Maps application - https://www.elastic.co/blog/kibana-7-0-0-beta1-released

1 Like

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