You are here:
Extensions > Spatial Analyst > Spatial Analyst functional reference > Surface (Spatial Analyst)

Release 9.3

Print all topics in : "Surface (Spatial Analyst)"

Computes hillshade values for a raster surface by considering the illumination angle and shadows.

Illustration

Map Algebra:
` OutRas = Hillshade(InRas1, 99, 33)`

Command Line:
` Hillshade_sa InRas1 OutRas 99 33`

Usage tips

Command line and Scripting

• The Hillshade tool creates a shaded relief raster from a raster. The illumination source is considered at infinity.

• The hillshade raster has an integer value range of 0 to 255.

• Two types of shaded relief rasters can be output. If the Model shadows check box is unchecked, the output raster only considers local illumination angle. If the Model shadows check box is checked, the output raster considers the effects of both local illumination angle and shadow.

• The analysis of shadows is done by considering the effects of the local horizon at each cell. Raster cells in shadow are assigned a value of zero.

• To create a raster of the shadow areas only, use the Con, Reclassify, or Extract By Attribute tool to separate the value zero from the other hillshade values. Hillshade must have the Model shadows check box checked.

• If the input raster is in a spherical coordinate system, such as decimal degrees, the results from Hillshade may look peculiar. This is due to the difference in measure between the horizontal ground units and the elevation z units. Since the length of a degree of longitude changes with latitude, you will need to specify an appropriate z-factor for that latitude. If your x,y units are decimal degrees and your z units are meters, some appropriate z-factors for particular latitudes are:

```    Latitude     Z-factor
0           0.00000898
10           0.00000912
20           0.00000956
30           0.00001036
40           0.00001171
50           0.00001395
60           0.00001792
70           0.00002619
80           0.00005156```

• You can create dramatic three-dimensional views of the hillshaded surface by draping the output raster using ArcGIS 3D Analyst.

• The following environment settings affect this tool:

• Map Algebra

• Hillshade creates a shaded relief raster from an elevation raster. The illumination source is considered to be at infinity.

• The hillshade raster has an integer value range of 0 to 255.

• Three types of shaded relief rasters can be output. The SHADE option only considers local illumination angle. The SHADOW option only considers whether or not the cell is in shadow. The ALL option considers the effects of both local illumination angle and shadow.

• The analysis of shadows is done by considering the effects of the local horizon at each cell. Raster cells in shadow are assigned a value of zero.

• If the input raster is in a spherical coordinate system, such as decimal degrees, the results from Hillshade may look peculiar. This is due to the difference in measure between the horizontal ground units and the elevation z units. Since the length of a degree of longitude changes with latitude, you will need to specify an appropriate z-factor for that latitude. If your x,y units are decimal degrees and your z units are meters, some appropriate z-factors for particular latitudes are:

```    Latitude     Z-factor
0           0.00000898
10           0.00000912
20           0.00000956
30           0.00001036
40           0.00001171
50           0.00001395
60           0.00001792
70           0.00002619
80           0.00005156```

• You can create dramatic three-dimensional views of the hillshaded surface by draping the output raster using ArcGIS 3D Analyst.

• Learn more about how to specify the input raster dataset in the Map Algebra expression of Raster Calculator.

• ArcObjects

• Hillshade creates a shaded relief raster from an elevation raster. The illumination source is considered to be at infinity.

• The hillshade raster has an integer value range of 0 to 255.

• Two types of shaded relief rasters can be output. With inModelShadows TRUE, the effects of both local illumination angle and shadow are considered. With inModelShadows FALSE, only local illumination angle is considered.

• The analysis of shadows is done by considering the effects of the local horizon at each cell. Raster cells in shadow are assigned a value of zero.

• If the input raster is in a spherical coordinate system, such as decimal degrees, the results from Hillshade may look peculiar. This is due to the difference in measure between the horizontal ground units and the elevation z units. Since the length of a degree of longitude changes with latitude, you will need to specify an appropriate z-factor for that latitude. If your x,y units are decimal degrees and your z units are meters, some appropriate z-factors for particular latitudes are:

```    Latitude     Z-factor
0           0.00000898
10           0.00000912
20           0.00000956
30           0.00001036
40           0.00001171
50           0.00001395
60           0.00001792
70           0.00002619
80           0.00005156```

• The output from the ArcObjects method is a raster object

Command line syntax
An overview of the Command Line window

Data types for geoprocessing tool parameters

Command line example

`Hillshade_sa C:/data/dem C:/data/hillshade 325 50`

Scripting syntax
About getting started with writing geoprocessing scripts

Data types for geoprocessing tool parameters

Script example

```# Hillshade_sample.py
# Description:
#   Computes hillshade values for a raster surface.
# Requirements: None
# Author: ESRI
# Date: Sept 6, 2005
# Import system modules
import arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

try:
# Set local variables
InRaster = "C:/data/dem"
InAzimuth = "325"
InAltitude = "50"

# Check out ArcGIS Spatial Analyst extension license
gp.CheckOutExtension("Spatial")

except:
# If an error occurred while running a tool, then print the messages.
print gp.GetMessages()
```

Map Algebra syntax

Map Algebra example

```hillshade(ingrid)

ArcObjects syntax
ISurfaceOp::Hillshade (geoDataset As IGeoDataset, azimuth As Double, altitude As Double, inModelShadows As Boolean, [zFactor As Variant]) As IGeoDataset

 Parameter Explanation geoDataset The input Raster, RasterDataset, RasterBand, or RasterDescriptor from which the shaded relief is derived. azimuth The azimuth angle of the light source. The azimuth is expressed in positive degrees from 0 to 360, measured clockwise from north. A commonly used azimuth is 315 degrees. altitude The slope or angle of the illumination source above the horizon. The slope is expressed in positive degrees, with 0 degrees at the horizon and 90 degrees directly overhead. A commonly used altitude is 45 degrees. inModelShadows A Boolean specifying the type of shaded relief to be generated. If True, the output shaded relief raster will consider both local illumination angles and shadows. The output raster contains values ranging from 0 to 255, with 0 representing the shadow areas, and 255 the brightest. If False, the output shaded relief raster only considers local illumination angles; the effects of shadows are not considered. The output raster contains values ranging from 0 to 255, with 0 representing the darkest areas, and 255 the brightest. [zFactor] The geoDataset z units are multiplied by the specified [zFactor] to convert the output raster z units to another unit of measure. If no [zFactor] is specified, a [zFactor] of 1 is applied. Higher z-values will result in a more exaggerated relief (surface) and, thus, in a more extreme shading.

ArcObjects example

```' Create the RasterSurfaceOp object
Dim pSurfaceOp As ISurfaceOp
Set pSurfaceOp = New RasterSurfaceOp

' Create the input raster object
Dim pInputDataset As IGeoDataset

' Calls function to open the raster dataset from disk
Set pInputDataset = OpenRasterDataset("D:\SpatialData", "inputraster")

' Create the output dataset object
Dim pOutputDataset As IGeoDataset

' Calls the method
Set pOutputDataset = pSurfaceOp.Hillshade (pInputDataset, 315, 45, True)
```

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.