HillshadeFunction

Base Type: RasterFunction

A class for a raster hillshade function.

Remarks

Generates a grayscale model of a terrain, with the sun's relative position taken into account for shading the terrain. This method uses the Altitude and Azimuth properties to specify the sun's position.

Examples

C#

//define image server

string url_DEMService = "http://ais3/arcgis/services/testDEM/ImageServer";

testDTED_ImageServer imageSrv = new testDTED_ImageServer();

imageSrv.Url = url_DEMService;


//define image description

GeoImageDescription geoImgDesc = new GeoImageDescription();

geoImgDesc.Height = 600;

geoImgDesc.Width = 800;

geoImgDesc.Interpolation = rstResamplingTypes.RSP_BilinearInterpolation;

ImageServiceInfo isInfo = imageSrv.GetServiceInfo();

geoImgDesc.Extent = isInfo.Extent;


//define a hillshade function and attach to a rendering rule

RenderingRule renderRule = new RenderingRule();

HillshadeFunction function = new HillshadeFunction();

HillshadeFunctionArguments argument = new HillshadeFunctionArguments();

argument.Names = new string[] { "Altitude", "Azimuth", "ZFactor" };

argument.Values = new object[] { 45, 315, 1.0 };

renderRule.Arguments = argument;

renderRule.Function = function;

renderRule.VariableName = "DEM";

geoImgDesc.RenderingRule = renderRule;

//define export format

ImageType imageType = new ImageType();

imageType.ImageFormat = esriImageFormat.esriImageJPG;

imageType.ImageReturnType = esriImageReturnType.esriImageReturnURL;

ImageResult result = imageSrv.ExportImage(geoImgDesc, imageType);


//download result

string fileName = @"c:\temp\hillshadeFunction.jpg";

System.Net.WebClient webClient = new System.Net.WebClient();

webClient.DownloadFile(result.ImageURL, fileName);

}

11/8/2016