Assign row or column number to grid cells

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. Grid cells in the new raster will be assigned either the row or column number or the x- or y-coordinate, depending on the selected option. The user must also specify the name of the base image and the data type (either float or integer). x- or y-coordinate images must be float since most coordinate systems require larger numbers than are able to fit within the allowable range of an integer value.

Notice that the functionality of this tool is replicated by the Raster Calculator operations ColumnNumber, RowNumber, XCoordinate, andYCoordinate.

See Also:

Scripting:

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

wd = pluginHost.getWorkingDirectory()
inputFile = wd + "input.dep"
outputFile = wd + "output.dep"
assign = "column number"
dataType = "float"
args = [inputFile, outputFile, assign, dataType]
pluginHost.runPlugin("AssignRowOrColNumber", 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"
assign = "y-coordinate"
dataType = "integer"
String[] args = [inputFile, outputFile, assign, dataType]
pluginHost.runPlugin("AssignRowOrColNumber", args, false)

Credits: