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

Home » Public Forums » archive » Re: how to get pixel data corresponding to some coordinates' points?
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
Re: how to get pixel data corresponding to some coordinates' points? [message #56208] Mon, 15 October 2007 07:48
fanxing_gis is currently offline  fanxing_gis
Messages: 8
Registered: August 2007
Junior Member
there is an another way to resolve it, overlay your shape file on
image in ENVI,then convert the active layer (your shape file) to
pointed ROI and then export the ROI to ASCII, here,the pixel row and
column numbers corresponding to the shape point could be found in the
ASCii file.

regards

fanxing
Re: how to get pixel data corresponding to some coordinates' points? [message #56214 is a reply to message #56208] Mon, 15 October 2007 00:04 Go to previous message
d.poreh is currently offline  d.poreh
Messages: 406
Registered: October 2007
Senior Member
On Oct 14, 3:22 am, "Jean H." <jghas...@DELTHIS.ucalgary.ANDTHIS.ca>
wrote:
> highstone wrote:
>> On Oct 14, 1:21 am, "Jean H." <jghas...@DELTHIS.ucalgary.ANDTHIS.ca>
>> wrote:
>>> highstone wrote:
>>>> I have a point vector file(.shp) containing a lot of weather
>>>> stations, how can I get corresponding pixel data from a '.img' file
>>>> with least works? 3q!
>>> if you have envi too, you can use envi_convert_file_coordinates
>
>>> Jean
>> to Jean,
>> I look up the help of ENVI, find the role of
>> "envi_convert_file_coordinates" is to "Use this procedure to convert
>> x,y pixel coordinates to their corresponding map coordinates".
>
> "and vice-versa"
> By pixel coordinate, they mean the row and column number, by map
> coordinate, they mean the geographical coordinate (lat-long or else)
>
> Maybe I
>
>> didn't have said clearly. My vector file and raster file had the same
>> coordinates, what I want to get is the pixels' data corresponding to
>> these points in vector file as soon as possible.so I don't know why to
>> use this procedure?
>> please forgive me for my poor knowledge,3q.
>
> Yes, the idea is, if you want to program it (maybe there is a built-in
> tool... I don't know... ArcGis has one for sure):
> 1)open your shape file
> 2)get the coordinates (let's say, lat-long) of each point in an array
> 3)open your image to gets its FID
> 4)call envi_convert_file_coordinates, fid, X,Y, lat,long (with NO
> keyword), which will change your lat-long to the corresponding pixel row
> and column on your image
> 5)extract the pixels values, using image[X,Y]
>
> the help file for envi's function is terrible and often needs a few
> dozen reading before to get the code working well!
>
> Jean

Hi;
There is an easy way to do this. But Jean's way is robust. Just read
your data in ENVI and follow this direction: file->save image as-
> image file. In the opened window go to *spatial subset*and choose
*map* you can easily subset your data based on lat-long or pixel base.
It is so easy.
ciao
Re: how to get pixel data corresponding to some coordinates' points? [message #56222 is a reply to message #56214] Sat, 13 October 2007 18:22 Go to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
highstone wrote:
> On Oct 14, 1:21 am, "Jean H." <jghas...@DELTHIS.ucalgary.ANDTHIS.ca>
> wrote:
>> highstone wrote:
>>> I have a point vector file(.shp) containing a lot of weather
>>> stations, how can I get corresponding pixel data from a '.img' file
>>> with least works? 3q!
>> if you have envi too, you can use envi_convert_file_coordinates
>>
>> Jean
> to Jean,
> I look up the help of ENVI, find the role of
> "envi_convert_file_coordinates" is to "Use this procedure to convert
> x,y pixel coordinates to their corresponding map coordinates".

"and vice-versa"
By pixel coordinate, they mean the row and column number, by map
coordinate, they mean the geographical coordinate (lat-long or else)

Maybe I
> didn't have said clearly. My vector file and raster file had the same
> coordinates, what I want to get is the pixels' data corresponding to
> these points in vector file as soon as possible.so I don't know why to
> use this procedure?
> please forgive me for my poor knowledge,3q.

Yes, the idea is, if you want to program it (maybe there is a built-in
tool... I don't know... ArcGis has one for sure):
1)open your shape file
2)get the coordinates (let's say, lat-long) of each point in an array
3)open your image to gets its FID
4)call envi_convert_file_coordinates, fid, X,Y, lat,long (with NO
keyword), which will change your lat-long to the corresponding pixel row
and column on your image
5)extract the pixels values, using image[X,Y]

the help file for envi's function is terrible and often needs a few
dozen reading before to get the code working well!

Jean
Re: how to get pixel data corresponding to some coordinates' points? [message #56223 is a reply to message #56222] Sat, 13 October 2007 18:03 Go to previous message
highstone is currently offline  highstone
Messages: 10
Registered: August 2007
Junior Member
On Oct 14, 1:21 am, "Jean H." <jghas...@DELTHIS.ucalgary.ANDTHIS.ca>
wrote:
> highstone wrote:
>> I have a point vector file(.shp) containing a lot of weather
>> stations, how can I get corresponding pixel data from a '.img' file
>> with least works? 3q!
>
> if you have envi too, you can use envi_convert_file_coordinates
>
> Jean
to Jean,
I look up the help of ENVI, find the role of
"envi_convert_file_coordinates" is to "Use this procedure to convert
x,y pixel coordinates to their corresponding map coordinates". Maybe I
didn't have said clearly. My vector file and raster file had the same
coordinates, what I want to get is the pixels' data corresponding to
these points in vector file as soon as possible.so I don't know why to
use this procedure?
please forgive me for my poor knowledge,3q.
Re: how to get pixel data corresponding to some coordinates' points? [message #56225 is a reply to message #56223] Sat, 13 October 2007 10:21 Go to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
highstone wrote:
> I have a point vector file(.shp) containing a lot of weather
> stations, how can I get corresponding pixel data from a '.img' file
> with least works? 3q!
>

if you have envi too, you can use envi_convert_file_coordinates

Jean
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Neural Networks In IDL?
Next Topic: multiple line plots in colors & legend

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

Current Time: Thu Oct 09 12:17:29 PDT 2025

Total time taken to generate the page: 0.32410 seconds