petern48 commented on code in PR #2517:
URL: https://github.com/apache/sedona/pull/2517#discussion_r2553531386


##########
python/tests/test_base.py:
##########
@@ -122,14 +125,31 @@ def assert_geometry_almost_equal(
         right_geom: Union[str, BaseGeometry],
         tolerance=1e-6,
     ):
+        """
+        Assert that two geometries are almost equal.
+
+        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.

Review Comment:
   Reasons for this:
   
   - Z and M support isn't introduced until [Shapely 
2.1.0](https://shapely.readthedocs.io/en/2.1.0/release/2.x.html#version-2-1-0-2025-04-03)
   
   `equals_exact` only compares X and Y dimensions and not Z/M (as mentioned 
[here](https://shapely.readthedocs.io/en/2.1.0/reference/shapely.equals_identical.html)
 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.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to