Slope
汇总
表示各像素的高程变化率。
讨论
有关此函数工作原理的详细信息,请参阅 坡度 栅格函数。
栅格对象所引用的栅格数据集是临时性的。 要将其设置为永久,可以调用栅格对象的 save 方法。
语法
Slope(dem, {z_factor}, {slope_type}, {ps_power}, {psz_factor}, {remove_edge_effect})
| 参数 | 说明 | 数据类型 |
|---|---|---|
|
dem |
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 |
|
slope_type |
The inclination of slope can be output as either a value in degrees or percent rise. Specify one of the following: (默认值为 DEGREE) |
String |
|
ps_power |
Accounts for the altitude changes (or scale) as the viewer zooms in and out on the map display. It is the exponent applied to the pixel size term in the equation that controls the rate at which the This parameter is only valid when (默认值为 0.664) |
Double |
|
psz_factor |
Accounts for changes in scale as the viewer zooms in and out on the map display. The value controls the rate at which the This parameter is only valid when (默认值为 0.024) |
Double |
|
remove_edge_effect |
Using this option will avoid any resampling of artifacts that may occur along the edges of a raster. The output pixels along the edge of a raster or next to pixels without a value will be populated with NoData. It is recommended that you use this option only when there are other rasters with overlapping pixels available. When overlapping pixels are available, these areas of NoData will display the overlapping pixel values instead of being blank.
(默认值为 False) |
Boolean |
返回值
| 数据类型 | 说明 |
|---|---|
|
Raster |
输出栅格。 |
代码示例
本示例将计算给定高程的坡度。
from arcpy.ia import *
out_slope_raster = Slope("elevation.tif")
out_slope_raster.save("C:/arcpyExamples/outputs/slope.tif")
本示例将计算给定高程的坡度。
# Import the system modules
import arcpy
from arcpy.ia import *
# Set the analysis environments
arcpy.env.workspace = "C:/arcpyExamples/data"
# Set the local variables
in_dem = "elevation.tif"
# Run the Slope function
out_slope_raster = Slope(in_raster)
# Save the output
out_slope_raster.save("C:/arcpyExamples/outputs/slope.tif")