-
Notifications
You must be signed in to change notification settings - Fork 744
Description
As discovered in this PR, it seems like check_sgpd_equals_gpd() passes when comparing geoms that only differ by Z-dimension. We need to modify the test code to test for Z and M dimensions. We'll then want to write a negative test that shows that check_sgpd_equals_gpd() fails when we expect it too. e.g comparing Point(1, 1, 3) and Point(1, 1, 4) should fail.
The code for the function is here. But the bug is probably in this call
cls.assert_geometry_almost_equal(a, e, tolerance)
The code for assert_geometry_almost_equal is here in test_base.py. This means this affects our general Python test suite as well...
Looking at that code, I would start w/ checking if equals_exact() is behaving properly. That's a shapely method. I expect it would properly return False. In that case, then the buffer + contains logic would be the part that's failing to catch the Z and M dimensions.
sedona/python/tests/test_base.py
Lines 132 to 140 in 3d1ebde
| if not actual_geom.equals_exact(expected_geom, tolerance=tolerance): | |
| # If the exact equals check fails, perform a buffer check with tolerance | |
| if ( | |
| actual_geom.is_valid | |
| and actual_geom.buffer(tolerance).contains(expected_geom) | |
| and expected_geom.is_valid | |
| and expected_geom.buffer(tolerance).contains(actual_geom) | |
| ): | |
| return |