Erase polygon from raster

This tool can be used to remove (i.e. replace with no-data values) one or more areas defined by a vector polygon (shapefile) from a rasters. The user must specify the names of the input raster files and the input vector polygon file. The input vector file must be a shapefile of a Polygon base shape type. This file may contain multiple polygon features. Only the exterior hull of polygons will be used, i.e. polygon holes are ignored. Output files have the same name as their input raster files but have an '_erased' suffix appended.

Erase polygons can be created using on-screen digitizing to identify an area of interest on the base raster.

See Also:

Scripting:

The following is an example of a Python script using this tool:

wd = pluginHost.getWorkingDirectory()
# You may have multiple input files but they must
# be separated by semicolons in the string.
inputFiles = wd + "input1.dep" + ";" + wd + "input2.dep" + ";" + wd + "input3.dep"
clipFile = wd + "polygon.shp"
args = [inputFiles, clipFile]
pluginHost.runPlugin("ErasePolygonFromRaster", args, False)

This is a Groovy script also using this tool:

def wd = pluginHost.getWorkingDirectory()
// You may have multiple input files but they must
// be separated by semicolons in the string.
def inputFiles = wd + "input1.dep" + ";" + wd + "input2.dep" + ";" + wd + "input3.dep"
def clipFile = wd + "polygon.shp"
String[] args = [inputFiles, clipFile]
pluginHost.runPlugin("ErasePolygonFromRaster", args, false)

Credits: