question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prepared contains differs from normal contains

See original GitHub issue

This 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:closed
  • Created 6 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
sgilliescommented, Sep 6, 2017

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) or geom.contains(point) that was False with GEOS 3.5.1.

1reaction
sgilliescommented, Sep 6, 2017

I’ve created a ticket upstream: https://trac.osgeo.org/geos/ticket/841. @mrocklin @snorfalorpagus can you confirm that I reported correctly?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found