Discussion:
Reading ENVI evf files
(too old to reply)
frasca
2009-04-13 22:07:37 UTC
Permalink
Hello:

I am trying to run the example from the ENVI Reference Guide, the one
about to print an evf file.

---------------------------------------------------------------------
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

--------------------------------------------------------------------------
but some times it says that the 'can_v1.evf ' is incorrect, and other
times it says that the number of arguments is incorrect.
Does anybody know what could be happening? because I have tried to run
it many times without success.

Thanks in advance.

Jose
David Fanning
2009-04-13 22:21:27 UTC
Permalink
Post by frasca
I am trying to run the example from the ENVI Reference Guide, the one
about to print an evf file.
---------------------------------------------------------------------
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
--------------------------------------------------------------------------
but some times it says that the 'can_v1.evf ' is incorrect, and other
times it says that the number of arguments is incorrect.
Does anybody know what could be happening? because I have tried to run
it many times without success.
This code presumes you are running the program inside the
ENVI vector directory. Are you?

That is to say, the code will only work if your IDL current
directory is ENVI_Install_Directory/data/vector. You can
find out if it is by typing this:

ENVI> cd, current=thisDir & print, thisDir

Cheers,

David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
frasca
2009-04-14 11:05:10 UTC
Permalink
Post by David Fanning
This code presumes you are running the program inside the
ENVI vector directory. Are you?
That is to say, the code will only work if your IDL current
directory is ENVI_Install_Directory/data/vector. You can
   ENVI> cd, current=thisDir & print, thisDir
Cheers,
David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")- Hide quoted text -
- Show quoted text -
Problem solved.

Thank you very much David.

Jose.

Loading...