[GH-2230] Implement GeoSeries: reverse, normalize, representative_point#2701
Merged
[GH-2230] Implement GeoSeries: reverse, normalize, representative_point#2701
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Implements four missing GeoSeries methods in Sedona GeoPandas by delegating to corresponding Sedona ST_* functions, and adds unit + GeoPandas-compatibility tests to validate behavior.
Changes:
- Implement
GeoSeries.reverse(),normalize(),representative_point(), andline_merge()ingeoseries.py. - Add delegation methods + GeoPandas-style docstrings/examples in
base.pyfor the same APIs. - Add/extend tests in
test_geoseries.pyandtest_match_geopandas_series.pyto validate behavior and compare with GeoPandas.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| python/sedona/spark/geopandas/geoseries.py | Adds ST-function-backed implementations for the four GeoSeries methods. |
| python/sedona/spark/geopandas/base.py | Exposes the methods on the base GeoFrame API with docstrings/examples and delegation. |
| python/tests/geopandas/test_geoseries.py | Adds unit tests (including GeoDataFrame delegation checks) for the new methods. |
| python/tests/geopandas/test_match_geopandas_series.py | Adds GeoPandas parity tests for the new methods (scoped for line_merge). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
59da0ed to
00c25f3
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Implement three GeoSeries methods by delegating to Sedona ST functions: - reverse() -> ST_Reverse - normalize() -> ST_Normalize - representative_point() -> ST_PointOnSurface Each function is implemented in geoseries.py, with docstrings and delegation support in base.py, and tests in both test_geoseries.py and test_match_geopandas_series.py. line_merge is deferred pending a Sedona bug fix (#2702): ST_LineMerge returns GEOMETRYCOLLECTION EMPTY for bare LineString input instead of passing it through like PostGIS/GEOS. Part of: #2230
00c25f3 to
7d05340
Compare
This was referenced Mar 11, 2026
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 subject. Closes [EPIC] Implement More Geopandas Functions #2230What changes were proposed in this PR?
Implement three GeoSeries methods by delegating to Sedona ST functions:
reverse()→ST_Reversenormalize()→ST_Normalizerepresentative_point()→ST_PointOnSurfaceEach function follows the established pattern from #2232:
_delegate_to_geometry_columncall_query_geometry_columnHow was this patch tested?
Added tests in:
test_geoseries.py: 3 new tests (test_reverse,test_normalize,test_representative_point)test_match_geopandas_series.py: 3 new tests comparing Sedona GeoSeries output against geopandasAll 6 tests pass locally. No regressions in existing tests.
Did this PR include necessary documentation updates?