from shapely.geometry import Polygon, Point
p = Point(2,2)
poly = Polygon((0,0), (0,5), (5,0), (5,5))
print poly.contains(p)
This prints False
, although I'm pretty sure (2,2)
is within a square of length 5
. Or maybe I just don't know how the contains method really works. p.within(poly)
also return False
. Am I using the Polygon
class correctly or am I just really bad at geometry?