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

Home » Public Forums » archive » question about variable intersection
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
question about variable intersection [message #87046] Mon, 30 December 2013 15:33 Go to next message
Daniel Otis is currently offline  Daniel Otis
Messages: 5
Registered: January 2012
Junior Member
I have a 255x238 array which represents a geographic study area.

I have also defined five different irregular subsegments of this area using defroi. These subsegments are in the form of longword integer arrays of varying lengths, as the subsegements are of different sizes.

I now also have some point data, in the form of latitude and longitude values, which I convert to x and y values within the 255x238 array.

My question is, how to find if a point location is within one of the irregular subsegments. So, I have an x and y value which I am trying to check against a longword integer array, which obviously will not work.

Somehow, I need to convert the x/y values into a longword integer value to check against the irregular subsegments.

Any ideas are appreciated.

Dan
Re: question about variable intersection [message #87047 is a reply to message #87046] Mon, 30 December 2013 16:01 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
dotis@mail.usf.edu writes:

>
> I have a 255x238 array which represents a geographic study area.
>
> I have also defined five different irregular subsegments of this area using defroi. These subsegments are in the form of longword integer arrays of varying lengths, as the subsegements are of different sizes.
>
> I now also have some point data, in the form of latitude and longitude values, which I convert to x and y values within the 255x238 array.
>
> My question is, how to find if a point location is within one of the irregular subsegments. So, I have an x and y value which I am trying to check against a longword integer array, which obviously will not work.
>
> Somehow, I need to convert the x/y values into a longword integer value to check against the irregular subsegments.
>
> Any ideas are appreciated.

Convert your long integer arrays to X/Y values with Array_Indices. Now
you have X/Y value pairs that describe polygons. Use something like
Inside from the Coyote Library to test if you XY point falls inside each
of the polygons.

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

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: sample/empirical variogram calculation
Next Topic: Clipping shade_surf

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

Current Time: Wed Oct 08 13:56:48 PDT 2025

Total time taken to generate the page: 0.15385 seconds