[Community] Intersects problem

Mario Ceresa mario.ceresa at torrescalla.it
Thu May 7 19:01:23 EEST 2009


Hello everybody,
I'm sorry to ask a very stupid question, but I don't undestand well
how intersects and contains work:

>> test = LinearRing([(1,1),(2,3),(4,2),(3,0)])
>> points = [Point(2,2),Point(1,0.5),Point(1.5,0.5)]
>> map(test.intersects,points)
returned [True, True, True] and I was expecting [True,False,False]
>> map(test.contains,points)
returned [False, False, False] and I was expected [True,False,False]

It may be that I'm thinking at the wrong geometry but why (1;0.5) and
(1.5;0.5) are considered intersected with the polygon if they are
outside? Is the intersection done with the bounding box of the
objects?

Is there any way to retrieve the points contained within the polygon?

I'm using Shapely-1.0.12-py2.5 and geos 3.1 on a x86_64 Fedora 9

Thanks and regards,

Mario



More information about the Community mailing list