Reclass by Remap

'Reclassifies (or changes) the values of the input cells of a raster by ' using a remap that is built programmatically. ' 'Function ReclassByRemap(ByVal GeoDataset As esriGeoDatabase.IGeoDataset, _ ' ByVal Remap As IRemap, ByVal retainMissingValues As Boolean) _ ' As esriGeoDatabase.IGeoDataset ' 'Member of esriGeoAnalyst.IReclassOp 
Dim pReclassOp As IReclassOp
Set pReclassOp = New RasterReclassOp

' Get raster dataset Dim pRas01 As IRaster
Set pRas01 = readRasterFromDisk("c:\data\myRaster")

' Set the Remap Dim pRemap As IRemap
Dim pSRemap As INumberRemap
Set pSRemap = New NumberRemap

pSRemap.MapRange -3, 0, 0
pSRemap.MapRange 0, 2, 20
pSRemap.MapRange 2, 3, 60
Set pRemap = pSRemap

' Create output raster dataset Dim pRasOut As IRaster
Set pRasOut = pReclassOp.ReclassByRemap(pRas01, pRemap, True)
Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: