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

Home » Public Forums » archive » Building a mask from a vector file programmatically in ENVI‏
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
Building a mask from a vector file programmatically in ENVI‏ [message #66222] Wed, 29 April 2009 03:39 Go to next message
alexmtzdeagirre is currently offline  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 Go to previous message
josea.malpica is currently offline  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
Re: Building a mask from a vector file programmatically in ENVI‏‏ [message #66364 is a reply to message #66222] Wed, 29 April 2009 16:04 Go to previous message
jeffnettles4870 is currently offline  jeffnettles4870
Messages: 111
Registered: October 2006
Senior Member
On Apr 29, 11:36 am, frasca <josea.malp...@gmail.com> wrote:
> Hello,
> We are trying to make a Batch file with several Envi processing tasks,
> one of the task is to build a mask from a vector file (in shp format).
> From the ENVI menu there is a command to do it called: “Build Mask”,
> and also a command called “Apply Mask” for the latter there is a
> correspondent ENVI_MASK_APPLY_DOIT, but for the former there is not.
> Does anybody know how to do it?
>
> Jose

Jose,

As far as I know you will need to build your own routine for this.
Have a look at this thread to get you started:

http://groups.google.com/group/comp.lang.idl-pvwave/browse_f rm/thread/4b90c8f4a2c7b715/782d5e7153c7fda8?lnk=gst&q=Ap ply+shapefile#782d5e7153c7fda8

This thread mostly deals with building masks from EVF files (that were
created by converting shapefiles) but you could modify the process to
work with an IDLffShape object.

Good luck,
Jeff
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: How do i write an "application progress" widget ?
Next Topic: any GUI crashed IDL....

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

Current Time: Sat Oct 11 06:04:36 PDT 2025

Total time taken to generate the page: 0.67085 seconds