1

I am new with ENVI IDL,I want to get pixel value of each band in an image in specified lat and long location.I can do a loop among bands in image using this code

ENVI_OPEN_FILE,'E:\MASTER\Payan_Name\DataSer\Output\162\0730\1-1Georefrence_BIP\Subset_BIP.hdr', R_FID=FID, NO_REALIZE=1
ENVI_FILE_QUERY, FID, ns=ns, nl=nl, nb=nb, data_type=data_type, descrip=descrip, bnames=bnames, sensor_type=sensor_type, wavelength_units=wavelength_units, dims=dims

for b=0,nb-1,1 do begin
  indata = ENVI_GET_DATA(FID=fid,POS=b,DIMS=dims)
endfor

But I don't know how to get pixel value at lat and long,I searched and found a library which name is Rdpix is used to get pixel value at mouse location but I want it at specified lat and long location, Can Some one please help me find the solution or give me some clues to solve my problem?

1 Answer 1

2

If you have the license, ENVI_CONVERT_FILE_COORDINATES is the right function to solve your issue. You can reference this website.

2
  • thank you for your help.This gunction converts Xy to map cordinates..How can I get the pixel value? Commented Nov 16, 2014 at 14:27
  • first, get the x and y, and then indata[x,y] is the pixel value.
    – JZH
    Commented Nov 17, 2014 at 8:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.