Import ArcGIS ASCII grid

This tool can be used to import an ArcGIS ASCII grid file to a Whitebox GAT raster file. ASCII files are text and as such are capable of being opened and viewed using any text editor. The user must specify the name of one or more ArcGIS ASCII grid files to be imported. The tool will create Whitebox GAT raster files for each input file. Output file names are the same of the input files.

The format of the ArcGIS ASCII grid format is as follows:

NCOLS ###
NROWS ###
XLLCORNER / XLLCENTER ###
YLLCORNER / YLLCENTER ###
CELLSIZE ###
NODATA_VALUE ###
####.### ####.### ####.###...
####.### ####.### ####.###...

Where # represents a numeric value and the grid data is stored in space-delimited rows starting on row seven. The header keyword and numeric entry in the header section (first six lines of the file) must also be delimited using one or more spaces. Notice that the header key words are case insensitive. The geographic referencing is based on either the corner or centre of the lower left grid cell.

ASCII files can be very large when there are a large number of rows and columns in the grid and are also much slower to read/write compared to binary files. As such, the ArcGIS floating-point binary grid format is a better way to transfer files between ArcGIS and Whitebox GAT.

Use the Raster to ASCII tool in the Conversion Tools toolbox of ArcGIS to create the ASCII grid files for subsequent import to Whitebox GAT.

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"
args = [inputFiles]
pluginHost.runPlugin("ImportArcAsciiGrid", 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"
String[] args = [inputFiles]
pluginHost.runPlugin("ImportArcAsciiGrid", args, false)

Credits: