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

Home » Public Forums » archive » Re: contour and points
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: contour and points [message #76806 is a reply to message #76715] Wed, 29 June 2011 09:36 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 6/29/11 5:43 AM, Andy Heaps wrote:
> A user of mine came to me with a similar problem: how do I find whether
> a point is inside a country outline? Her example was Norway. I suggested
> that she plots the points by number and sees which points are within the
> outline of Norway. As she was just using one set of points and one
> country this is easier to do by eye. If you have multiple countries
> and/or grid points to check this method is too laborious. For the
> generalised case I'd open a Z buffer image plot, plot and fill the
> country and then check whether your point was the filled colour or
> background colour.

A general way of determining if a point is inside a closed path is to
use IDLanROI::containsPoints:

[501]> path_x = [0, 1, 1, 0, 0]
[502]> path_y = [0, 0, 1, 1, 0]
[503]> roi = obj_new('IDLanROI', path_x, path_y)
[504]> print, roi->containsPoints([0.5, 1.5, 1.0], [0.5, 0.5, 0.5])
1 0 2

The result means: 0 = outside, 1 = inside, 2 = on edge.

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL, A Guide to Learning IDL: http://modernidl.idldev.com
Research Mathematician
Tech-X Corporation
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: map_continents and /fill... revisited
Next Topic: Having trouble reading MRDFITS files

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

Current Time: Sat Nov 29 17:02:18 PST 2025

Total time taken to generate the page: 1.68451 seconds