Convert XYZ text file to raster

This tool will convert an ASCII text file containing X,Y,Z point data into a raster image. The user must specify the names of the text file containing the point data, a base raster image, and the output raster name. The point data in the text file must be delimited using either tabs, spaces, or commas. The Z value of each point will be assigned to the grid cell in the output image that is nearest to the X,Y co-ordinates. Background grid cells in the output image will contain zero values and not the NoData value. The base raster image is used to specify the output image spatial extent and grid resolution.

If you wish to interpolate the X,Y,Z point data to a continuous surface or measure point density instead of simply positioning the point data into a raster grid, use one of the interpolation tools contained in the Raster Creation toolbox to interpolate the dataset.

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.txt" + ";" + wd + "input2.txt" + ";" + wd + "input3.txt"
firstLineIsHeader = "false"
outputFile = wd + "output.dep"
baseFile = wd + "base.dep"
dataType = "float"
args = [inputFiles, firstLineIsHeader, outputFile, baseFile, dataType]
pluginHost.runPlugin("XYZTextToRaster", 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.txt" + ";" + wd + "input2.txt" + ";" + wd + "input3.txt"
def firstLineIsHeader = "true"
def outputFile = wd + "output.dep"
def baseFile = wd + "base.dep"
def dataType = "integer"
String[] args = [inputFiles, firstLineIsHeader, outputFile, baseFile, dataType]
pluginHost.runPlugin("XYZTextToRaster", args, false)

Credits: