Skip to content

[GH-2230] Implement GeoSeries: reverse, normalize, representative_point#2701

Merged
jiayuasu merged 1 commit intomasterfrom
geopandas-tier1-batch-a
Mar 11, 2026
Merged

[GH-2230] Implement GeoSeries: reverse, normalize, representative_point#2701
jiayuasu merged 1 commit intomasterfrom
geopandas-tier1-batch-a

Conversation

@jiayuasu
Copy link
Member

@jiayuasu jiayuasu commented Mar 10, 2026

Did you read the Contributor Guide?

Is this PR related to a ticket?

What changes were proposed in this PR?

Implement three GeoSeries methods by delegating to Sedona ST functions:

  • reverse()ST_Reverse
  • normalize()ST_Normalize
  • representative_point()ST_PointOnSurface

Each function follows the established pattern from #2232:

  • base.py: Docstring with examples + _delegate_to_geometry_column call
  • geoseries.py: ST function call via _query_geometry_column
  • test_geoseries.py: Unit test with expected values + GeoDataFrame delegation test
  • test_match_geopandas_series.py: Comparison test against real geopandas output

How 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 geopandas

All 6 tests pass locally. No regressions in existing tests.

Did this PR include necessary documentation updates?

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(), and line_merge() in geoseries.py.
  • Add delegation methods + GeoPandas-style docstrings/examples in base.py for the same APIs.
  • Add/extend tests in test_geoseries.py and test_match_geopandas_series.py to 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.

@jiayuasu jiayuasu force-pushed the geopandas-tier1-batch-a branch from 59da0ed to 00c25f3 Compare March 10, 2026 08:13
@jiayuasu jiayuasu changed the title [GH-2230] Implement GeoSeries: reverse, normalize, representative_point, line_merge [GH-2230] Implement GeoSeries: reverse, normalize, representative_point Mar 10, 2026
@jiayuasu jiayuasu requested a review from Copilot March 10, 2026 08:14
@jiayuasu jiayuasu marked this pull request as draft March 10, 2026 08:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
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.

[EPIC] Implement More Geopandas Functions

2 participants