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

Home » Public Forums » archive » Re: Retrieve pixel values from GeoTIFF
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: Retrieve pixel values from GeoTIFF [message #73785 is a reply to message #73784] Sat, 27 November 2010 12:59 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

>
> mankoff writes:
>
>> David: I've also tried using your GeoCoord object, and can display the
>> graphic and coastlines just fine, but again, am stuck at the step of
>> "convert (lon,lat)=(-100,-75) to (x,y) for indexing into the original
>> TIF".
>
> mapCoord = GeoCoord('mygeotiff_file.tif')
> mapStruct = mapCoord -> GetMapStructure()
> xy = Map_Proj_Forward(lon,lat, Map_Structure=mapStruct)
> x = xy[0]
> y = xy[1]

Oh, wait! You said you want to index into the original
image. (My son is bugging me about bying a car today,
so I'm distracted. :-)

In addition to the above, I would do this.

mapCoord -> GetProperty, XRANGE=xr, YRANGE=xy
s = Size(image, /Dimensions)
xvec = Scale_Vector(Findgen(s[0]), xr[0, xr[1])
xindex = Value_Locate(xvec, x)
yvec = Scale_Vector(Findgen(s[1]), yr[0], yr[1])
yindex = Value_Locate(yvec, y)

Then,

Print, image[xindex, yindex]

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Retrieve pixel values from GeoTIFF
Next Topic: IDL syntax coloring in BBEdit

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

Current Time: Sat Oct 11 07:53:30 PDT 2025

Total time taken to generate the page: 1.35766 seconds