Render

AllSource 1.3    |

摘要

通过将符号系统应用于引用的栅格数据集来创建渲染的栅格对象。 在 Jupyter 笔记本中显示数据时,此函数很有用。

说明

使用 Render 函数修改栅格对象的显示以改进符号系统。 在使用 Jupyter Notebook 工作时,此函数很有用,因为数据显示对 Notebook 环境至关重要。

该函数可创建应用了渲染规则或色彩映射表的栅格对象。 必须至少指定一个渲染规则或色彩映射表。

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

生成的栅格数据集将包含已应用该函数的渲染规则。

语法

Render (in_raster, {rendering_rule}, {colormap})
参数说明数据类型
in_raster

The input raster dataset.

Raster
rendering_rule

The rendering rules to apply to the input raster. If a color map is not specified, a rendering rule must be specified.

The rendering rules can use one or more of the following formats:

  • bands—A list of band indexes to be mapped to an RGB display.

    For example, to create a natural color composite for Landsat 8 imagery, where band 4 is displayed as red, band 3 as green, and band 2 as blue, use {'bands': [4, 3, 2]}.

  • min and max—A range of values to use to perform a linear stretch on the raster. The minimum and maximum values are used as endpoints for the histogram stretch, and they can be single inputs or a list of values, one pair per band.

    For example, to perform a linear stretch from pixel value 0 to 100 for a single-band raster, use {'min': 0, 'max': 100}. To perform a linear stretch on a three-band image where each will stretch from a pixel value of 0 to different maximum pixel values, use {'min': 0, 'max': [220,210,180]}.

  • numberOfStandardDeviations—A single value that describes the number of standard deviations to use for a linear stretch. The stretch will be applied between minimum and maximum pixel values defined by the number of standard deviations from the mean.

    For example, to perform a linear stretch that removes any pixel values beyond two standard deviations from the mean, use {'numberOfStandardDeviations': 2}.

  • gamma—A single value or a list of values (one per band) that defines the amount of gamma correction to apply to control the overall brightness of the raster display. Gamma can also impact the ratios of red to green to blue in the display.

    For example, to perform a gamma stretch of 0.5, use {'gamma': 0.5}. To perform various gamma stretches on a three-band raster, use {'gamma': [0.5, 2, 1.5]}.

  • rft—A path to a raster function template (.rft.xml) where the stretch is defined by a raster function chain; for example, {'rft': r"C:\StretchFunctions\Remap_and_Stretch.rft.xml"}.

Dictionary
colormap

Defines the colors to use for rendering. If a rendering rule is not specified, a color map must be specified.

The parameter must use one of the following formats:

  • The name of a color map or color scheme that is supported in ArcGIS AllSource; for example, colormap="Red to Green". For a full list of supported color schemes, download the ArcGIS_Pro_ColorSchemes.pdf PDF document.
  • A list of hex color codes, named colors, or both. There are 16 supported named colors:
    • aqua
    • black
    • blue
    • fuchsia
    • gray
    • green
    • lime
    • maroon
    • navy
    • olive
    • purple
    • red
    • silver
    • teal
    • white
    • yellow

    For example, ["#B0C4DE", "blue", "navy"].

  • A dictionary with the following key value pairs:
    • "values": [<pixel_value1>, <pixel_value2>, ... ]
    • "colors": ["<color1>", "<color2", ... ]
    • "labels": ["<label1>", "<label2>", ... ]

    For example, {"values": [11, 21, 30], "colors": ["#B0C4DE", "green", "gray"], "labels": ["water", "vegetation", "urban"]}

String
返回值
数据类型说明
Raster

输出已渲染栅格对象。


在本主题中