坡度 (3D Analyst 工具)
汇总
插图

Slope_3d (InRas1, OutRas)
用法
表面参数工具可提供坡度的较新实施,建议使用该工具来代替坡度工具。 坡度工具可将一个平面与九个局部像元进行拟合,但是,平面可能并非景观的良好描述符,可能会掩盖或夸大感兴趣的自然变化。 表面参数工具可将一个表面与像元邻域而不是平面进行拟合,以提供针对地形的更自然的拟合效果。
坡度工具始终使用 3 × 3 像元窗口来计算值,而表面参数工具允许窗口大小介于 3 × 3 到 15 × 15 像元之间。 较大的窗口尺寸对于高分辨率高程数据很有用,可以适当的比例捕获地表过程。 表面参数工具还可提供自适应窗口选项,该选项可评估地形的局部变异性,并为每个像元标识最大的适当邻域大小。 对于被河流、道路或陡坡中断的平缓且均匀的地形而言,该工具很有用。
如果您需要结果与先前工具运行结果完全匹配,或者快速处理时间比更好的算法更重要,则可以继续使用坡度工具的传统方法。
此工具使用移动的 3 x 3 像元窗口来处理数据。 如果处理像元为 NoData,则该位置的输出将为 NoData。
该工具还要求在与处理像元相邻的 8 个像元中,至少有 7 个具有有效值。 如果有效像元少于 7 个,则不执行计算,并且该处理像元处的输出将为 NoData。
输出栅格最外侧行列的像元为 NoData。 这是因为沿着输入数据集边界,这些像元没有足够的有效相邻像元。
输出值的范围取决于测量单位的类型。
对于平面方法,如果表面(垂直)z 单位使用其他单位而非地面 x,y 单位表示,则需要使用 Z 因子对坡度计算进行校正。 仅当选择平面方法时才会启用 Z 因子参数。
在测地线方法中,指定表面 z 单位可确保输出的精度。 仅当选择测地线方法时才会启用 Z 单位参数。
如果 z 单位可用于输入栅格的 垂直坐标系,则将自动应用 z 单位。 如果缺失,建议您定义输入栅格的 z 单位。 可使用 定义投影 工具来指定 z 单位。 如果未定义 z 单位,则默认使用米。
若要对输入栅格进行重采样,需使用双线性技术。 当输出坐标系、范围或像元大小与输入不同时,可以对输入栅格进行重新采样的示例。
如果输入栅格参数值为高分辨率值(其像元大小小于几米,或者特别是存在噪点),请考虑使用表面参数工具及其用户定义的邻域距离选项,而非此工具的直接 3 x 3 邻域。 使用较大邻域可以最大程度地减少噪点表面的影响。 当使用高分辨率表面时,使用较大邻域也可以更好地表示地形和表面特征。
当输入栅格具有矩形像元时,将对其进行处理,以确保输出栅格像元将为正方形,其边长等于矩形像元长度和宽度的平均值。
此工具可通过 GPU 加速,也就是说,如果系统中安装了兼容的图形处理器 (GPU),该设备将用于增强工具的性能。 使用用于分析的目标设备参数(Python 中的 analysis_target_device)来控制是使用 GPU 还是 CPU 来运行该工具。
有关兼容的 GPU 以及配置和使用 GPU 设备的详细信息还有故障排除提示,请参阅 Spatial Analyst 扩展模块帮助中的 使用 Spatial Analyst 进行 GPU 处理。
参数
|
标注
|
说明
|
数据类型
|
|
输入栅格
|
输入表面栅格。
|
Raster Layer
|
|
输出栅格
|
输出坡度栅格。
此栅格为浮点类型。
|
Raster Dataset
|
|
输出测量单位
(可选)
|
指定输出坡度数据的测量单位(度或百分比)。
Degree—The inclination of slope will be calculated in degrees.
Percent rise—The inclination of slope will be calculated as percent rise, also referred to as the percent slope.
|
String
|
|
Z 因子
(可选)
|
一个表面 z 单位中地面 x,y 单位的数量。
z 单位与输入表面的 x,y 单位不同时,可使用 z 因子调整 z 单位的测量单位。 计算最终输出表面时,将用 z 因子乘以输入表面的 z 值。
如果 x,y 单位和 z 单位采用相同的测量单位,则 z 因子为 1。 这是默认设置。
如果 x,y 单位和 z 单位采用不同的测量单位,则必须将 z 因子设置为适当的因子,否则会得到错误的结果。 例如,如果 z 单位是英尺,而 x,y 单位是米,则可以使用 z 因子 0.3048 将 z 单位从英尺转换为米(1 英尺 = 0.3048 米)。
|
Double
|
|
方法
(可选)
|
指定计算将基于平面(平地)还是测地线(椭球)方法。
平面方法适用于保持正确距离和面积的投影中的局部区域。 适用于覆盖诸如城市、县或面积较小的州等区域的分析。 测地线方法可以产生更精确的结果,但会造成处理时间这一潜在成本增加。
Planar—The calculation will be performed on a projected flat plane using a 2D Cartesian coordinate system. This is the default.
Geodesic—The calculation will be performed in a 3D Cartesian coordinate system by considering the shape of the earth as an ellipsoid.
|
String
|
|
Z 单位
(可选)
|
指定将用于垂直 z 值的线性单位。
由垂直坐标系(如果存在)定义。 如果垂直坐标系不存在,则应使用单位列表来定义 z 单位,以确保测地线计算正确。 默认单位为米。
Inch—The linear unit will be inches.
Foot—The linear unit will be feet.
US Foot—The linear unit will be US survey feet.
Yard—The linear unit will be yards.
US Mile—The linear unit will be US survey miles.
Nautical mile—The linear unit will be nautical miles.
Millimeter—The linear unit will be millimeters.
Centimeter—The linear unit will be centimeters.
Meter—The linear unit will be meters.
Kilometer—The linear unit will be kilometers.
Decimeter—The linear unit will be decimeters.
|
String
|
|
用于分析的目标设备
(可选)
|
指定将用于执行计算的设备。
GPU then CPU—If a compatible GPU is found, it will be used to perform the calculation; otherwise, the CPU will be used. This is the default.
CPU only—The calculation will only be performed on the CPU.
GPU only—The calculation will only be performed on the GPU.
|
String
|
arcpy.3d.Slope(in_raster, out_raster, {output_measurement}, {z_factor}, {method}, {z_unit}, {analysis_target_device})
|
名称
|
说明
|
数据类型
|
|
in_raster
|
输入表面栅格。
|
Raster Layer
|
|
out_raster
|
输出坡度栅格。
此栅格为浮点类型。
|
Raster Dataset
|
|
output_measurement
(可选)
|
指定输出坡度数据的测量单位(度或百分比)。
DEGREE—The inclination of slope will be calculated in degrees.
PERCENT_RISE—The inclination of slope will be calculated as percent rise, also referred to as the percent slope.
|
String
|
|
z_factor
(可选)
|
一个表面 z 单位中地面 x,y 单位的数量。
z 单位与输入表面的 x,y 单位不同时,可使用 z 因子调整 z 单位的测量单位。 计算最终输出表面时,将用 z 因子乘以输入表面的 z 值。
如果 x,y 单位和 z 单位采用相同的测量单位,则 z 因子为 1。 这是默认设置。
如果 x,y 单位和 z 单位采用不同的测量单位,则必须将 z 因子设置为适当的因子,否则会得到错误的结果。 例如,如果 z 单位是英尺,而 x,y 单位是米,则可以使用 z 因子 0.3048 将 z 单位从英尺转换为米(1 英尺 = 0.3048 米)。
|
Double
|
|
method
(可选)
|
指定计算将基于平面(平地)还是测地线(椭球)方法。
平面方法适用于保持正确距离和面积的投影中的局部区域。 适用于覆盖诸如城市、县或面积较小的州等区域的分析。 测地线方法可以产生更精确的结果,但会造成处理时间这一潜在成本增加。
PLANAR—The calculation will be performed on a projected flat plane using a 2D Cartesian coordinate system. This is the default.
GEODESIC—The calculation will be performed in a 3D Cartesian coordinate system by considering the shape of the earth as an ellipsoid.
|
String
|
|
z_unit
(可选)
|
指定将用于垂直 z 值的线性单位。
由垂直坐标系(如果存在)定义。 如果垂直坐标系不存在,则应使用单位列表来定义 z 单位,以确保测地线计算正确。 默认单位为米。
INCH—The linear unit will be inches.
FOOT—The linear unit will be feet.
FOOT_US—The linear unit will be US survey feet.
YARD—The linear unit will be yards.
MILE_US—The linear unit will be US survey miles.
NAUTICAL_MILE—The linear unit will be nautical miles.
MILLIMETER—The linear unit will be millimeters.
CENTIMETER—The linear unit will be centimeters.
METER—The linear unit will be meters.
KILOMETER—The linear unit will be kilometers.
DECIMETER—The linear unit will be decimeters.
|
String
|
|
analysis_target_device
(可选)
|
指定将用于执行计算的设备。
GPU_THEN_CPU—If a compatible GPU is found, it will be used to perform the calculation; otherwise, the CPU will be used. This is the default.
CPU_ONLY—The calculation will only be performed on the CPU.
GPU_ONLY—The calculation will only be performed on the GPU.
|
String
|
代码示例
此示例将确定输入表面栅格的坡度值。
import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.ddd.Slope("elevation", "C:/output/outslope01", "DEGREE", 0.3043)
此示例将确定输入表面栅格的坡度值。
# Name: Slope_3d_Ex_02.py
# Description: Identifies the rate of maximum change
# in z-value from each cell.
# Requirements: 3D Analyst extension
# Import system modules
import arcpy
from arcpy import env
# Set environment settings
env.workspace = "C:/data"
# Set local variables
inRaster = "elevation"
outRaster = "C:/output/outslope02"
outMeasurement = "DEGREE"
zFactor = ""
method = "GEODESIC"
zUnit = "FOOT"
# Run Slope
arcpy.ddd.Slope(inRaster, outRaster, outMeasurement, zFactor, method, zUnit)
环境
自动提交, 像元大小, 像元大小投影方法, 当前工作空间, 范围, 地理变换, GPU ID, 掩膜, 输出配置关键字, 输出坐标系, 处理器类型, 临时工作空间, 捕捉栅格, 切片大小
许可信息
- 基本: 需要 3D Analyst 或 Spatial Analyst
- 标准: 需要 3D Analyst 或 Spatial Analyst
- 高级: 需要 3D Analyst 或 Spatial Analyst