Raster

Extracts the cells of a raster whose corresponding cells in the mask raster have a valid value.


Usage tips

ArcObjects

Syntax

See Extract by Mask

Map Algebra syntax

See SelectMask


ArcObjects syntax

IExtractionOp::Raster (geoDataset As IGeoDataset, maskRaster as IGeoDataset) As IGeoDataset

Parameter Explanation
geoDataset An input Raster, RasterDataset, RasterBand, or RasterDescriptor. The geoDataset identifies the cell values that will be selected by the maskRaster.
maskRaster An input Raster, RasterDataset, RasterBand, or RasterDescriptor. Cells with valid values (for example, non-NoData) on the maskRaster will have the values of the corresponding cells on geoDataset assigned to the output raster. Cells with NoData on the maskRaster will be assigned NoData on the output raster.

ArcObjects example

' Create the RasterExtractionOp object
Dim pExtractionOp As IExtractionOp
Set pExtractionOp = New RasterExtractionOp 

' Declare the input objects
Dim pInputRaster As IRaster
Dim pMaskRaster As IRaster

' Call function to open the raster datasets
Set pInputRaster = OpenRasterDataset ("D:\SpatialData", "inputraster")
Set pMaskRaster = OpenRasterDataset ("D:\SpatialData", "maskraster")

' Declare the output dataset
Dim pOutputRaster As IRaster

' Call the method
Set pOutputRaster = pExtraction.Raster(pInputRaster, pMaskRaster)

See Also

  • Attribute
  • Select
  • Sample
  • An overview of the Extraction tools