question about variable intersection [message #87046] |
Mon, 30 December 2013 15:33  |
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  |
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.")
|
|
|