[GH-2385][GH-3168][GH-3169] GeoPandas: Implement GeoSeries is_ccw, interiors, and orient_polygons - #3170
Merged
Conversation
jiayuasu
marked this pull request as ready for review
July 26, 2026 01:58
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?
Is this PR related to a ticket?
[GH-XXX] my subject. Closes Geopandas: Implementis_ccw#2385. Closes GeoPandas: implement distributed interiors #3168. Closes GeoPandas: implement distributed orient_polygons #3169.What changes were proposed in this PR?
This PR adds distributed GeoSeries support for
is_ccw,interiors, andorient_polygons.is_ccwuses JTS ring-orientation semantics on the original coordinate sequence, including GeoPandas-compatible behavior for open lines.interiorsreturns an object Series containing interior-ring lists while preserving MultiIndex metadata.orient_polygonsrecursively orients polygonal members of nested geometry collections and preserves empty geometries, SRID, user data, and nulls.geom_typestrips its prefix with a native Spark expression. In particular,crossesnow normalizes the null returned byST_Crossesfor GeometryCollections toFalse, matching GeoPandas instead of exposingNone.The implementations use native engine expressions without driver collection or Python UDFs.
ST_IsLineStringCCWis exposed and documented for Spark SQL, the Spark DataFrame API, Spark Connect, Flink, and Snowflake binary, geometry, and geography values.This is part of #2230.
How was this patch tested?
mvn -pl common -Dtest=FunctionsTest test(326 tests passed)mvn -pl spark-shaded -am -DskipTests packageDid this PR include necessary documentation updates?
ST_IsLineStringCCWdocumentation for Spark, Flink, and Snowflake, updates the polygon-orientation documentation to describe recursive GeometryCollection handling, and corrects theST_IsPolygonCWsummary descriptions. I am using the current SNAPSHOT version number inv1.9.1format.