ShadedRelief

摘要

通过合并由高程编码和山体阴影方法生成的影像来创建 terrain 的彩色 3D 制图表达。

说明

有关此函数工作原理的详细信息,请参阅晕渲地貌栅格函数。

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

语法

ShadedRelief (raster, azimuth, altitude, {z_factor}, {colormap}, {colorramp}, {slope_type}, {ps_power}, {psz_factor}, {remove_edge_effect})
参数说明数据类型
raster

The input DEM.

Raster
azimuth

Azimuth is the sun's relative position along the horizon (in degrees). This position is indicated by the angle of the sun measured clockwise from due north. An azimuth of 0 degrees indicates north, east is 90 degrees, south is 180 degrees, and west is 270 degrees.

(默认值为 315)

Double
altitude

Altitude is the sun's angle of elevation above the horizon and ranges from 0 to 90 degrees. A value of 0 degrees indicates that the sun is on the horizon, that is, on the same horizontal plane as the frame of reference. A value of 90 degrees indicates that the sun is directly overhead.

(默认值为 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
colormap
[colormap,...]

The color map used to render the raster. This can be provided as a list or dictionary.

(默认值为 None)

List
colorramp

The name of the color ramp. This can be provided as a string specifying a color ramp name supported in ArcGIS Pro, such as Yellow to Red, or Slope. This can also be provided as a dictionary. For more information, see Color ramp objects.

(默认值为 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

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
返回值
数据类型说明
Raster

输出栅格。

代码示例

ShadedRelief 示例 1

本示例创建了一个地貌晕渲:

# Import system modules
import arcpy
from arcpy.sa import *

# Set environment settings
env.workspace = "C:/data"

# input raster
inRasters= = "input_raster.tif"

# use built-in colorramp slope
colorramp_name = "Slope"

# Execute arcpy.sa.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")
ShadedRelief 示例 2

本示例创建了一个地貌晕渲:

# Import system modules
import arcpy
from arcpy.sa 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")

相关主题