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
Prepared contains differs from normal contains #519
Comments
We ( |
Well then, I've probably source installed?
…On Wed, Sep 6, 2017 at 9:29 AM, Filipe ***@***.***> wrote:
I'm on linux. I've installed Shapely from conda-forge
We (conda-forge) never packaged '1.6b4' 😕
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#519 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AASszHybaAEmRG3_axcG23VQ3Afem1Avks5sfp5RgaJpZM4POXVR>
.
|
Sorry, 1.5.17post1 In [1]: import shapely
In [2]: shapely.__version__
Out[2]: '1.5.17.post1'
In [3]: from shapely.geometry import Point, Polygon
...: import shapely.prepared
...:
...: point = Point(0.95, 0.05)
...: geom = Polygon([(0, 0), (1, 0), (0, 1), (0, 0)])
...:
...: assert shapely.prepared.prep(geom).contains(point) == geom.contains(point)
...:
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-3-91a2da531b6f> in <module>()
5 geom = Polygon([(0, 0), (1, 0), (0, 1), (0, 0)])
6
----> 7 assert shapely.prepared.prep(geom).contains(point) == geom.contains(point)
AssertionError: |
I can reproduce this. Perhaps this is a bug in GEOS? (I didn't mean to close this...) |
Yes, I'm seeing the same thing when I bypass Shapely and go straight to the GEOS C-api in Cython. |
FYI I just add #519 (comment) as a test to the |
I distribute GEOS 3.4.2 with the shapely wheels that I put on PyPI and can't reproduce the issue with that older version.
|
My error was on 3.5.1
|
I've created a ticket upstream: https://trac.osgeo.org/geos/ticket/841. @mrocklin @snorfalorpagus can you confirm that I reported correctly? |
|
Looks good to me. Thanks for going through the effort of raising upstream @sgillies |
This seems to be a wontfix and I've closed the upstream issue. Strictly speaking, the point is on the boundary of the polygon and thus is not contained. Due to numerical precision issues, it may be computed to not be on the boundary, and that's what I see in my test. Something has changed since 3.4.2, but the results are actually more correct for one of the polygons. I didn't note above whether it was |
This fails. I don't think it should. I could be mistaken though.
I'm on linux. I've installed Shapely from conda-forge.
The text was updated successfully, but these errors were encountered: