[GH-3147] Implement distributed GeoPandas skew - #3148
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Implements distributed GeoPandas-compatible skew for Sedona’s Spark GeoPandas layer by expressing shearing via ST_Affine, while sharing affine-family scalar validation and adding regression/parity tests.
Changes:
- Added
GeoSeries.skew(with per-row"center"/"centroid"origins and explicit tuple/Point origins) implemented as a distributedST_Affineoperation. - Refactored affine-family scalar normalization into a shared helper and reused it in
affine_transformandscale. - Added unit/regression tests plus GeoPandas parity coverage for skew across geometry families, origins, degrees/radians, and 3D Z preservation.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| python/sedona/spark/geopandas/geoseries.py | Adds _normalize_affine_scalar, refactors affine/scale validation, and implements distributed GeoSeries.skew via ST_Affine. |
| python/sedona/spark/geopandas/base.py | Adds GeoFrame.skew delegation (enables GeoDataFrame active-geometry delegation) and public docstring. |
| python/tests/geopandas/test_geoseries.py | Adds direct skew regression tests for angles/units, origins, metadata preservation, and delegation. |
| python/tests/geopandas/test_match_geopandas_series.py | Adds GeoPandas parity tests for skew (2D, radians, and 3D Z preservation). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
75 tasks
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.
What changed
GeoSeries.skewand active-geometry delegation fromGeoDataFrame.ST_Affineoperation with per-row center or centroid origins.affine_transform,scale, andskew.Why
This implements #3147 without materializing geometry rows on the Spark driver. Sedona has no dedicated skew function, while
ST_Affinecan represent the GeoPandas shear matrix and its per-row origin offsets directly.Validation
27 passedin the focused skew suite.60 passedacross the affectedaffine_transform,scale, andskewsuites.Part of #2230.
Closes #3147.
CC @petern48