X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 12 Jan 2017 08:39 AM by  anon
How delete a specific record from an ESRI Shapefile in IDL
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
12 Jan 2017 08:39 AM
    Hello, i need to delete a specific feature from a shapefile using IDL but i do not find any usefull tool or function. That is my simplified code: myshape = OBJ_NEW('IDLffShape', file); Get the number of entities so we can parse through them myshape->GetProperty, N_ENTITIES=num_ent; Parsing through the entities FOR x=0, (num_ent-1) DO begin ; Get the Attributes for entity x attr = myshape->GetAttributes(x) IF attr.ATTRIBUTE_0 EQ 'Roi_Test_v2 [RECORD=2]' THEN BEGIN IF (Stats.Mean LT 7000) THEN myshape->DestroyEntity, ent OBJ_DESTROY, shape ENDIF ENDFOR The myshape->DestroyEntity does not work. I obtains the following message: Only one class has training samples within the valid image area. Thay you for any feedback.

    Deleted User



    Basic Member


    Posts:143
    Basic Member


    --
    12 Jan 2017 01:25 PM
    What are yo udoing int he code that says, "". I am not sure that this error is occurring when you call "myshape->DestroyEntity, ent". I think this error typically occurs when running a classification using ENVI. I wonder if that might be the cause of your issue?
    You are not authorized to post a reply.