Load a raster from a service, then apply a function to it.
Raster functions allow processing operations that can be applied to one or more rasters on the fly. Functions can be applied to rasters that come from a service. A land survey agency may apply hillshade and aspect functions to rasters with elevation data in order to better determine the topography of a landscape and to make further planning decisions.
The raster function is applied automatically when the sample starts and the result is displayed.
- Create the
ImageServiceRaster
referring to the image server URL. - Create the
RasterFunction
from a JSON string. - Get the name of the raster argument to the function with
rasterFunction.Arguments.GetRasterNames().First()
- Set the raster argument with
rasterFunction.SetRaster(rasterName, imageServiceRaster)
. - Create a new
Raster
referring to the raster function. - Create a
RasterLayer
to visualize the computed raster. - Display the raster.
- ImageServiceRaster
- Raster
- RasterFunction
- RasterFunctionArguments
- RasterLayer
The sample applies a hillshade function to a raster produced from the National Land Cover Database, NLCDLandCover2001. You can learn more about the hillshade function in the ArcMap documentation.
The raster function computation happens locally on the client device.
function, layer, raster, raster function, service