AspectSlope
汇总
用于创建可同时显示表面坡向和坡度的栅格对象。
讨论
有关此函数工作原理的详细信息,请参阅 坡向坡度 栅格函数。
栅格对象所引用的栅格数据集是临时性的。 要将其设置为永久,可以调用栅格对象的 save 方法。
语法
AspectSlope(raster, {z_factor})
| 参数 | 说明 | 数据类型 |
|---|---|---|
|
raster |
The input elevation raster. |
Raster |
|
z_factor |
The
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. (默认值为 1) |
Double |
返回值
| 数据类型 | 说明 |
|---|---|
|
Raster |
输出栅格。 |
代码示例
AspectSlope 示例 1
本示例将计算栅格的坡向和坡度。
from arcpy.sa import *
out_aspectslope_raster = AspectSlope("elevation.tif", 3)
out_aspectslope_raster.save("C:/arcpyExamples/outputs/aspectslope.tif")
AspectSlope 示例 2
本示例将计算栅格的坡向和坡度。
# 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"
# Run the AspectSlope function
out_aspectslope_raster = AspectSlope(in_raster, 3)
# Save the output
out_aspectslope_raster.save("C:/arcpyExamples/outputs/aspectslope.tif")