Skip to content

[GH-2385][GH-3168][GH-3169] GeoPandas: Implement GeoSeries is_ccw, interiors, and orient_polygons - #3170

Merged
jiayuasu merged 5 commits into
apache:masterfrom
jiayuasu:feature/geopandas-ring-methods
Jul 26, 2026
Merged

[GH-2385][GH-3168][GH-3169] GeoPandas: Implement GeoSeries is_ccw, interiors, and orient_polygons#3170
jiayuasu merged 5 commits into
apache:masterfrom
jiayuasu:feature/geopandas-ring-methods

Conversation

@jiayuasu

@jiayuasu jiayuasu commented Jul 25, 2026

Copy link
Copy Markdown
Member

Did you read the Contributor Guide?

Is this PR related to a ticket?

What changes were proposed in this PR?

This PR adds distributed GeoSeries support for is_ccw, interiors, and orient_polygons.

  • is_ccw uses JTS ring-orientation semantics on the original coordinate sequence, including GeoPandas-compatible behavior for open lines.
  • interiors returns an object Series containing interior-ring lists while preserving MultiIndex metadata.
  • orient_polygons recursively orients polygonal members of nested geometry collections and preserves empty geometries, SRID, user data, and nulls.
  • Boolean, scalar, and array expressions retain their actual Spark schema, nullable predicate results match GeoPandas semantics, and geom_type strips its prefix with a native Spark expression. In particular, crosses now normalizes the null returned by ST_Crosses for GeometryCollections to False, matching GeoPandas instead of exposing None.

The implementations use native engine expressions without driver collection or Python UDFs. ST_IsLineStringCCW is 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)
  • Spark SQL and DataFrame Scala suites (493 tests passed)
  • mvn -pl spark-shaded -am -DskipTests package
  • Focused Flink function tests
  • Snowflake formatting, compilation, packaging, generated DDL, and binary/geometry/geography fixtures
  • Focused Spark DataFrame, direct GeoSeries, and GeoPandas-parity tests using the branch-built shaded JAR
  • Repository pre-commit hooks on all changed files

Did this PR include necessary documentation updates?

  • Yes. This adds ST_IsLineStringCCW documentation for Spark, Flink, and Snowflake, updates the polygon-orientation documentation to describe recursive GeometryCollection handling, and corrects the ST_IsPolygonCW summary descriptions. I am using the current SNAPSHOT version number in v1.9.1 format.

@jiayuasu jiayuasu changed the title [GH-2385][GH-3168][GH-3169] Add distributed GeoSeries ring methods GeoPandas: Implement GeoSeries is_ccw, interiors, and orient_polygons Jul 25, 2026
@jiayuasu jiayuasu changed the title GeoPandas: Implement GeoSeries is_ccw, interiors, and orient_polygons [GH-2385][GH-3168][GH-3169] GeoPandas: Implement GeoSeries is_ccw, interiors, and orient_polygons Jul 25, 2026
@jiayuasu
jiayuasu marked this pull request as ready for review July 26, 2026 01:58
@jiayuasu
jiayuasu merged commit 039214e into apache:master Jul 26, 2026
44 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 orient_polygons GeoPandas: implement distributed interiors Geopandas: Implement is_ccw

1 participant