Import SAGA grid

This tool can be used to convert SAGA GIS raster grids to Whitebox GAT raster files. SAGA grid files consist of an ASCII (i.e. human readable text) header file with a *.sgrd extension and a binary data file with a *.sdat extension. Importantly, the corresponding header and data files must be located within the same directory. The tool will create Whitebox GAT raster files for each input file. Output file names are the same of the input files. The tool supports reading SAGA rasters of the following data types: BIT, BYTE_UNSIGNED, BYTE, SHORTINT_UNSIGNED, SHORTINT, INTEGER_UNSIGNED, INTEGER, FLOAT, and DOUBLE.

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 + "image1.sgrd" + ";" + wd + "image2.sgrd" + ";" + wd + "image3.sgrd"
args = [inputFiles]
pluginHost.runPlugin("ImportSagaGrid", 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 + "image1.sgrd" + ";" + wd + "image2.sgrd" + ";" + wd + "image3.sgrd"
String[] args = [inputFiles]
pluginHost.runPlugin("ImportSagaGrid", args, false)

Credits: