Skip to content

[GH-3388] GeoPandas: implement distributed coordinate transform - #3389

Merged
jiayuasu merged 5 commits into
apache:masterfrom
jiayuasu:codex/geopandas-transform
Sep 23, 2026
Merged

jiayuasu merged 5 commits into
apache:masterfrom
jiayuasu:codex/geopandas-transform

Conversation

@jiayuasu

@jiayuasu jiayuasu commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Did you read the Contributor Guide?

Yes. Read the Contributor Rules and Contributor Development Guide.

Is this PR related to a ticket?

Closes #3388.
Part of #2230.

Uses the empty-member serde fixes merged in #3394. This branch is updated against master after that merge.

What changes were proposed in this PR?

Implement GeoSeries.transform(transformation, include_z=False) and GeoDataFrame active-geometry delegation using the existing vectorized GeoSeries UDF. Execution is lazy and preserves the index, CRS metadata, per-row SRIDs, nulls, and empty geometries, with 2D/3D support.

Callbacks receive NumPy coordinate arrays per executor batch. Results must not depend on batch boundaries or mutable state; whole-series statistics must be computed separately. Requires Spark >=3.5 and Shapely >=2.0 on the driver and workers. Using shapely.transform avoids requiring GeoPandas >=1.0.

Fix shared UDF handling of null inputs for both GeoSeries and scalar Shapely callbacks, and serialize empty/all-null GeoSeries outputs as Arrow binary storage.

How was this patch tested?

After merging master with #3394, 236 tests passed on Spark 4.1.2 / Python 3.11 / Shapely 2.1.2 / GEOS 3.13.1, with the native extension enabled and the JVM jar rebuilt from the merged tree. The selection covers transform, GeoPandas parity, UDFs, native/empty geometry serialization, and the strengthened Python/JVM serde compatibility test.

Transform coverage includes executor execution, partition/batch variation, heterogeneous per-row SRIDs, MultiIndex/CRS, empty members in all three multipart types, null/empty/2D/3D inputs, and deferred callback errors.

Previously verified on Spark 3.5.4 / Python 3.11: the complete UDF module passed (14 tests), and both transform dimension cases passed with Shapely 2.0.0 / GEOS 3.11.1, including a 2D point remaining 2D with include_z=True.

The Spark 4.1 shaded jar was rebuilt from this merged tree with mvn package -pl spark-shaded -am -Dspark=4.1 -Dscala=2.13 -DskipTests -Dmaven.test.skip=true -Dmaven.javadoc.skip=true. The full multi-engine suite was not run locally.

Did this PR include necessary documentation updates?

Yes. Added API documentation and examples with versionadded:: 2.0.0, English/Chinese tutorial guidance on batch semantics and runtime requirements, and a release-note entry. Corrected the stale comment about ST_SetSRID dropping empty collection members.

cc @petern48

@jiayuasu
jiayuasu marked this pull request as draft September 22, 2026 21:03
@jiayuasu jiayuasu added this to the sedona-2.0.0 milestone Sep 23, 2026
@jiayuasu
jiayuasu merged commit 714f35a into apache:master Sep 23, 2026
34 checks passed
@jiayuasu jiayuasu mentioned this pull request Sep 25, 2026
66 of 77 tasks
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 coordinate transform

1 participant