Repository navigation
[GH-3388] GeoPandas: implement distributed coordinate transform - #3389
Merged
Merged
Conversation
jiayuasu
marked this pull request as draft
September 22, 2026 21:03
jiayuasu
marked this pull request as ready for review
September 23, 2026 07:02
This was referenced Sep 23, 2026
66 of 77 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.
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.transformavoids 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 aboutST_SetSRIDdropping empty collection members.cc @petern48