Re: Envi: suggest how to save gcps to an ascii file [message #51992] |
Tue, 26 December 2006 02:59 |
linglimu
Messages: 7 Registered: December 2006
|
Junior Member |
|
|
"aberte@gmail.com 写道:
"
> I have to write a widget/function in idl-envi.
> This widget have an "Insert Point" button that collects X,Y coordinates
> and some other information related such digital number (color - integer
> from 0 to 254), a label (string). Then, points collected must be saved
> in ascii file format, in a certain format I know.
>
> How do you suggest to do this? I saw something about .evf file that
> store array data format, is this correct? In such conditions, I'll have
> to write a evf2ascii function.
> Thank you.
Hello Friend, you can use the following code to get the x,y data
pro print_evf_record_info
;
; Open the EVF file can_v1.evf in the
; ENVI_Install_Directory/data/vector
;
evf_fname = 'can_v1.evf'
evf_id = envi_evf_open(evf_fname)
;
; Get the vector information
;
envi_evf_info, evf_id, num_recs=num_recs, $
data_type=data_type, projection=projection, $
layer_name=layer_name
;
; Print information about each record
;
print, 'Number of Records: ',num_recs
for i=0,num_recs-1 do begin
record = envi_evf_read_record(evf_id, i)
print, 'Number of nodes in Record ' + $
strtrim(i+1,2) + ': ', n_elements(record[0,*])
endfor
;
; Close the EVF file
;
envi_evf_close, evf_id
end
|
|
|