Skip to content

Conversation

@Kontinuation
Copy link
Member

@Kontinuation Kontinuation commented Feb 1, 2026

Did you read the Contributor Guide?

Is this PR related to a ticket?

What changes were proposed in this PR?

ST_AreaSpheroid/Spheroid.area previously computed spheroidal area for a Polygon by feeding geom.getCoordinates() into GeographicLib PolygonArea, which flattens exterior + interior rings and can yield incorrect results for polygons with holes / complex geometries.

This PR computes area as exterior ring area minus the sum of interior ring areas (holes), by computing each ring independently.

How was this patch tested?

Did this PR include necessary documentation updates?

  • No, this PR does not affect any public API so no need to change the documentation.

@Kontinuation Kontinuation marked this pull request as draft February 1, 2026 03:34
@Kontinuation Kontinuation marked this pull request as ready for review February 1, 2026 08:23
@jiayuasu jiayuasu added this to the sedona-1.9.0 milestone Feb 2, 2026
@jiayuasu jiayuasu merged commit 6548069 into apache:master Feb 2, 2026
50 checks passed
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.

bug: ST_AreaSpheroid returns wrong result sometimes

2 participants