Visual Basic (Declaration) | |
---|---|
Public NotInheritable Class RenderingRule |
C# | |
---|---|
public sealed class RenderingRule |
Using the RenderingRule Class was added for services provided by ArcGIS Server version 10.0 and later.
The following lists the rendering rule functions, with hyperlinks to conceptual documentation, that are supported by the RenderingRule Class:
Each rendering rule function requires a different set of arguments when defining a RenderingRule object. All of the rendering rule functions require setting a RenderingRule.RasterFunctionName Property. All but the 'Aspect' rendering rule function requires setting the RenderingRule.RasterFunctionArguments and RenderingRule.VariableName Properties. Creating a RenderingRule object can be tricky as the input arguments for the RasterFunction, RasterFunctionArguments, and VariableName Properties do not accept Enumerations or other strongly typed data to drive the creation of the rendering rule functions. Rather most of the input arguments to the RenderingRule Properties are either Strings or a Dictionary of String/Object value pairs.
C# and VB.NET Code examples for each of the listed rendering rule functions can be found in the ArcGISImageServiceLayer.RenderingRule Property documentation.
The following is a generic description with with general arguments (pseudo-code) for each of the rendering rule functions:
RenderingRule function: 'Aspect' Aspect identifies the down slope direction of the maximum rate of change in value from each cell to its neighbors. Aspect can be thought of as the slope direction. Arguments: { "RasterFunctionName" : "Aspect" } Note: Only the RasterFunctionName property is used. Do not use the RasterFunctionArguments or VariableName properties. |
RenderingRule function: 'Colormap' The Colormap function transforms the pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image based on a color map. Arguments: { "RasterFunctionName" : "Colormap", "RasterFunctionArguments" : { "ColormapName" : "<Random | NDVI | Elevation | Gray>", // do not use in combination with Colormap "Colormap" : // do not use in combination with ColormapName [ [<PixelValue1>, <Red1>, <Green1>, <Blue1>], // [integer, integer, integer, integer] [<PixelValue2>, <Red2>, <Green2>, <Blue2>], // [integer, integer, integer, integer] [<PixelValueN>, <RedN>, <GreenN>, <BlueN>], // [integer, integer, integer, integer] ] }, "VariableName" : "Raster" } Note: Use either the ColormapName or Colormap (arrays) string/object pair in the RasterFunctionArgument property but not both. If using Colormap for each array that contains a PixelValue the Red, Green, and Blue integer values range from 0 to 255. |
RenderingRule function: 'Hillshade' A hillshade is a grayscale 3D model of the surface, with the sun's relative position taken into account for shading the image. Arguments: { "RasterFunctionName" : "Hillshade", "RasterFunctionArguments" : { "Azimuth" : <Azimuth>, // double (e.g. 215.0) "Altitude" : <Altitude>, // double (e.g. 75.0) "ZFactor" : <ZFactor> // double (e.g. 0.3) }, "VariableName" : "DEM" } Note: Azimuth integer values range from 0 to 360. Altitude integer values range from 0 to 90. ZFactor is a scaling number to provide vertical exaggeration for visual effect. |
RenderingRule function: 'NDVI' The Normalized Difference Vegetation Index (NDVI) is a standardized index allowing you to generate an image displaying greenness (relative biomass). This index takes advantage of the contrast of the characteristics of two bands from a multispectral raster dataset—the chlorophyll pigment absorptions in the red band and the high reflectivity of plant materials in the near-infrared (NIR) band. Arguments: { "RasterFunctionName" : "NDVI", "RasterFunctionArguments" : { "VisibleBandID" : <VisibleBandID>, // integer (zero-based band id, e.g. 2) "InfraredBandID" : <InfraredBandID> // integer (zero-based band id, e.g. 1) }, "VariableName" : "Raster" } Note: The NDVI function does not work on single band images. |
RenderingRule function: 'ShadedRelief' A color 3D model of the terrain, created by merging the images from the Elevation-coded and Hillshade methods. Arguments: { "RasterFunctionName" : "ShadedRelief", "RasterFunctionArguments" : { "Azimuth" : <Azimuth>, // double (e.g. 215.0) "Altitude" : <Altitude>, // double (e.g. 75.0) "ZFactor" : <ZFactor> // double (e.g. 0.3) "Colormap" : [ [<PixelValue1>, <Red1>, <Green1>, <Blue1>], // [integer, integer, integer, integer] [<PixelValue2>, <Red2>, <Green2>, <Blue2>], // [integer, integer, integer, integer] [<PixelValueN>, <RedN>, <GreenN>, <BlueN>], // [integer, integer, integer, integer] ] }, "VariableName" : "Raster" } Note: Azimuth integer values range from 0 to 360. Altitude integer values range from 0 to 90. ZFactor is a scaling number to provide vertical exaggeration for visual effect. For the Colormap for each array that contains a PixelValue the Red, Green, and Blue integer values range from 0 to 255. |
RenderingRule function: 'Slope' Slope represents the rate of change of elevation for each Digital Elevation Model (DEM) cell. Arguments: { "RasterFunctionName" : "Slope", "RasterFunctionArguments" : { "ZFactor" : <ZFactor> // double (e.g. 0.3) }, "VariableName" : "DEM" } Note: ZFactor is a scaling number to provide vertical exaggeration for visual effect. |
RenderingRule function: 'Statistics' The Statistics function calculates focal statistics for each pixel of an image based on a defined focal neighborhood. Arguments: { "RasterFunctionName" : "Statistics", "RasterFunctionArguments" : { "Type" : "<Min | Max | Mean | StandardDeviation>", "KernelColumns" : <KernelColumns>, // integer (e.g. 3) "KernelRows" : <KernelRows> // integer (e.g. 3) }, "VariableName" : "Raster" } Note: It is typical to have both the KernalColumns and KernalRows use the same integer value. |
RenderingRule function: 'Stretch' The Stretch function enhances an image by changing properties such as brightness, contrast, and gamma through multiple stretch types. Arguments: { "RasterFunctionName" : "Stretch", "RasterFunctionArguments" : { "StretchType" : <StretchType>, // integer (0 = None, 3 = StandardDeviation, 4 = Histogram Equalization, 5 = MinMax) "NumberOfStandardDeviations" : <NumberOfStandardDeviations>, // integer (e.g. 2) "Statistics" : [ [<Min1>, <Max1>, <Mean1>, <StandardDeviation1>], // [double, double, double, double] [<Min2>, <Max2>, <Mean2>, <StandardDeviation2>], // [double, double, double, double] [<MinN>, <MaxN>, <MeanN>, <StandardDeviationN>], // [double, double, double, double] ] "Gamma" : [<Gamma1>, <Gamma2>, <GammaN>] // array of doubles }, "VariableName" : "Raster" } Note: The values for each array in Statistics can be obtained only for Mosaic datasets by: Min = ArcGISImageServiceLayer.MinValues Property Max = ArcGISImageServiceLayer.MaxValues Property Mean = ArcGISImageServiceLayer.MeanValues Property StandardDeviation = ArcGISImageServiceLayer.StdvValues Property |
System.Object
ESRI.ArcGIS.Client.RenderingRule
Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows 7, Windows 8