Hillshade

摘要

通过考虑光源位置和阴影来创建表面的灰度 3D 制图表达的栅格对象。

说明

有关此函数工作原理的详细信息,请参阅山体阴影栅格函数。

栅格对象所引用的栅格数据集是临时性的。 要将其设置为永久,可以调用栅格对象的 save 方法。

语法

Hillshade (dem, {azimuth}, {altitude}, {z_factor}, {slope_type}, {ps_power}, {psz_factor}, {remove_edge_effect}, {hillshade_type})
参数说明数据类型
dem

The input elevation raster.

Raster
azimuth

方位角是太阳沿地平线的相对位置(以度为单位)。此位置由从正北方向开始按顺时针进行测量的太阳角度指示。0 度方位角表示北,东为 90 度,南为 180 度,西为 270 度。

此参数仅在 hillshade_type 参数设置为 TRADITIONAL 时有效。默认方位角为西北方向 315 度。

(默认值为 315)

Double
altitude

高度角是在地平线之上的太阳高程角,它的范围为 0 至 90 度。0 度值表示太阳位于地平线上,即,与参考框架位于同一水平面中。90 度值表示太阳处于头顶正上方。

此参数仅在 hillshade_type 参数设置为 TRADITIONAL 时有效。

(默认值为 45)

Double
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.

(默认值为 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, PERCENTRISE, or SCALED. For more information, see Slope function.

Integer
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 z-factor changes to avoid significant loss of relief.

This parameter is only valid when slope_type is SCALED.

(默认值为 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 z-factor changes.

This parameter is only valid when slope_type is SCALED.

(默认值为 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—Bilinear resampling will be applied uniformly to resample the output.
  • True—Bilinear resampling will be used to resample the output, except along the edges of the rasters or next to pixels of NoData. These pixels will be populated with NoData. This will reduce any sharp edge effects that may otherwise occur.

(默认值为 False)

Boolean
hillshade_type

用于控制山体阴影的光源。

  • 0从单一光线方向计算山体阴影。可以设置 azimuthaltitude 参数以控制光源的位置。
  • 1可将多个源的光线进行融合,以增强地形的可视化效果。

(默认值为 0)

Integer
返回值
数据类型说明
Raster

输出栅格。

代码示例

Hillshade 示例 1

本示例将计算给定高程的山体阴影。

from arcpy.ia import *
out_hillshade_raster = Hillshade("elevation.tif", 180, 75, 0.3048)
out_hillshade_raster.save("C:/arcpyExamples/outputs/hillshade.tif")
Hillshade 示例 2

本示例将计算给定高程的山体阴影。

# 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"

# Execute the Hillshade function
out_hillshade_raster = Hillshade(in_dem, 180, 75, 0.3048)

# Save the output
out_hillshade_raster.save("C:/arcpyExamples/outputs/hillshade.tif")