comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: point inside polygon
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: point inside polygon [message #11505 is a reply to message #11494] Wed, 01 April 1998 00:00 Go to previous messageGo to previous message
Alex Schuster is currently offline  Alex Schuster
Messages: 124
Registered: February 1997
Senior Member
William Connolley wrote:

> In article C0684CDB@oma.be, Philippe Peeters <philp@oma.be> writes:
>> Does anybody knows of an IDL function to test whether a given point is
>> inside a polygon?
>
> I needed to solve this recently (in a mapping context). The solution I came up
> with works but its not elegant: use poly_fill to actually draw your polygon
> (in a pixmap not the screen window if you prefer), then read off the pixel value
> of your point to see if its in or out.
>
> This is grotesquely inelegant, but its very simple and it works. I can
> post the code if you're interested. A better solution
> would be to look at polyfill and see how it does the fill... but sadly
> polyfill seems to be one of the few routines not written in IDL.

POLYFILLV works similar, but does not need a pixmap. It just returns the
subscripts of all points inside the polygon.
This worked okay for me, but for floating point coordinates it might not
be too accurate.

Alex
--
Alex Schuster Wonko@weird.cologne.de PGP Key available
alex@pet.mpin-koeln.mpg.de
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Volume Size
Next Topic: Re: Three questions

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:03:43 PDT 2025

Total time taken to generate the page: 0.00209 seconds