This tool can be used to create a new raster with the same coordinates and dimensions (i.e. rows and columns) as an existing base image. The user must specify the name of the base image, the value that the new grid will be filled with (default of zero), and the data type (either float or integer). Notice that if you desire the newly created grid to be filled with NoData values, simply type "NoData" as the constant value. Notice that the functionality of this tool is the same as multiplying the base image by zero and adding the constant value.
The following is an example of a Python script that uses this tool:
wd = pluginHost.getWorkingDirectory()
inputFile = wd + "input.dep"
outputFile = wd + "output.dep"
constantValue = "NoData"
dataType = "float"
args = [inputFile, outputFile, constantValue, dataType]
pluginHost.runPlugin("NewRasterFromBase", args, False)
This is a Groovy script also using this tool:
def wd = pluginHost.getWorkingDirectory()
def inputFile = wd + "input.dep"
def outputFile = wd + "output.dep"
def constantValue = "0.0"
def dataType = "integer"
String args = [inputFile, outputFile, constantValue, dataType]
pluginHost.runPlugin("NewRasterFromBase", args, false)