X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 22 Jul 2010 12:33 PM by  anon
Problem adding a vector to a new EVF file using ENVI_EVF_DEFINE_ADD_RECORD
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
22 Jul 2010 12:33 PM
    Howdy, community! I'm not sure which board (IDL or ENVI) this post should go in, but I'm going to try IDL first, since I'm using an ENVI function in an IDL program. My problem is basically this: I've opened an EVF file which consists of a contour polygon. This polygon needs to be solidly filled programmatically, and I've done that. Now, I'm ready to put this polygon back into an EVF file and convert it to a shapefile. Problem is, I'm very new to IDL / ENVI / Image Processing. The current method I'm using to do this is: evf_ptr = ENVI_EVF_DEFINE_INIT('TestEVF.evf', $ layer_name='EVF Output Test') if (ptr_valid(evf_ptr) eq 0) then print, 'evf creation failed' ENVI_EVF_DEFINE_ADD_RECORD, evf_ptr, filled_poly my_evf = ENVI_EVF_DEFINE_CLOSE(evf_ptr, /return_id) ENVI_EVF_CLOSE, my_evf This yields an error upon running. Specifically: % Compiled module: FILL_POLYGON. % Attempt to subscript STACK with is out of range. % Execution halted at: EVF_WRITE_RECORD % ENVI_EVF_DEFINE_ADD_RECORD I simply don't know how I would deal with an array subscripting error in this instance, especially with IDL. Any help would be greatly appreciated.

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    27 Jul 2010 08:18 AM
    Did you look at the sample code in the ENVI help for ENVI_EVF_DEFINE_ADD_RECORD? I suspect the issue may be in the way your polygone is defined. You will notice that the polygonis reformed into a 2x13 array in the example. Is your array properly formed for input to the ENVI_EVF routine? the first and last points also need to be identical to close the polygon. Is yours defined this way?

    Deleted User



    New Member


    Posts:
    New Member


    --
    04 Aug 2010 03:39 PM
    It may also be that your polygon has too many points. I seem to recall (if I remember correclty) that having more than 32767 points was a problem. How did you "fill" this polygon? r moss
    You are not authorized to post a reply.