-
Notifications
You must be signed in to change notification settings - Fork 23
Description
A common pattern when using FlowClient is to get the result of a spatially-aggregated query, get the corresponding geography data, and join them so they can be used together to create a map visualisation. This join is an extra step that the user has to implement themselves. The simplest way to do this is to load the geography geojson into a geopandas GeoDataFrame and join this to the pandas DataFrame query result, but geopandas is not a dependency of flowclient, and has its own dependencies that can sometimes cause conflicts, so some users may prefer not to use geopandas.
It would be useful to add an API route from which a user could get a geojson object with geography data and the results of one or more spatially-aggregated queries as properties. This could either be implemented as a new query kind, an additional parameter in the geography
endpoint (which could take one or more query IDs to join), or a new API endpoint. I'd favour one of the last two options, since the data type returned (geojson) will be different from that of an ordinary query.
I expect this would also be useful in scenarios where a different application (such as a dashboard) is interacting with the API, and it would be convenient to get a single geojson object for visualisation purposes with minimal client-side manipulation of the results.