[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Point inside/outside a polygon?



Dennis Boccippio writes:

> Does anyone know of IDL routines for determination of whether a point 
> datum is inside/outside a closed irregular polygon?  I'm told that some 
> variants of this functionality are available in Matlab and Mathematica, 
> was curious if anyone had implemented a solution for IDL.  My usual 
> kludge to this is polyfill/mask-based, which is probably a very 
> inefficient approach...

Here is an article that describes one approach:

   http://www.dfanning.com/tips/point_in_polygon.html 

I am using the INSIDE program described there to 
determine if a contour line is internal or external to
another contour line in a current application 
I am building for a client and it works beautifully.

Cheers,

David

-- 
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155