Skip to content

GH-4265: Add GeoSPARQL 1.1 area functions - #4266

Open
edmondchuc wants to merge 2 commits into
apache:mainfrom
edmondchuc:feat/geosparql/area-functions
Open

edmondchuc wants to merge 2 commits into
apache:mainfrom
edmondchuc:feat/geosparql/area-functions

Conversation

@edmondchuc

@edmondchuc edmondchuc commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

GitHub issue resolved #4265

Adds GeoSPARQL 1.1 geof:area and geof:metricArea functions, along with corresponding area() methods on GeometryWrapper.

  • geof:metricArea(?geom): Returns the area in square metres.
  • geof:area(?geom, ?unit): Returns the area in an explicit QUDT area unit, such as qudt:KiloM2, qudt:HA, or qudt:AC.

CRS handling and area implementation

Note that geometries in geographic CRSs are rejected with an evaluation error rather than computing misleading planar areas from angular coordinates.

For projected CRSs, area is calculated in the source CRS. For recognised geographic CRSs, area is approximated on the source ellipsoid using a local equal-area projection. Geographic Polygons extending beyond the supported local projection may produce an evaluation error.

GeoSPARQL 1.1 requires a result of zero for geometry types other than Polygon.

Support for geographic CRS area calculations was added in cc67a9a.

Area units

Area units are handled separately from the existing public UnitsOfMeasure abstraction. That abstraction currently supports CRS length and angular units and does not provide quantity-typed lookup, so this change uses a small package-private AreaUnitsOfMeasure registry rather than broadening the existing public unit API. We could streamline this, but a design discussion in an issue should probably take place first.


  • 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.

Implement geof:area and geof:metricArea.
@edmondchuc
edmondchuc force-pushed the feat/geosparql/area-functions branch from 8ae17e6 to 91fce2a Compare September 28, 2026 04:12
@afs afs added the GeoSPARQL label Sep 28, 2026
@edmondchuc
edmondchuc marked this pull request as draft September 29, 2026 03:47
@edmondchuc
edmondchuc force-pushed the feat/geosparql/area-functions branch from ab8c8bb to 9951fbe Compare September 29, 2026 04:12
@edmondchuc
edmondchuc marked this pull request as ready for review September 29, 2026 04:19
@edmondchuc
edmondchuc force-pushed the feat/geosparql/area-functions branch from 9951fbe to accb4df Compare September 29, 2026 05:13
@edmondchuc
edmondchuc force-pushed the feat/geosparql/area-functions branch from accb4df to cc67a9a Compare September 29, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add GeoSPARQL 1.1 geof:area and geof:metricArea functions

2 participants