This document is archived and information here might be outdated. Recommended version. |
Provides access to members that control a remap filter.
Name | Description | |
---|---|---|
AddClass | Adds a remap class that remaps values in [minvalue,maxvalue) to a give new value. | |
AddNoDataClass | Adds a remap class that remaps values in [minvalue,maxvalue) to NoData. | |
AllowUnmatched | Indicates if unmatched values should be passed through. | |
ClassCount | The number of remapped classes. | |
Empty | Removes all classes. | |
PutClass | Puts a remap class at a given class index (starting from 0). | |
QueryClass | Queries a remap class at a given class index (starting from 0). |
CoClasses and Classes | Description |
---|---|
RemapFilter | A class for remap filter. |
Provides access to the members of IRemapFilter. Similar to the reclass concept, this filters group raster pixel values into classes and creates a raster with those classes. Another benefit of this filter is that you can specify a range of values to be nodata and add it to nodataclass.
Sub remap(pRaster As iRaster, pOutWs As IWorkspace)
Dim pFilter As IRemapFilter
Set pFilter=New RemapFilter
'add classes
pFilter.AddClass 5, 20, 0
pFilter.AddClass 20, 50, 1
pFilter.AddClass 50, 100, 2
pFilter.AddClass 100, 120, 3
pFilter.AddClass 120, 150, 4
pFilter.AddClass 150, 256, 5
'add nodatdclass, all values between 0 and 5 (>= 0 and <5) will turn to nodata in the output
pFilter.AddNoDataClass 0, 5
Dim pSaveAs As ISaveAs
Set pSaveAs=pRaster
'set filter
Dim pFilterOp As IPixelOperation
Set pFilterOp=pRaster
Set pFilterOp.PixelFilter=pFilter
'save out
pSaveAs.saveas "Remap3.img", pOutWs, "IMAGINE Image"
End Sub