Skip to content

[GH-3260] GeoPandas: Implement distributed geom_equals_identical - #3262

Merged
jiayuasu merged 1 commit into
apache:masterfrom
jiayuasu:feature/geopandas-geom-equals-identical
Aug 18, 2026
Merged

[GH-3260] GeoPandas: Implement distributed geom_equals_identical#3262
jiayuasu merged 1 commit into
apache:masterfrom
jiayuasu:feature/geopandas-geom-equals-identical

Conversation

@jiayuasu

@jiayuasu jiayuasu commented Aug 14, 2026

Copy link
Copy Markdown
Member

Did you read the Contributor Guide?

Is this PR related to a ticket?

  • Yes, and the PR name follows the format [GH-XXX] my subject.

Closes #3260.
Part of #2230.

What changes were proposed in this PR?

GeoPandas 1.1 added geom_equals_identical for exact structural comparison of
geometry values. Unlike topological equality or tolerance-based
geom_equals_exact, it compares geometry type, nesting, component and vertex
order, coordinate dimensionality, and every represented XY/Z/M ordinate. NaN
ordinates at the same position compare equal.

This PR adds the distributed GeoPandas API layer on top of the native
ST_EqualsIdentical predicate merged in #3266:

  • Implement GeoSeries.geom_equals_identical(other, align=None) and delegate
    GeoDataFrame.geom_equals_identical through the active geometry column.
  • Support scalar Shapely geometries, GeoSeries, GeoDataFrame, and
    pandas-on-Spark Series inputs.
  • Preserve GeoPandas-compatible index alignment, including duplicate and
    MultiIndex values, positional comparison with align=False, result naming,
    non-nullable boolean output, null-to-false behavior, and CRS mismatch
    warnings.
  • Execute comparisons with native Spark expressions; geometry rows and results
    remain distributed, and the plan contains no Python UDF execution.
  • Preserve Z/M/ZM metadata for typed empty scalar values and retain Sedona's
    standalone LinearRing-to-LineString representation.
  • Document the remaining representation boundaries and update the English and
    Chinese GeoPandas tutorials and release notes.

This is the final PR in the #3260 stack and is based directly on master. Its
prerequisites are merged:

The predicate compares the geometry representation it receives. JTS still
cannot distinguish ordinary XY from declared XYZ when every Z ordinate is NaN,
including empty XYZ values and zero-member collections. Direct Shapely inputs
with mixed layouts inside a Polygon or same-type multi-geometry may also be
normalized by Python GeometryUDT serialization before reaching the JVM. These
boundaries are documented in the public method.

How was this patch tested?

  • Built the Spark 4.1.1 / Scala 2.13 shaded artifact with Java 17.
  • GeoPandas 1.1.3 / Shapely 2.1.2 / GEOS 3.13.1 focused identity matrix:
    22 tests passed.
  • GeoPandas 1.0.1 compatibility matrix: 19 tests passed and
    3 upstream-version-dependent tests skipped.
  • Full affected GeoSeries and GeoPandas parity files: 427 tests passed and 1 skipped.
  • Coverage includes scalar and Series inputs, XY/Z/M/ZM distinctions, typed
    empties, NaN ordinates, standalone rings, aligned and positional comparison,
    duplicate and MultiIndex values, CRS warnings, nulls, and serialization
    boundaries.
  • Execution-plan coverage verifies that no Python execution nodes are added.
  • Black, AST parsing, Markdown linting, the documentation build, repository
    hooks, and git diff --check passed.

Did this PR include necessary documentation updates?

  • Yes, I am adding a new API. I am using the current SNAPSHOT version,
    v2.0.0.
  • Yes, I updated the English and Chinese GeoPandas tutorials, public API
    documentation, and release notes.

@jiayuasu
jiayuasu force-pushed the feature/geopandas-geom-equals-identical branch from af364ac to e13b606 Compare August 15, 2026 02:17
@jiayuasu
jiayuasu changed the base branch from master to feature/st-equals-identical August 15, 2026 02:19
@jiayuasu
jiayuasu force-pushed the feature/st-equals-identical branch from 39a0544 to 799bc1e Compare August 16, 2026 05:42
@jiayuasu
jiayuasu force-pushed the feature/geopandas-geom-equals-identical branch from e13b606 to 2f7bf9a Compare August 16, 2026 05:42
@jiayuasu
jiayuasu force-pushed the feature/st-equals-identical branch from 799bc1e to 55bbe1c Compare August 17, 2026 04:58
@jiayuasu
jiayuasu force-pushed the feature/geopandas-geom-equals-identical branch 2 times, most recently from 90552af to ba1ef7d Compare August 17, 2026 06:37
@jiayuasu
jiayuasu force-pushed the feature/geopandas-geom-equals-identical branch from ba1ef7d to c8eeb04 Compare August 18, 2026 06:50
@jiayuasu
jiayuasu changed the base branch from feature/st-equals-identical to master August 18, 2026 06:50
@jiayuasu
jiayuasu marked this pull request as ready for review August 18, 2026 07:12
@jiayuasu jiayuasu added this to the sedona-2.0.0 milestone Aug 18, 2026
@jiayuasu
jiayuasu merged commit 689c454 into apache:master Aug 18, 2026
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 geom_equals_identical

1 participant