Excellent, thanks!  Just reinforces my belief that in Python, if you need to do 
something, chances are the Python tool for it already exists in the Public 
Domain!  I love Python!

DG

--- On Thu, 6/26/08, David Warde-Farley <[EMAIL PROTECTED]> wrote:

> From: David Warde-Farley <[EMAIL PROTECTED]>
> Subject: Re: [Matplotlib-users] matplotlib have "point in a polygon" test?
> To: [EMAIL PROTECTED]
> Cc: matplotlib-users@lists.sourceforge.net
> Date: Thursday, June 26, 2008, 8:46 PM
> On 26-Jun-08, at 11:37 PM, David Goldsmith wrote:
> 
> > Hi!  Does matplotlib have already implemented a method
> to return  
> > true/false according as a provided point is inside a
> provided  
> > polygon?  Thanks!
> 
> In [15]: help matplotlib.nxutils
> -------> help(matplotlib.nxutils)
> Help on module matplotlib.nxutils in matplotlib:
> 
> NAME
>      matplotlib.nxutils - general purpose utilities
> (numpy).
> 
> FILE
>     
> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
> 
> site-package
> s/matplotlib/nxutils.so
> 
> FUNCTIONS
>      pnpoly(...)
>          inside = pnpoly(x, y, xyverts)
>          return 1 if x,y is inside the polygon defined by
> the sequence  
> of x,y ver
> tices in xyverts
> 
>      points_inside_poly(...)
>          mask = points_inside_poly(xypoints, xyverts)
>          return a mask of length xypoints indicating
> whether each x,y  
> point is in
> side the polygon defined by the sequence of x,y vertices in
> xyverts
> 
> If you're interested in the algorithm:
>       
> http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
> 
> 
> Regards,
> 
> David


      

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to