Building a mask from a vector file programmatically in ENVI [message #66222] |
Wed, 29 April 2009 03:39  |
alexmtzdeagirre
Messages: 3 Registered: April 2009
|
Junior Member |
|
|
Hello, I am trying to make a Batch file with several Envi
processingtasks, one of the task is to build a mask from a vector file
(in shpformat). From the ENVI menu there is a command to do it
called:“Build Mask”, and also a command called “Apply Mask” for the
latterthere is a correspondent ENVI_MASK_APPLY_DOIT, but for the
formerthere is not. Does anybody know a way around it? Alex
|
|
|
Re: Building a mask from a vector file programmatically in ENVI [message #66350 is a reply to message #66222] |
Thu, 30 April 2009 07:40  |
josea.malpica
Messages: 12 Registered: March 2008
|
Junior Member |
|
|
> Have a look at this thread to get you started:
>
> http://groups.google.com/group/comp.lang.idl-pvwave/browse_f rm/thread...
>
Thank you for your response
We have tried to follow the advice in
http://groups.google.com/group/comp.lang.idl-pvwave/browse_f rm/thread...
And from there we have made the program below.
I do not understand how ENVI_GET_ROI get the pixel coordinates.
When program is run the roi address returned is -1
Do anyone know where the error(s) are?
Thank you very much in advance.
Jose
pro abrirvector, event
envi_select, title='Choose multispectral image',fid=fid
ENVI_FILE_QUERY, fid, dims=dims
roi_id = envi_create_roi (nl=nl, ns=ns)
; Opening my evf file
evf_fname = '11_polygon_.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
for i=0,num_recs-1 do begin
record = envi_evf_read_record(evf_id, i)
envi_define_roi, roi_id, /polygon, xpts = record[0,*], ypts = record
[1,*]
endfor
envi_evf_close, evf_id
roi_addr = envi_get_roi(roi_id)
print, 'ROI: ', roi_addr
end
|
|
|
|