Skip to content

Conversation

@petern48
Copy link
Collaborator

Did you read the Contributor Guide?

Is this PR related to a ticket?

What changes were proposed in this PR?

Make 'assert_geometry_almost_equal' check for Z and M dimensions too for shapely >= 2.1.0

How was this patch tested?

Added test

Did this PR include necessary documentation updates?

  • No, this PR does not affect any public API so no need to change the documentation.

Comment on lines +131 to +133
Note: this function will only check Z and M dimensions for shapely >= 2.1.0 (python >= 3.10)
When comparing geometries with Z or M dimensions, this function will ignore `tolerance` and check for exact equality.
Copy link
Collaborator Author

@petern48 petern48 Nov 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reasons for this:

  • Z and M support isn't introduced until Shapely 2.1.0

    • equals_exact only compares X and Y dimensions and not Z/M (as mentioned here in the equals_identical docs, but not the equals_exact docs...)
  • We now use equals_identical to check Z/M, but it doesn't support a tolerance parameter. I think this is fine, given the rare need for tolerance.

@petern48 petern48 marked this pull request as ready for review November 23, 2025 01:25
@petern48 petern48 requested a review from jiayuasu as a code owner November 23, 2025 01:25
Copy link
Member

@jiayuasu jiayuasu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@jiayuasu jiayuasu added this to the sedona-1.8.1 milestone Nov 23, 2025
@jiayuasu jiayuasu merged commit ddd0e32 into apache:master Nov 23, 2025
31 checks passed
@petern48 petern48 deleted the assert_geometry_almost_equal_zm branch November 23, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(geopandas): Make check_sgpd_equals_gpd() test for Z and M dimensions too

2 participants