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
Polygonizer::getInvalidRingLines returns duplicate lines #947
Comments
I have realized that the documented semantics for the
In other words, this is documented as being consistent with the semantics of the other methods getting invalid input edges (i.e. returning the original input lines, rather than net new linear rings not present in the input). Returning the original input edges makes uniquifying easier, but will change the return values. I'm not sure how critical this is for unit tests and usage. @dbaston any thoughts on which is better? |
I'm having trouble following the comment above, but I would expect the I don't have any particular use for the non-polygon outputs, other than to check that they are absent. I just noticed this behavior when writing a GEOS test and found it surprising. |
It's not possible to do this in general, because the generated polygons which are adjacent will unavoidably contain duplicate linework. Perhaps the closest approach to this is for the linework for the various errors to contain only unique edges. In the case of invalid rings, this could mean that only the linework which does not also appear in other rings (valid or invalid) is included. The downside to this is that it makes it harder to use simple tools to detect exactly where invalidities occur (which are generally where linework has self-intersectios). Returning full closed linear rings makes this easier. But not sure how useful this really is. |
As reported in libgeos/geos#782
After polygonizing the following geometry,
Polygonizer::getInvalidRingLines
returns duplicates of the invalid ring.MULTILINESTRING ((0 0, 1 0, 1 1, 0 1, 0 0), (0 0, 0.5 0.5), (1 1, 2 2, 1 2, 2 1, 1 1))
The text was updated successfully, but these errors were encountered: