AspectSlope

Synthèse

Creates a raster object that simultaneously displays the aspect and slope of a surface.

Discussion

For more information about how this function works, see the Aspect Slope raster function.

The referenced raster dataset for the raster object is temporary. To make it permanent, you can call the raster object's save method.

Syntaxe

AspectSlope (raster, {z_factor})
ParamètreExplicationType de données
raster

The input elevation raster.

Raster
z_factor

The z-factor is a scaling factor used to convert the elevation values for the following purposes:

  • Convert the elevation units (such as meters or feet) to the horizontal coordinate units of the dataset, which may be feet, meters, or degrees.
  • Add vertical exaggeration for visual effect.

If the x,y units and z units are in the same units of measure, the z-factor should be set to 1. The z-values of the input surface are multiplied by the z-factor when calculating the final output surface.

(La valeur par défaut est 1)

Double
Valeur renvoyée
Type de donnéesExplication
Raster

The output raster.

Exemple de code

AspectSlope example 1

This example calculates the aspect and slope of the raster.

from arcpy.sa import *
out_aspectslope_raster = AspectSlope("elevation.tif", 3)
out_aspectslope_raster.save("C:/arcpyExamples/outputs/aspectslope.tif")
AspectSlope example 2

This example calculates the aspect and slope of the raster.

# Import the system modules
import arcpy
from arcpy.sa import *

# Set the analysis environments
arcpy.env.workspace = "C:/arcpyExamples/data"

# Set the local variables
in_raster = "elevation.tif"

# Execute the AspectSlope function
out_aspectslope_raster = AspectSlope(in_raster, 3)

# Save the output
out_aspectslope_raster.save("C:/arcpyExamples/outputs/aspectslope.tif")

Rubriques connexes