X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 08 Mar 2016 02:16 AM by  anon
using ENVITask('ISODATAClassification') on masked data
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
08 Mar 2016 02:16 AM
    Dears, I am trying to perform an ISODATA classification on a masked Landsat image with ENVITask. With the following I mask the image: mask = e.OpenRaster(in_dir + '\' + fn_classification_mask) data = BYTE(mask.GetData()) data[ind_dist_exclude]=0 mask2 = ENVIRaster(data, URI=out_dir + '\' + fn_base + '_mask_ISO_project_' + STRTRIM(project_ids[p],2), INHERITS_FROM=mask) mask2.Save Then I apply the mask to the Landsat image: SubsetWithMask = ENVIMaskRaster(Subset, mask2) Finally I run the isodata classification on it SubsetWithMask = ENVIMaskRaster(Subset, mask2) ;be care here use the appropriate mask to be build with SLC and dist and omit Task = ENVITask('ISODATAClassification') Task.Input_Raster = SubsetWithMask Task.ITERATIONS = 3 Task.NUMBER_OF_CLASSES=5 Task.OUTPUT_RASTER_URI = out_dir + '\' + fn_base + '_ISO_project_' + STRTRIM(project_ids[p],2);+'v2' Task.Execute But the mask is ignored and the classification is performed over the whole image. Help is appreciated! Thanks in advance, Michele

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    16 Mar 2016 09:08 AM
    There is currently not a way to pass the masked raster to the ISODATA task and have the task recognize the masked values. We are looking at a resolution for this in a future version. For now, if you wish to perform an ISODATA classification using a mask, you will need to use the Classic routine - CLASS_DOIT with a mask.
    You are not authorized to post a reply.