-
Notifications
You must be signed in to change notification settings - Fork 369
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
BUG: Intersects predicate error for two valid polygons #766
Comments
The issue at this stage is not relevant to libgeos itself as you are using a third-party Python wrapper. |
I can confirm this in
|
JTS shows that the first input is invalid, so the error may be in |
The format of the first WKT is invalid, since there's a missing space between two numbers:
If this is fixed, in JTS both polygons test as valid, and the OverlayNG intersection works, with result
|
If I update JTS to the latest commit the polygon shows as valid. Unfortunately I wasn't smart enough to record what commit I was on before updating. |
Looks like it was 26af9f377 (January 2021) ... and the JTS commit that changed this behavior (isValid false -> true) is locationtech/jts@b520430 |
Attached XML test case failing in both GEOS and JTS. If the hole is removed from the larger polygon, the test passes. |
The failure is likely due to the known robustness issue in the spatial predicate algorithm (originally reported as locationtech/jts#396). Because a hole edge is very close to an edge of the polygon, these likely collapse together during noding, and thus create invalid topology during predicate evaluation. As noted in #740, the hope is that an improved spatial predicate algorithm will avoid this situation. Note that a detailed evaluation of the polygon with a hole confirms that it is valid. It might be worth determining what caused the valid algorithm to fail originally, however, and add a unit test for this. |
if i may, i'll add my 2 cents here.
results in
on but now i reverted back to v3.13.0 (from the exact old rpm binaries) - AND THE PROBLEM HAVE DISAPPEARED!
even more interestingly: the downgraded version(yesterday, via what is happening?!? are these errors time-dependant? RNG dependant? was there a solar flare/eclipse/anything yesterday and now it's gone? originally reported here: shapely/shapely#2170 and was advised to escalate/"go deeper"(inception.jpg) |
When I perform the above
intersects
operation,both polygons are valid, but the line ofpoly1.intersects(poly2)
raiseTopologyException
and tell me the input set may be is invalid.I am doing with Shapely 2.0b2 / GEOS 3.5
The text was updated successfully, but these errors were encountered: