Skip to content
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

Including common Non SFA functions #536

Open
wants to merge 28 commits into
base: geosparql-1.3
Choose a base branch
from
Open

Conversation

situx
Copy link
Collaborator

@situx situx commented Jul 12, 2024

Closes #257
Closes #341
Closes #400

  • aggCollect function
  • DWithin function
  • metricDWithin function
  • isCollection function
  • simplifyDP function

@situx situx changed the base branch from master to geosparql-1.3 July 12, 2024 15:23
@situx situx marked this pull request as ready for review July 12, 2024 15:34
Copy link
Collaborator

@nicholascar nicholascar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Why are acronyms used here like DWithin when previous functions all use full wording such as hasMetricParameterLength? Prefer consistencey across all functions unless a justification is provided
  • Reference for the Douglas-Peucker algorithm needed

@situx
Copy link
Collaborator Author

situx commented Aug 5, 2024

Valid points.
Should we name it geof:DistanceWithin then?

@reference:
David Douglas, Thomas Peucker: Algorithms for the reduction of the number of points required to represent a digitized line or its caricature. In: The Canadian Cartographer. Band 10, Nr. 2, 1973, ISSN 0008-3127, S. 112–122.

Copy link
Collaborator

@mperry455 mperry455 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending suggested changes by @nicholascar

geof:aggCollect (geom: ogc:geomLiteral): ogc:geomLiteral
```

The function http://www.opengis.net/def/function/geosparql/aggCollect[`geof:aggCollect`] calculates creates a GeometryCollection literal out of a set of geometries.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "calculates creates"

Copy link
Collaborator

@VladimirAlexiev VladimirAlexiev Aug 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does geom: ogc:geomLiteral indicate that it's an array/set?

Copy link
Collaborator Author

@situx situx Aug 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a set of ogc:geomLiterals in practice likely bound to a SPARQL variable like in other functions too.
The content of the ogc:geomLiterals could be arrays, e.g. a WKT GeometryCollection could be considered as an array.
Does that answer your question or would you have a different idea how to mark an array/set?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@situx I saw your answer in another issue that one geomLiteral can carry a collection.
But I think this is different: aggregates work on a resultset of multiple geomLiterals, so the function signature should indicate an array. Eg use geomLiteral*

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My comment is answered. But @mperry455 's comment not answered yet

@mperry455
Copy link
Collaborator

I feel like geof:withinDistance reads a little better than geof:distanceWithin.

@jabhay jabhay marked this pull request as draft August 7, 2024 20:30
@VladimirAlexiev
Copy link
Collaborator

Rename simplifyDP to simplify. When another (less popular algorithm) needs to be added, it can get a longer name simplifyFoo.

Simplify! :-)

@jabhay
Copy link
Collaborator

jabhay commented Aug 7, 2024

Discussed simplifyDP function. Given it's the only simplification function being considered currently, we arrived at the decision to call it just simplify.

@situx situx marked this pull request as ready for review August 8, 2024 18:23
Copy link
Collaborator

@VladimirAlexiev VladimirAlexiev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

geomLiteral array

@jabhay
Copy link
Collaborator

jabhay commented Sep 4, 2024

Would be good to get a few eyes on the options below. Please indicate your preferred options by using thumbs up. You can thumbs down if you're very much against an option.

Can people add their thoughts to this before next meeting? Please indicate which option you like. All options require that we add an explanation in the explanatory notes section up top.

@jabhay
Copy link
Collaborator

jabhay commented Sep 4, 2024

  1. Recommended above: geomLiteral*

@jabhay
Copy link
Collaborator

jabhay commented Sep 4, 2024

  1. Other option in line with other programming languages: geomLiteral[] and add explanatory text to describe it.

@jabhay
Copy link
Collaborator

jabhay commented Sep 4, 2024

  1. Leave as is, and explain it

@jabhay
Copy link
Collaborator

jabhay commented Sep 18, 2024

Voting result: annotate as ogc:geomLiteral[] and add explanatory text to describe it.

@situx
Copy link
Collaborator Author

situx commented Sep 19, 2024

I added the array notation to all spatial aggregate functions, added a paragraph to explain the syntax and corrected some mistakes. The PR is therefore again ready for review.

@@ -1203,6 +1203,8 @@ Implementations shall support the functions
<<Function: geof:boundingCircle, `geof:boundingCircle`>>,
<<Function: geof:metricBuffer, `geof:metricBuffer`>>,
<<Function: geof:buffer, `geof:buffer`>>,
<<Function: geof:metricWithinDistance, `geof:metricWithinDistance`>>,
<<Function: geof:WithinDistance, `geof:WithinDistance`>>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lowercase 'w'? geof:withinDistance instead of geof:WithinDistance


Returns true if `geom2` is within a given distance of `geom1`. Calculations are according to the units in the spatial reference system of `geom1`. The triple store implementation needs to take care of a conversion between meter and the unit of the spatial reference system.

==== Function: geof:sfWithinDistance
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

geof:withinDistance?

@@ -57,6 +57,12 @@ The following IRI namespace prefixes are used throughout this document:

All of these namespace prefixes in the previous section resolve to resources that contain their namespace content except for `eg:` (`http://example.com/`), which is used just for examples, and `ogc:` (`http://www.opengis.net/`), which is used in requirement specifications as a placeholder for the geometry literal serialization used in a fully-qualified conformance class, e.g. http://www.opengis.net/ont/geosparql#wktLiteral[`+<http://www.opengis.net/ont/geosparql#wktLiteral>+`].

