Re: an envi question- extracting the pixel values of seveal points with lat-lon values [message #51027 is a reply to message #51026] |
Tue, 31 October 2006 12:15   |
Jeff N.
Messages: 120 Registered: April 2005
|
Senior Member |
|
|
Ed Hyer wrote:
> Jeff,
>
> This problem should be ridiculously easy to solve in ENVI, but when I
> had to solve it, I had to do it the hard way. At bottom, the text of
> ENVI_POINT_PRO.PRO, which is a mini-library of routines for solving
> your point extraction problem.
>
Holy cow!! That's a lot of code! This works for me, if i understand the
original poster's problem correctly:
pro junk
;open bhtmref.img that comes with ENVI.
fname = 'C:\Program Files\RSI\IDL62\products\ENVI42\data\bhtmref.img'
envi_open_file, fname, r_fid = fid
;use pixel locator to find map coords for pixel
;at file coords 242,195 (picked at random).
;They are:
e = 282015.00
n = 4901085.00
envi_convert_file_coordinates, fid, xf, yf, e, n
print, xf+1, yf+1 ;should print 242, 195
end
Here's the output:
Compiled module: JUNK.
ENVI> junk
242.00000 195.00000
Seems about right to me :)
Jeff
|
|
|