Questions tagged [elasticsearch-geo-shape]

geo_shape mapping type in Elasticsearch that facilitates indexing and searching of abitrary geo shapes such as polygons.

The geo_shape mapping type in Elasticsearch.

The geo_shape mapping type facilitates the indexing of and searching with arbitrary geo shapes such as rectangles and polygons. You can query documents using this type using geo_shape Filter or geo_shape Query.

The geo_shape mapping maps geo_json geometry objects to the geo_shape type.

44 questions
8
votes
0 answers

Elasticsearch - find points inside huge geo shape

I have 'shapes' index that stores a lot of huge geoshapes (original shapefile for one geoshape was 6MB in size). I'm using this mapping: "shape": { "type": "geo_shape", "tree": "quadtree", "tree_levels": "20" }, "_all": { "enabled":…
User Created Image
  • 1,182
  • 2
  • 17
  • 33
6
votes
1 answer

What is the difference between CONTAINS and WITHIN on Elasticsearch GeoShape queries?

I try to determine if a polygon (indexed in document) has common point with another shape like a circle. The Elasticsearch documentation provides 4 types of relation: INTERSECT ; DISJOINCT ; CONTAINS ; WITHIN. I try to find more information…
Geoffrey
  • 193
  • 3
  • 11
3
votes
3 answers

geojson to Elasticsearch : Unable to Tessellate shape

I am indexing some geojson file (around 4000 ~ 5000 multi-polygon features) into Elasticsearch. Here is the mappings "mappings": { "properties": { "type": { "type": "keyword" }, "properties": { "type":…
3
votes
0 answers

How to design ElasticSearch document(s) for geo shape data?

I'm trying to build a geoloc service (from France only) with Elastic Search. I have several indexes to create such as country, region, county, city, neighbour containing itself a polygon. For each city, I have a list of the nearest cities to…
Pat
  • 329
  • 1
  • 3
  • 11
3
votes
1 answer

elasticsearch: unable to set geo_shape value using XContentBuilder

I have following mapping in elastic search. I am able to PUT documents using Sense plugin but unable to do so using XContentBuilder to set the geo_shape field value. I am getting following error: error: [106]: index [streets], type [street], id…
Vms
  • 199
  • 2
  • 11
2
votes
1 answer

ES NEST - How to Create an index and Bulk index dynamic objects with geometry (geo_point or geo_shape)?

I have a Dataset for which I don't know or have the type in advance, nor the number of properties or their type. On execution, I obtain for that Dataset a DatasetSchema that contain the names, types and some flags for the properties. For geometry…
Florin Vîrdol
  • 395
  • 2
  • 10
  • 28
2
votes
1 answer

Elasticsearch Geoshape query false results

I have two geo_shapes in ES. What I need to figure out is the best way to understand if one of the shapes (Green) contains or intersects with another (Red). Please see below a visual representation of three different cases: Case I : is easy to…
Andrey Popov
  • 163
  • 4
  • 12
1
vote
2 answers

OpenSearch: how do I find polygons within a given bounding box?

I've attempted: GET thing/_search { "query": { "bool": { "must": { "match_all": {} }, "filter": { "geo_bounding_box": { "location": { "top_left": { "lat": 47.7328, …
studiobrain
  • 1,135
  • 2
  • 13
  • 35
1
vote
1 answer

How to return geospatial distance results for geo_shapes in Elasticsearch

I have two indices, both have > 2 million documents containing localIds (mapped to keyword) and geospatial data. Both indices use geo_shape as the mapping), so the mappings look like this: { "properties": { "localId": { "type":…
zanther
  • 537
  • 1
  • 4
  • 15
1
vote
0 answers

Elasticsearch - Is it possible to perform a spatial join in a query?

I would like to perform a spatial join as you would do in PostGIS. So far I have explored the various ways outlined with Geo-shape query, but they only were possible by using a single shape or by accessing a shape in a different index by id like…
1
vote
0 answers

Elasticsearch geo_shape query: Find polygons intersecting/within given circle

ElasticSearch 7.5.1 I'm trying to find all indexed polygons/multipolygons that intersect or lie within a given circle, rather then within a given polygon. My shape is indexed as "geometry": { "type": "geo_shape", "tree_levels": 16, "strategy":…
1
vote
1 answer

Google Autocomplete Polygon as GeoJson

I'm trying to find in the Google Maps documentation a way to search for a place and get it's GeoJson polygon but I got no luck finding something like that. My goal is to create a search bar to search places and then send the geojson polygon to our…
1
vote
1 answer

How to query for documents containing array of polygons with at least one polygon matching geo shape filter?

I have a document with areas property. This property is an array of polygons. Let's say polygons represent the boundaries of some cities. Given that I have a bounding box I want to query for those documents that have at least one of the polygons…
Kamil Latosinski
  • 756
  • 5
  • 28
1
vote
1 answer

Elasticsearch Reindex dynamic mapped location data to geoshape

I recorded some data to Elasticsearch. But my template is not worked good and my location datas mapped dynamic. I want to reindex all data with query script. How can I convert location data to geoshape? Sample data: { "deviceId": "dev1", …
1
vote
0 answers

Elasticsearch Ruby gem does not return correct data while plain HTTP GET does

I am trying to find out if a polygon contains a geopoint using Elasticsearch. When I use the elasticsearch gem, it's client says there is no match. But when I make a simple HTTP GET request, it returns a match. Here's my ruby code require…
1
2 3