opengeospatial / ogc-geosparql

Public Repository for the OGC GeoSPARQL Standards Working Group
71 stars 19 forks source link

Latitude and Longitude Functions #526

Open situx opened 3 weeks ago

situx commented 3 weeks ago

As suggested in #160 I am proposing the inclusion of a latitude and a longitude function for GeoSPARQL.

We may have two possibilities for definition here:

  1. Define the function for points only (which was also implemented in the Apache Jena extension)
  2. Define the function for all geometries. For geometries other than points find a solution as to which latitude/longitude to return. My current proposal says "return the latitude/longitude of the centroid of the given geometry" but that is just one possible proposal.

@nicholascar and @SimonBin any opinions?

SimonBin commented 3 weeks ago

I think doing 1. is fine, as for prior art we have e.g. MySQL: https://dev.mysql.com/doc/refman/8.4/en/gis-point-property-functions.html#function_st-latitude

if the user desires the outcome of 2., they can call geof:centroid manually

situx commented 3 weeks ago

I think doing 1. is fine, as for prior art we have e.g. MySQL: https://dev.mysql.com/doc/refman/8.4/en/gis-point-property-functions.html#function_st-latitude

if the user desires the outcome of 2., they can call geof:centroid manually

Makes sense to me. I will take this to the next GeoSPARQL meeting on Wednesday and we will form an opinion in the group.

jabhay commented 2 weeks ago

Discussion in the group:

Should this be for points only? Options presented were:

  1. Define the function for points only (which was also implemented in the Apache Jena extension)
  2. Define the function for all geometries. For geometries other than points find a solution as to which latitude/longitude to return. My current proposal says "return the latitude/longitude of the centroid of the given geometry" but that is just one possible proposal.

Option 1 was selected as there is already a function provided to get the centroid of a shape other than a point. We don't want to make assumptions over how to chain this together to produce a result for non-Points given the functions required for the user to decide that are available.

How should the centroid be returned? Options presented:

  1. Always a particular unit.
  2. In the unit of the CRS.

Option 2 was selected as it is aligned with how Simple Features functions work.

nicholascar commented 6 days ago
  1. Please add the function definition to the B.1. Functions Summary Table
  2. Please provide an example in Annex C - GeoSPARQL Examples
situx commented 6 days ago

Meeting 26th June: We decided to rename the functions to geof:easting and geof:northing so that values in meter may be returned

situx commented 3 days ago

The pull request is, therefore, again ready for review and I notify @SimonBin that he can follow the discussions we had in this pull request.