-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Spatial Aggregate functions #7
Comments
I just discovered SPARQL-MM which might help with this issue. |
This looks like a change request for GeoSPARQL. It should probably be added to the OGC issue tracker (http://ogc.standardstracker.org), if it's not already there. |
Thank you FransKnibbe, I have now filed it as request 626 http://ogc.standardstracker.org/show_request.cgi?id=626 |
A basic version of Temporal Aggregates is described in https://w3c.github.io/sdw/time-aggregates/ |
Even though we marked this issues as GeoSPARQL 1.1, we should think about which aggregates to define for GeoSPARQL 1.1. |
As we are working towards tackling this issue for GeoSPARQL 1.1: I would propose the following functions to be included:
Functions from related work I am not sure whether to integrate them:
Functions that need further discussions (GeoSPARQL 2.0):
Are there any other spatial aggregate functions which I forgot that should be included? |
I do not see the MIN, MAX, AVG X/Y/Z aggregates supported by SQL Sever, Post GIS or Oracle. Would MIN/MAX be handled by BBOX? Also, what is the general use case for AVG X/Y/Z? The others, including CONCAT_LINES and CONCAVEHULL, look good to me. |
Wouldn't it be sufficient to have min and max x/y/z functions for single geometries? That is, if there is an aggregate bounding box function, which is useful to have anyway. Then one could just get the min/max coordinates from the bounding box. |
I agree that a BBOX function is sufficient if you could get the X,Y coordinates from it. Maybe I do not know how to do this, but currently I do not know how to write a query like: Referring to Frans: |
I agree that it is a good idea to define MIN/MAX X/Y for a single geometry. Then we can use it for aggregates with BBOX, and it will also be useful in other non-aggregate cases. |
Based on the comments, it looks like a proposal would be: Aggregates: New Functions on Single Geometries: |
@situx since your additions based on this request are merged into master, can you review this and close if you're happy? We still have the OGC Change Request to close upon publication of 1.1. |
It is on my TODO. I will close it once my pull request for the fixes is finished |
Please put a "Fixes #7" in the PR description so that, when merged, it will auto-close this. |
We have added this to GeoSPARQL 1.1 so I will close this issue |
Geospatial literals currently cannot be queried using traditional aggregate functions such as MIN,MAX,AVG.
However it may be useful to get the minimum or maximum X,Y or Z coordinate for a given set of geometries which is currently not possible in GeoSPARQL.
One use case could be: Finding a bounding box of a set of geometries for which a minimum X,Y and maximum X,Y coordinate of all geometries within a graph would be needed.
To my knowledge there is no such functionality currently available in GeoSPARQL.
My proposal:
Adding the following aggregate functions:
MINX, MINY, MAXX, MAXY, MINZ, MAXZ
In addition adding a BBOX aggregate method which would calculate a minimum bounding box of a set of geometries bound to a query variable.
I have not yet found a use case for an AVG aggregate function so I would neglect it, however, maybe there are some ideas about that from the community.
The text was updated successfully, but these errors were encountered: