[GH-2527] Implement GeoPandas concave_hull - #2529
Conversation
|
Hi @petern48 I'm encountering a test failure in our Sedona/GeoPandas parity suite for concave_hull(Passing in my local). The error is due to the vertex order of polygons returned by Sedona and GeoPandas being different, even though the polygons are geometrically identical. Our current comparison uses equals_exact(assert_geometry_almost_equal), which might be sensitive to vertex order:
https://github.com/apache/sedona/actions/runs/19687051539/job/56394868966?pr=2529 Would it be acceptable to change our comparison from equals_exact to equals for polygons, so that we check geometric equality rather than strict vertex order? Or is there a recommended workaround for this situation, or something I might be missing in our test setup? Thank you for your guidance! |
The issue is not whether we're using Script to test using equals insteadAs you can see above, these geometries actually are different. Why this is happening, I'm not sure. It could either be a bug in Sedona's function or a difference in algorithms or edge case behaviors. If it's a significant bug, we may want to hold off. If it's a reasonable difference in behavior that's still correct, we can add a note in the docs and merge this anyway. Either way, we need to understand what's happening before merging. I encourage you to investigate, though you're not obligated to, of course, and can continue with something else instead. |
There was a problem hiding this comment.
Pull request overview
Implements and hardens concave_hull parity for the Sedona GeoPandas API by refining Python-side typing/docs and expanding unit/parity test coverage (including allow_holes=True cases) to better match GeoPandas behavior.
Changes:
- Expanded GeoPandas parity tests to cover multiple
ratiovalues and anallow_holes=Truefixture designed to avoid JTS/GEOS triangulation tie ambiguity. - Added a deterministic
allow_holes=Trueconcave hull expectation inGeoSeriesunit tests. - Added a return type annotation for
GeoSeries.concave_hulland improved end-user docstring content.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| python/tests/geopandas/test_match_geopandas_series.py | Extends parity tests for concave_hull across ratio values and validates allow_holes=True behavior. |
| python/tests/geopandas/test_geoseries.py | Adds a dedicated allow_holes=True concave hull assertion with an asymmetric point set. |
| python/sedona/spark/geopandas/geoseries.py | Adds GeoSeries return type annotation for concave_hull. |
| python/sedona/spark/geopandas/base.py | Updates concave_hull docstring (but currently contains a misleading algorithm/parameter explanation). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


Did you read the Contributor Guide?
Is this PR related to a ticket?
[GH-XXX] my subject. Closes Geopandas: Implement concave_hull #2527What changes were proposed in this PR?
How was this patch tested?
Did this PR include necessary documentation updates?