[Numpy-discussion] a good polygon class?

Stéfan van der Walt stefan@sun.ac...
Tue Aug 19 11:49:27 CDT 2008


Hi Mark

2008/8/19 mark <markbak@gmail.com>:
> Hello List -
>
> I am looking for a good polygon class.
>
> My main interest it to be able to figure out if a point is inside or
> outside the polygon, which can have any shape (well, as long as it is
> a polygon).
>
> Any suggestions?

I have optimised Point-in-Polygon code here:

http://mentat.za.net/source/pnpoly.tar.bz2

There are three versions: pure Python, ctypes and weave.

A complete library (a NumPy port of Jorg Raedler's polygon lib) is
available as part of my super-resolution library at

http://mentat.za.net/supreme

or more specifically

http://bazaar.launchpad.net/~stefanv/supreme/main/files/180?file_id=Polygon1.16-20060502184912-b1a90b5a4870e7ba

Regards
Stéfan


More information about the Numpy-discussion mailing list