Show Navigation | Hide Navigation
You are here:
Extensions > Spatial Analyst > Spatial Analyst functional reference > Surface (Spatial Analyst)

Hillshade

Release 9.3
Last modified September 7, 2011
E-mail This Topic Printable Version Give Us Feedback

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


Related Topics

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

Learn more about how Hillshade works


Illustration

Hillshade illustration

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

Command Line:
Hillshade_sa InRas1 OutRas 99 33

Usage tips

Command line syntax
An overview of the Command Line window
Hillshade_sa <in_raster> <out_raster> {azimuth} {altitude} {NO_SHADOWS | SHADOWS} {z_factor}

Parameter Explanation Data Type
<in_raster>

Input raster.

Composite Geodataset
<out_raster>

The raster to be created.

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

Raster Dataset
{azimuth}

Azimuth angle of the light source.

The azimuth is expressed in positive degrees from 0 to 360, measured clockwise from north.

The default is 315 degrees.

Double
{altitude}

Altitude angle of the light source above the horizon.

The altitude is expressed in positive degrees, with 0 degrees at the horizon and 90 degrees directly overhead.

The default is 45 degrees.

Double
{NO_SHADOWS | SHADOWS}

Type of shaded relief to be generated.

  • NO_SHADOWS  — 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.
  • SHADOWS  — The output shaded raster considers 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.

Boolean
{z_factor}

The number of ground x,y units in one surface z unit.

The z-factor adjusts the units of measure for the z units when they are different from the x,y units of the input surface. The z-values of the input surface are multiplied by the z-factor when calculating the final output surface.

If the x,y units and z units are in the same units of measure, the z-factor is 1. This is the default.

If the x,y units and z units are in different units of measure, the z-factor must be set to the appropriate factor, or the results will be incorrect.

For example, if your z units are feet and your x,y units are meters, you would use a z-factor of 0.3048 to convert your z units from feet to meters (1 foot = 0.3048 meter).

Double
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
Hillshade_sa (in_raster, out_raster, azimuth, altitude, model_shadows, z_factor)

Parameter Explanation Data Type
in_raster (Required)

Input raster.

Composite Geodataset
out_raster (Required)

The raster to be created.

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

Raster Dataset
azimuth (Optional)

Azimuth angle of the light source.

The azimuth is expressed in positive degrees from 0 to 360, measured clockwise from north.

The default is 315 degrees.

Double
altitude (Optional)

Altitude angle of the light source above the horizon.

The altitude is expressed in positive degrees, with 0 degrees at the horizon and 90 degrees directly overhead.

The default is 45 degrees.

Double
model_shadows (Optional)

Type of shaded relief to be generated.

  • NO_SHADOWS  — 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.
  • SHADOWS  — The output shaded raster considers 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.

Boolean
z_factor (Optional)

The number of ground x,y units in one surface z unit.

The z-factor adjusts the units of measure for the z units when they are different from the x,y units of the input surface. The z-values of the input surface are multiplied by the z-factor when calculating the final output surface.

If the x,y units and z units are in the same units of measure, the z-factor is 1. This is the default.

If the x,y units and z units are in different units of measure, the z-factor must be set to the appropriate factor, or the results will be incorrect.

For example, if your z units are feet and your x,y units are meters, you would use a z-factor of 0.3048 to convert your z units from feet to meters (1 foot = 0.3048 meter).

Double

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"
    OutRaster = "C:/data/hillshade"
    InAzimuth = "325"
    InAltitude = "50"

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

    # Process: Hillshade
    gp.Hillshade_sa(InRaster, OutRaster, InAzimuth, InAltitude)

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

Map Algebra syntax
Hillshade(<grid>, {azimuth}, {altitude}, {ALL | SHADE | SHADOW}, {z_factor})

Parameter Explanation
<grid> The input raster 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. The default 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. The default is 45 degrees.
{ALL | SHADE | SHADOW} Keyword specifying the type of shaded relief to be generated.
  • ALL  — The output shaded relief raster considers 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. This is the default.
  • SHADE  — 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.
  • SHADOW  — The output raster is a binary raster with 0 representing areas in shadow. All areas not in shadow are assigned a value of 1.
{z_factor} The number of ground x,y units in one surface z unit.
The <grid> z units are multiplied by the specified {z_factor} to convert the output raster z units to another unit of measure. By default, {z_factor} of 1 is applied. Higher z-values will result in a more exaggerated relief (surface) and, thus, in a more extreme shading.

Map Algebra example

hillshade(ingrid)
hillshade(ingrid, 180, 33)
hillshade(ingrid, #, 59, shade)
hillshade(ingrid, 90, 15, shadow, 2.5)
hillshade(ingrid, 213, 20, #, 0.5)

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.
Copyright © Environmental Systems Research Institute, Inc.