摘要
通过合并由高程编码和山体阴影方法生成的影像来创建 terrain 的彩色 3D 制图表达。
语法
ShadedRelief (raster, azimuth, altitude, {z_factor}, {colormap}, {colorramp}, {slope_type}, {ps_power}, {psz_factor}, {remove_edge_effect})
参数 | 说明 | 数据类型 |
raster | 输入 DEM。 | Raster |
azimuth | 方位角是太阳沿地平线的相对位置(以度为单位)。此位置由从正北方向开始按顺时针进行测量的太阳角度指示。0 度方位角表示北,东为 90 度,南为 180 度,西为 270 度。 (默认值为 315) | Double |
altitude | 高度角是在地平线之上的太阳高程角,它的范围为 0 至 90 度。0 度值表示太阳位于地平线上,即,与参考框架位于同一水平面中。90 度值表示太阳处于头顶正上方。 (默认值为 45) | Double |
z_factor | The z-factor is a scaling factor used to convert the elevation values for two purposes:
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 |
colormap [colormap,...] | 用于渲染栅格的色彩映射表。可以列表或字典的形式提供。 (默认值为 None) | List |
colorramp | 色带的名称。可以字符串形式提供,该字符串指定了 ArcGIS Pro 中支持的色带名称,例如 Yellow to Red 或 Slope。也可以字典的形式提供。有关详细信息,请参阅色带对象。 (默认值为 Elevation #1) | String |
slope_type | The inclination of slope can be output as either a value in degrees, or percent rise. Specify one of the following: DEGREE, PERCENTRISE, or SCALED. For more information, see Slope function. (默认值为 DEGREE) | String |
ps_power | Pixel Size 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 z-factor changes to avoid significant loss of relief. This parameter is only valid when the slope_type is SCALED. (默认值为 0.664) | Double |
psz_factor | Pixel Size Factor accounts for changes in scale as the viewer zooms in and out on the map display. It controls the rate at which the z-factor changes. This parameter is only valid when the slope_type is SCALED. (默认值为 0.024) | Double |
remove_edge_effect |
Using this option will avoid any resampling artifacts that may occur along the edges of a raster. The output pixels along the edge of a raster or beside pixels without a value will be populated with NoData; therefore, it is recommended that this option be used 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 | 输出栅格。 |
代码示例
本示例创建了一个地貌晕渲:
# Import system modules
import arcpy
from arcpy.ia import *
# Set environment settings
env.workspace = "C:/data"
# input raster
inRasters= = "input_raster.tif"
# use built-in colorramp slope
colorramp_name = "Slope"
# Execute arcpy.ia.ShadedRelief
shadedRelief = ShadedRelief(imagePath1, azimuth=315, altitude=45, z_factor=1, colorramp=colorramp_name, slope_type = "SCALED",
ps_power=0.664, psz_factor=0.024, remove_edge_effect=False)
shadedRelief.save("C:/output/shadedrelief_output2.tif")
本示例创建了一个地貌晕渲:
# Import system modules
import arcpy
from arcpy.ia import *
import random
# Set environment settings
env.workspace = "C:/data"
# input raster
inRasters= = "input_raster.tif"
# generate a color map list
color_map = []
for i in range(1, 255):
# generate random color
red = random.randrange(0, 256)
green = random.randrange(0, 256)
blue = random.randrange(0, 256)
value = i
color_map.append([value, red, green, blue])
# Execute Sample
shadedRelief = ShadedRelief(imagePath1, azimuth=315, altitude=45, z_factor=1, colormap=315, slope_type = "DEGREE")
shadedRelief.save("C:/output/shadedrelief_output.tif")