Change data scale

This tool can be used to change the data scale of a raster image. The data scale is a parameter that is used for determining the default visualization properties applied when an image is first displayed. Data scale options include 'continuous', 'categorical', and 'boolean'. Rasters displayed using the continuous data scale will be displayed using the default continuous palette and using a linear stretch between the display minimum and maximum values. Rasters displayed using either the categorical or boolean data scales will be displayed using the default categorical palette and will not have a linear stretch applied. These data scales are appropriate for displaying non-continuous, entity-based rasters, e.g. a raster containing polygons. Notice that this tool will alter a setting in the raster's header file (.dep), not affecting the data file (.tas). This same change to the header file can be made by selecting or de-selecting the 'apply linear stretch' checkbox on the Layer Properties toolbar.

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.dep" + ";" + wd + "input2.dep" + ";" + wd + "input3.dep"
dataScale = "categorical"
args = [inputFiles, dataScale]
pluginHost.runPlugin("ChangeDataScale", 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.dep" + ";" + wd + "input2.dep" + ";" + wd + "input3.dep"
def dataScale = "continuous"
String[] args = [inputFiles, dataScale]
pluginHost.runPlugin("ChangeDataScale", args, false)

Credits: