[SciPy-user] efficient "inside polygon" test for an array??
Mon Feb 4 12:44:44 CST 2008
On 4-Feb-08, at 11:15 AM, John Hunter wrote:
> On Feb 4, 2008 9:56 AM, Eric Emsellem <firstname.lastname@example.org>
>> I have a polygon (defined by 4 vertices) and I wish to have an
>> efficient way of
>> selecting the points which are inside this polygon.
>> So I would like something like:
>> selection = pointsInPolygon(x,y,poly)
It seems your problem has already been addressed, but some very good
discussion of this problem (along with some 30-odd year old code, and
a more recent C implementation) can be found at
I wouldn't be surprised if nxutils uses the same algorithm.
More information about the SciPy-user