[GH-3162][GH-3163][GH-3164] Add distributed GeoSeries geometry methods - #3165
Merged
jiayuasu merged 3 commits intoJul 25, 2026
Merged
Conversation
…es geometry methods
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends Sedona’s distributed GeoPandas-like API by adding three lazy, fully-distributed GeoSeries geometry methods (and GeoDataFrame delegation) implemented via native Sedona Spark SQL expressions, along with direct and GeoPandas parity tests to validate behavior and metadata preservation.
Changes:
- Add distributed
GeoSeries.has_mwith special handling for mixed-dimensionalGeometryCollectionparity with GeoPandas. - Add distributed
GeoSeries.minimum_clearance_lineusingST_MinimumClearanceLinewhile preserving SRID. - Add distributed
GeoSeries.constrained_delaunay_trianglesusingST_TriangulatePolygon, with SRID-preserving empty-input handling and new direct/parity tests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| python/sedona/spark/geopandas/geoseries.py | Implements has_m, minimum_clearance_line, and constrained_delaunay_triangles using Sedona expressions and edge-case handling. |
| python/sedona/spark/geopandas/base.py | Adds GeoDataFrame/GeoSeries delegation and docstrings/examples for the new APIs. |
| python/tests/geopandas/test_geoseries.py | Adds direct tests for edge cases, SRID/CRS/index preservation, and delegation behavior. |
| python/tests/geopandas/test_match_geopandas_series.py | Adds version-gated GeoPandas parity tests for the new APIs. |
Comments suppressed due to low confidence (1)
python/tests/geopandas/test_match_geopandas_series.py:920
shapely.geos_version_stringmay include extra suffixes (e.g.3.11.2-CAPI-...) that are not PEP 440–compatible, which can makepackaging.version.parse(...)raiseInvalidVersionor behave unexpectedly. Parse only the leading numeric part before doing the GEOS version gate.
if parse_version(shapely.__version__) < parse_version("2.1.0"):
pytest.skip(
"geopandas constrained_delaunay_triangles requires shapely 2.1.0 or higher"
)
if parse_version(shapely.geos_version_string) < parse_version("3.10.0"):
pytest.skip("constrained_delaunay_triangles requires GEOS 3.10.0 or higher")
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+790
to
+793
| if parse_version(shapely.__version__) < parse_version("2.1.0"): | ||
| pytest.skip("geopandas has_m requires shapely 2.1.0 or higher") | ||
| if parse_version(shapely.geos_version_string) < parse_version("3.12.0"): | ||
| pytest.skip("has_m requires GEOS 3.12.0 or higher") |
jiayuasu
marked this pull request as ready for review
July 25, 2026 05:35
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.
Did you read the Contributor Guide?
Is this PR related to a ticket?
[GH-XXX] my subjectformat.What changes were proposed in this PR?
GeoSeries.has_mand GeoDataFrame delegation using native Sedona expressions. Mixed-dimensional GeometryCollections check all component points so their result matches GeoPandas.GeoSeries.minimum_clearance_lineand GeoDataFrame delegation usingST_MinimumClearanceLine, while retaining the input SRID for degenerate geometries.GeoSeries.constrained_delaunay_trianglesand GeoDataFrame delegation usingST_TriangulatePolygon. Empty inputs return an SRID-preserving empty GeometryCollection instead of reaching the JTS empty-polygon failure path.All three methods remain lazy and distributed; they do not collect geometry data to the driver or use Python row UDFs.
How was this patch tested?
has_z,delaunay_triangles, andminimum_clearancedirect and parity tests: 6 passed.Did this PR include necessary documentation updates?