How to erase a portion of a geodatabase raster dataset


Summary This article shows how to erase a portion of a raster dataset stored in a file geodatabase or an ArcSDE geodatabase. The pixels in the erase extent will change to NoData pixels after the operation.

Erasing a portion of a geodatabase raster dataset

The following code shows how to erase a portion of a geodatabase raster dataset:
[Java]
static void erasePortionOfGDBRaster(IRasterDataset rasterDataset, IEnvelope
    eraseExtent)throws Exception{
    //IRasterDatasetEdit is needed for erase operation, Cast input IRasterDataset to IRasterDatasetEdit.
    IRasterDatasetEdit rasterDatasetEdit = new IRasterDatasetEditProxy(rasterDataset)
        ;
    rasterDatasetEdit.erase(eraseExtent);
}


See Also:

How to access a raster dataset or raster catalog




Additional Requirements
  • The code in this task requires that your project include references to ESRI.ArcGIS.DataSourcesRaster, ESRI.ArcGIS.Geodatabase, and ESRI.ArcGIS.Geometry.

Development licensing Deployment licensing
ArcView ArcView
ArcEditor ArcEditor
ArcInfo ArcInfo
Engine Developer Kit Engine Runtime