Prepared contains differs from normal contains
See original GitHub issueThis fails. I don’t think it should. I could be mistaken though.
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)
>>> shapely.__version__
'1.6b4'
I’m on linux. I’ve installed Shapely from conda-forge.
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
What Is a Cell? | Learn Science at Scitable - Nature
A eukaryotic cell (left) has membrane-enclosed DNA, which forms a structure called the nucleus (located at center of the eukaryotic cell; note the...
Read more >Food Processing and Health | The Nutrition Source
Processed foods are generally thought to be inferior to unprocessed foods. They may bring to mind a packaged food item containing many ingredients, ......
Read more >The Lipid Bilayer - Molecular Biology of the Cell - NCBI - NIH
The tails are usually fatty acids, and they can differ in length (they normally contain between 14 and 24 carbon atoms). One tail...
Read more >Labeling Organic Products | Agricultural Marketing Service
What do the four different organic labels mean? · “100 Percent Organic” PDP: May include USDA organic seal and/or 100 percent organic claim...
Read more >Definition of cell - NCI Dictionary of Cancer Terms
The cytoplasm is where most chemical reactions take place and where most proteins are made. The human body has more than 30 trillion...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
prep(geom).contains(point)
orgeom.contains(point)
that wasFalse
with GEOS 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?