=== Data Types for Spatial Aggregate Functions

In this specification we use the placeholder URI ogc:geomLiteral to describe any geometry literal which is defined in this specification.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which -> that

=== Data Types for Spatial Aggregate Functions

In this specification we use the placeholder URI ogc:geomLiteral to describe any geometry literal which is defined in this specification.
To express a list of such literals, for example as input parameters for spatial aggregate functions, we use the notation ogc:geomLiteral[].
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't you need to put ogc:geomLiteral[] in some code markers? (I'm not familiar with adoc)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think so. However, should we find it disturbing we can still correct the styling later on


In this specification we use the placeholder URI ogc:geomLiteral to describe any geometry literal which is defined in this specification.
To express a list of such literals, for example as input parameters for spatial aggregate functions, we use the notation ogc:geomLiteral[].
We do not define the order of ogc:geomLiteral[]. The order is to be determined by implementers.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand that. A "list" is ordered, so how do you mean implementers can change it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A list is ordered. But how it is ordered, e.g., by URI alphabetically or not at all, should be up to the implementers.

distance: xsd:double): xsd:boolean
```

Returns true if `geom2` is within a given distance of `geom1`. Calculations are according to the units in the spatial reference system of `geom1`. The triple store implementation needs to take care of a conversion between meter and the unit of the spatial reference system.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"given distance of geom1" -> add "in meters"

geof:aggCollect (geom: ogc:geomLiteral): ogc:geomLiteral
```

The function http://www.opengis.net/def/function/geosparql/aggCollect[`geof:aggCollect`] calculates creates a GeometryCollection literal out of a set of geometries.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My comment is answered. But @mperry455 's comment not answered yet

@mperry455
Copy link
Collaborator

mperry455 commented Oct 16, 2024

Per SWG discussion on 10/16/2024:
Regarding ordering of ogc:geometryLiteral[] input to aggregates to make result CRS deterministic, it may be hard to enforce an ordering on implementers. Here are some possible options:

  1. Leave it up to implementers to determine the output CRS
  2. Add a new target_crs argument to aggregate functions
  3. Document that users can transform the output of the aggregate to their desired CRS
  4. Specify an ordering criteria

Please comment on this thread with opinions on the options.

@nicholascar
Copy link
Collaborator

Per SWG discussion on 10/16/2024: Regarding ordering of ogc:geometryLiteral[] input to aggregates to make result CRS deterministic, it may be hard to enforce an ordering on implementers. Here are some possible options:

1. Leave it up to implementers to determine the output CRS

2. Add a new target_crs argument to aggregate functions

3. Document that users can transform the output of the aggregate to their desired CRS

4. Specify an ordering criteria

Please comment on this thread with opinions on the options.

I vote for:

  1. Document that users can transform the output of the aggregate to their desired CRS

(if the implementers support this functionality - probably will)

ultimately

  1. Leave it up to implementers to determine the output CRS

@jabhay
Copy link
Collaborator

jabhay commented Nov 13, 2024

Vote regarding ordering of ogc:geometryLiteral[] input to aggregates to make result CRS deterministic. Thumbs up is in favour, Thumbs down is have objections.

@jabhay
Copy link
Collaborator

jabhay commented Nov 13, 2024

Option 1: Leave it up to implementers to determine the output CRS

@jabhay
Copy link
Collaborator

jabhay commented Nov 13, 2024

Option 2: Add a new target_crs argument to aggregate functions

@jabhay
Copy link
Collaborator

jabhay commented Nov 13, 2024

Option 3: Document that users can transform the output of the aggregate to their desired CRS and then leave it up to implementers to determine the output CRS

@jabhay
Copy link
Collaborator

jabhay commented Nov 13, 2024

Option 4: Specify an ordering criteria

@situx
Copy link
Collaborator Author

situx commented Feb 16, 2025

I added a comment on parameters of spatial aggregate functions, so this pull request is now again ready for review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No function to collect geometries? Within-Distance operator support A function for simplifying geometry
5 participants