-
Notifications
You must be signed in to change notification settings - Fork 49
Description
The purpose of this RFC (request for comments) is to gather community feedback on a proposal to allow OpenSearch users to facilitate aggregations over the GeoShape data type.
Background
The geo_shape data type facilitates the indexing and searching with arbitrary geo shapes such as rectangles and polygons. It gets used when we want to index the shapes(like Line, MultiLine, Polygon etc) other than just points in a geographical context.
Aggregations
As of OpenSearch 1.0(derived from ElasticSearch 7.10.x), aggregations are supported on Geo Point data type not on the Geo Shape. We will be adding 4 different Aggregations on the Geo Shape data type of Open Search.
- Geo Bounds Aggregation
- Geo Centroid Aggregation
- Geo Hash Aggregation
- Geo Tile Aggregation
Geo Bounds Aggregation
A metric aggregation that computes the bounding box containing all geo values for a field.
Geo Centroid Aggregation
A metric aggregation that computes the centroid from all coordinate values for geo fields. The centroid calculation implements the ISO/IEC 13249-3:2016 SQL/MM specification, section 8.1.6.
Geo Hash Aggregation
Geo Hash is multi-bucket aggregation that will be grouping Geo Shapes into buckets which represent cells in a grid. Each cell is labeled using a geohash which is of user-definable precision. The internal working and output of the aggregation will be very similar to Geo Points except that a single shape can be counted for multiple tiles if any part of the shape intersects with that tile.
Geo Tile Aggregation
Geo Tile is multi-bucket aggregation that will be grouping Geo Shapes into buckets which represents map tiles as used by many online map sites. Each cell/tile will be labeled using the format : {zoom}/{x}/{y}, where zoom will be equal to the user-specified precision provided as input. The internal working and output of the aggregation will be very similar to Geo Points except that a single shape can be counted for multiple cells if any part of the shape intersects with that cell.
Plan
We will be launching the metrics aggregations(Geo Bounds and Geo Centroid) first and then moving towards the Geo Tile and Hash Aggregation.
Next Steps
As a next steps we will be adding 1 RFC for each of the above aggregation with more details around each aggregation.
Customer Request
- https://forum.opensearch.org/t/support-for-geo-distance-queries-sorting-on-geo-shape-fields/7777/6
- [FEATURE] Add support for geo_shape fields #55
References
- GeoBound on Geo Points: https://opensearch.org/docs/latest/opensearch/metric-agg/#geo_bound
- Zoom Level Documentation: https://wiki.openstreetmap.org/wiki/Zoom_levels
- Centroid: https://en.wikipedia.org/wiki/Centroid
- Geo Hash: https://en.wikipedia.org/wiki/Geohash
- Map Tile: https://en.wikipedia.org/wiki/Tiled_web_map
- ISO/IEC: https://www.iso.org/obp/ui/#iso:std:iso-iec:13249:-3:ed-5:v1:en