Skip to content

GH-4221: Add six GeoSPARQL 1.1 coordinate extrema functions - #4222

Open
edmondchuc wants to merge 3 commits into
apache:mainfrom
edmondchuc:feat/geosparql/coordinate-functions
Open

edmondchuc wants to merge 3 commits into
apache:mainfrom
edmondchuc:feat/geosparql/coordinate-functions

Conversation

@edmondchuc

@edmondchuc edmondchuc commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

GitHub issue resolved #4221

Adds the following GeoSPARQL 1.1 coordinate extrema functions:

  • geof:minX
  • geof:maxX
  • geof:minY
  • geof:maxY
  • geof:minZ
  • geof:maxZ

They return xsd:double and are also available through GeometryWrapper.

X and Y follow the input SRS axis order. For example,

EPSG:4326 LINESTRING(10 100, 20 120)

gives maxX = 20 and maxY = 120.

This follows the function vocabulary’s first/second-dimension wording. I’ve opened GeoSPARQL #700 to clarify that wording across the related functions.

For Z, we inspect each member’s coordinate sequence independently. Members without Z are ignored, so measures aren’t mistaken for Z. NaN Z values are treated as missing; infinite Z values raise an expression error. If no finite Z value exists anywhere in the geometry, the function raises an expression error. Mixed-dimension collections give the same result regardless of member order.

X/Y extrema reject NaN and infinite values in the ordinate being evaluated. Empty geometries and inputs with no eligible ordinate also raise expression errors.

This also fixes coordinate handling that could lose Z/M values or declared layouts when reversing SRS axes, copying, cloning, or converting coordinate sequences. Measures-aware allocation preserves XYM when JTS splits a MultiPoint into individual points, preventing M values from being mistaken for Z.


  • Tests are included.
  • Documentation change and updates are provided for the Apache Jena website
  • Commits have been squashed to remove intermediate development commit messages.
  • Key commit messages start with the issue number (GH-xxxx)

By submitting this pull request, I acknowledge that I am making a contribution to the Apache Software Foundation under the terms and conditions of the Contributor's Agreement.


See the Apache Jena "Contributing" guide.

@edmondchuc
edmondchuc force-pushed the feat/geosparql/coordinate-functions branch 2 times, most recently from 6aab2d5 to c8ff7d7 Compare September 14, 2026 06:23
@edmondchuc
edmondchuc force-pushed the feat/geosparql/coordinate-functions branch 4 times, most recently from 72e6179 to 74a8556 Compare September 14, 2026 16:49
@edmondchuc
edmondchuc force-pushed the feat/geosparql/coordinate-functions branch from 74a8556 to a5bc3c9 Compare September 14, 2026 17:15
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.

Add GeoSPARQL 1.1 coordinate extrema functions

1 participant