RasterFunction QML Type

An operation that can be performed on one or more rasters or a mosaic dataset by applying on-the-fly processing. More...

Import Statement: import Esri.ArcGISRuntime 100.15
Since: Esri.ArcGISRuntime 100.0
Inherits:

Object

Properties

Signals

Detailed Description

Examples of RasterFunctions include Hillshade, Stretch, Colormap, Mask, and ShadedRelief, among others.

RasterFunctions in ArcGIS Runtime work very similarly to the ArcGIS REST API. The following workflow is a common way to render a raster using a raster function:

  1. Create a raster function via JSON. For example, the following JSON could be used for a Pansharpen function:
    {
      "raster_function":{"type":"Pansharpen_function"},
      "raster_function_arguments":
      {
        "weights":{"double_array":[0.10000000000000001,0.5,0.40000000000000002,0.29999999999999999],"type":"Raster_function_variable"},
        "pansharpen_type":{"pansharpen_type":"gram_schmidt","type":"Raster_function_variable"},
        "pan_raster":{"name":"pan_raster","is_raster":true,"type":"Raster_function_variable"},
        "raster":{"name":"raster","is_raster":true,"type":"Raster_function_variable"},
        "type":"Raster_function_arguments"
      },
      "type":"Raster_function_template"
    }

    For documentation on the ArcGIS Runtime JSON format and syntax for the different raster functions, please see the Guide topic Add raster data.

  2. Construct a RasterFunction object with the JSON created in step 1.
  3. Get the RasterFunctionArguments with arguments.
  4. Add rasters to the RasterFunctionArguments.
  5. Create a new Raster object with this RasterFunction.
  6. Create a new RasterLayer with the Raster object.
  7. Add the RasterLayer to a map or scene.

For further details on raster functions, please see the ArcGIS Desktop documentation

Use an ImageServiceRaster as an argument for a raster function:

// create raster function
const rasterFunction = ArcGISRuntimeEnvironment.createObject("RasterFunction", {path: dataPath + "/hillshade_simplified.json"});
// get the arguments
const rasterFunctionArguments = rasterFunction.arguments;
// set the raster
rasterFunctionArguments.setRaster("raster", imageServiceRaster);

// create the raster from the raster function
const raster = ArcGISRuntimeEnvironment.createObject("Raster", { rasterFunction: rasterFunction });

// create raster layer from raster
const rasterLayer = ArcGISRuntimeEnvironment.createObject("RasterLayer", { raster: raster });

You can see the complete code in the QML sample Raster Function Service.

See also Loadable.

Property Documentation

Returns the arguments of this raster function (read-only).


json : jsobject

The JSON representation of this object.


path : url

The path to the local RasterFunction JSON file.


Signal Documentation

pathChanged()

Emitted when the path property changes.

Note: The corresponding handler is onPathChanged.


Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.