GeoEco.DataManagement.ArcGISRasters.ArcGISRaster.ExtractByMask
- classmethod ArcGISRaster.ExtractByMask(inputRaster, mask, outputRaster, overwriteExisting=False)
Extracts the cells of a raster that correspond to the areas defined by a mask.
This function just calls the ArcGIS Spatial Analyst’s
ExtractbyMask()tool with the extraction_area set toINSIDE. This function only exists so that we can easily create a batched version of that tool.Requires: ArcGIS Pro 3.2.0 or later or ArcGIS Server equivalent to ArcGIS Pro 3.2.0 or later, ArcGIS ‘spatial’ extension.
- Parameters:
inputRaster (
str) – The input raster from which cells will be extracted. Minimum length꞉ 1. Must exist.mask (
str) – Input mask data defining areas to extract. This can be a raster or feature dataset. When it is is a raster, NoData cells on it will be assigned NoData values on the output raster. Minimum length꞉ 1. Must exist.outputRaster (
str) – The output raster containing the cell values extracted from the input raster. If this path refers to the file system, missing directories in the path will be created if they do not exist. Minimum length꞉ 1. Must be different than inputRaster and mask.overwriteExisting (
bool, optional) – If True, the raster will be overwritten, if it exists. If False, a ValueError will be raised if the raster exists.