GH-4265: Add GeoSPARQL 1.1 area functions - #4266
Open
edmondchuc wants to merge 2 commits into
Open
edmondchuc wants to merge 2 commits into
edmondchuc wants to merge 2 commits into
Conversation
Implement geof:area and geof:metricArea.
edmondchuc
force-pushed
the
feat/geosparql/area-functions
branch
from
September 28, 2026 04:12
8ae17e6 to
91fce2a
Compare
edmondchuc
marked this pull request as draft
September 29, 2026 03:47
edmondchuc
force-pushed
the
feat/geosparql/area-functions
branch
from
September 29, 2026 04:12
ab8c8bb to
9951fbe
Compare
edmondchuc
marked this pull request as ready for review
September 29, 2026 04:19
edmondchuc
force-pushed
the
feat/geosparql/area-functions
branch
from
September 29, 2026 05:13
9951fbe to
accb4df
Compare
edmondchuc
force-pushed
the
feat/geosparql/area-functions
branch
from
September 29, 2026 06:25
accb4df to
cc67a9a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub issue resolved #4265
Adds GeoSPARQL 1.1
geof:areaandgeof:metricAreafunctions, along with correspondingarea()methods onGeometryWrapper.geof:metricArea(?geom): Returns the area in square metres.geof:area(?geom, ?unit): Returns the area in an explicit QUDT area unit, such asqudt:KiloM2,qudt:HA, orqudt: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
UnitsOfMeasureabstraction. That abstraction currently supports CRS length and angular units and does not provide quantity-typed lookup, so this change uses a small package-privateAreaUnitsOfMeasureregistry rather than broadening the existing public unit API. We could streamline this, but a design discussion in an issue should probably take place first.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.