Repository navigation
Support grouping aggregations by geographic tile #1426
zandt-square
started this conversation in
Ideas
Replies: 1 comment 3 replies
|
I'm on board with this idea. Some random thoughts/questions...
type GeoTile {
latitude: Float
longitude: Float
zoomLevel: Int
}Although now I'm thinking this might make more sense: type GeoTile {
centerPoint: GeoLocation
zoomLevel: Int
}I think I lean that way, but let me know which you prefer.
@zandt-square are you planning to implement this? |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Feature request
I'd like to explore adding geographic grouping for
GeoLocationfields.For some context, we can currently group records by dimensions such as status, category, country, region, etc. I'd like to group by smaller geographic areas so we can visualize how activity varies by location.
Geographic filtering helps when we already know which area to look at. A grouping would help us figure out where to look in the first place.
There's a few use cases where I think this could add value:
Proposed API
Would it be feasible to expose an
asGeoTilegrouping onGeoLocationfields? For example, using an illustrative event schema:The result could be a tile key such as
8/x/y, which the client can use to visualize the results on a map.Precision corresponds to a Web Mercator zoom level. Precision 8 produces tiles about 98 miles wide at the equator, though the size varies by latitude. That seems like a reasonable starting point, with the precision configurable depending on the query.
How this might fit
Looking at the existing date/time grouping API,
asGeoTileseems like it could follow a similar pattern through aGeoLocationGroupedBytype.Root aggregations already use composite sources to combine grouping dimensions and paginate results. Both Elasticsearch and OpenSearch support a
geotile_gridcomposite source, so that seems like a possible way to add this while preserving the existing behavior.We'd need to explicitly enable grouping for
GeoLocation, since objects with custom mappings aren't currently included ingroupedBy. Precision limits and support for nested sub-aggregations would also need some thought.I'm open to a different API shape, but wanted to raise this for discussion before getting into an implementation.
References:
All reactions