java.lang.Object
com.esri.arcgisruntime.raster.RasterFunction
Represents operations that can be performed on one or more rasters or a mosaic dataset by applying on-the-fly
processing.
Examples include Colormap, Hillshade, ShadedRelief.
The arguments of the raster function should be initialized before it can be processed. Use getArguments()
to
get the arguments.
The processed result can be rendered by creating a new raster using Raster(RasterFunction)
. This
raster can then be binded to a raster layer using RasterLayer(Raster)
.
Example for working with a Raster Function:
RasterFunction rasterFunction = new RasterFunction("absolute-file-path-of-raster-function-json"); // get the arguments of the raster function RasterFunctionArguments rasterFunctionArguments = rasterFunction.getArguments(); // initialize the arguments List<String> rasterNames = rasterFunctionArguments.getRasterNames(); // assuming rasterNames has 2 entries, set the 2 rasters rasterFunctionArguments.setRaster(rasterNames.get(0), new Raster("absolute-file-path-of-raster0"); rasterFunctionArguments.setRaster(rasterNames.get(1), new Raster("absolute-file-path-of-raster1"); // create a new raster based on the function Raster raster = new Raster(rasterFunction); // create a layer to display the processed result RasterLayer rasterLayer = new RasterLayer(raster);
- Since:
- 100.0.0
-
Constructor Summary
ConstructorDescriptionRasterFunction
(String jsonFilePath) Creates a raster function based on JSON file path. -
Method Summary
Modifier and TypeMethodDescriptionstatic RasterFunction
Creates a RasterFunction instance from a JSON string.Returns the arguments of this function.
-
Constructor Details
-
RasterFunction
Creates a raster function based on JSON file path.- Parameters:
jsonFilePath
- absolute file path to JSON that contains the raster function- Throws:
IllegalArgumentException
- if jsonFilePath is null or emptyArcGISRuntimeException
- if file does not exist at jsonFilePath- Since:
- 100.0.0
-
-
Method Details
-
fromJson
Creates a RasterFunction instance from a JSON string.- Parameters:
json
- a JSON string that represents a RasterFunction- Returns:
- a RasterFunction instance
- Throws:
IllegalArgumentException
- if json is null or emptyArcGISRuntimeException
- if json is invalid- Since:
- 100.1.0
-
getArguments
Returns the arguments of this function.- Returns:
- the arguments of this function
- Since:
- 100.0.0
-