-
Notifications
You must be signed in to change notification settings - Fork 448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Two empty geometries should have the same topology #1087
Comments
I think the original idea was that EMPTY geometries contained no points, so could not be equal. But it's debatable whether that makes sense. |
This was changed in GEOS for RelateNG so that empty geometries are equal (regardless of geometry type). |
The motivation for my question (which I should have included originally, sorry!) is that I'm comparing the outputs of some geometry transformations to known "correct" answers. Occasionally the expected answer is an empty geometry.
I'm somewhat emboldened by this change in RelateNG - it's what I expected. |
That's a good use case for this semantic. This actually isn't implemented in JTS yet. Perhaps I should make that change. |
Note, this is a divergence from JTS.Geometry.isEqualTopo, but it seems like the right thing to do. Supportive discussion with Dr. JTS: locationtech/jts#1087 (comment) It also aligns with the new Overlay semantics in GEOS (OverlayNG).
Note, this is a divergence from JTS.Geometry.isEqualTopo, but it seems like the right thing to do. Supportive discussion with Dr. JTS: locationtech/jts#1087 (comment) It also aligns with the new Overlay semantics in GEOS (OverlayNG).
For my own reference, in geos, it looks like we're talking about this code:
|
Correct. |
I changed RelateNG to have the EMPTY-equals semantics (#1089) I also added an XML test |
Thank you for making this change. I wrote a test harness to consume your xml tests here: https://github.com/georust/geo/tree/main/jts-test-runner It was especially useful when I was porting the topology graph stuff for DE-9IM operations. I haven't yet found the time to port your OverlayNG work. I'll pull in the new https://github.com/locationtech/jts/blob/master/modules/tests/src/test/resources/testxml/misc/TestRelateEmpty.xml momentarily. |
The new tests uncovered a couple errors in our own implementation, so thank you for those. All our tests are passing now. |
For example:
Does the current behavior make sense?
The text was updated successfully, but these errors were encountered: