Skip to content

[GH-3147] Implement distributed GeoPandas skew - #3148

Merged
jiayuasu merged 2 commits into
apache:masterfrom
jiayuasu:feature/geopandas-skew
Jul 23, 2026
Merged

[GH-3147] Implement distributed GeoPandas skew#3148
jiayuasu merged 2 commits into
apache:masterfrom
jiayuasu:feature/geopandas-skew

Conversation

@jiayuasu

Copy link
Copy Markdown
Member

What changed

  • Add GeoSeries.skew and active-geometry delegation from GeoDataFrame.
  • Express x/y shearing as a distributed ST_Affine operation with per-row center or centroid origins.
  • Support degree and radian angles, 2D/3D tuple and Shapely Point origins, exact near-zero tangent handling, and unchanged Z coordinates.
  • Share operation-wide numeric scalar validation across affine_transform, scale, and skew.
  • Add direct regression tests and GeoPandas parity coverage across 2D and 3D geometry families.

Why

This implements #3147 without materializing geometry rows on the Spark driver. Sedona has no dedicated skew function, while ST_Affine can represent the GeoPandas shear matrix and its per-row origin offsets directly.

Validation

  • 27 passed in the focused skew suite.
  • 60 passed across the affected affine_transform, scale, and skew suites.
  • Repository checks pass for all four changed Python files.

Part of #2230.
Closes #3147.

CC @petern48

@jiayuasu jiayuasu added this to the sedona-1.9.1 milestone Jul 22, 2026
@jiayuasu
jiayuasu marked this pull request as ready for review July 22, 2026 21:11
@jiayuasu
jiayuasu requested a review from Copilot July 22, 2026 23:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 distributed ST_Affine operation.
  • Refactored affine-family scalar normalization into a shared helper and reused it in affine_transform and scale.
  • 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.

@jiayuasu
jiayuasu merged commit 31f9d53 into apache:master Jul 23, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GeoPandas: implement distributed skew

2 participants