-
Notifications
You must be signed in to change notification settings - Fork 365
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
MultiLineString.contains produces incorrect result #933
Comments
Looks pretty suspect. The 0-dimensional interior interaction at (0.1 0.1) seems to be the culprit... because it's a multilinestring it can have different kinds of interactions (it has both 0-d and 1-d interior interactions), I wonder if the implication is that there is such a thing as an invalid multilinestring. The relate matrix is
It's definitely finding a 0-d interior/interior interaction, and contains would expect a 1-d interaction. @dr-jts ? |
This is failing because the contains IM pattern of This is clearly wrong. I suspect a robustness issue due to the noding carried out by the relate algorithm. There's a similar issue here: locationtech/jts#396 I'l dig a bit more and confirm if this is what's happening. In any case, I agree that this is a bug, and in fact |
It's also interesting to note that this works:
The reason is probably that 0.25 can be converted to an exact binary fraction, so does not cause robustness errors when the intersection is computed. |
As I suspected, this error is due to a non-robust computation of the intersection point between One piece of good news is that the Note: this change will likely have some very small impacts on overlay test case results, based on JTS testing. |
I confirmed that in GEOS using But it does cause a few failures in other unit tests, probably due to the slight difference for some cases. |
performance impact, and more stable output. References GH-933.
I'm working on rapidsai/cuspatial#1063, which are GPU-accelerated multi-geometry binary predicate operations. I discovered a test case that fails in comparison with GeoPandas/Shapely/GEOS results that I thought might interest you:
Expected result is that
m.contains(b1) == True
. I'm very interested to learn if I'm doing something wrong or if there's a bug here that has since gone unnoticed. I'll be keeping an eye over here! Thanks!The text was updated successfully, but these errors were encountered: