UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

110 lines (108 loc) 7.33 kB
import type ColorRamp from "../rest/support/ColorRamp.js"; import type { JSONSupport } from "../core/JSONSupport.js"; import type { HillshadeType } from "./support/raster/types.js"; import type { ColorRampProperties } from "../rest/support/ColorRamp.js"; export interface RasterShadedReliefRendererProperties extends Partial<Pick<RasterShadedReliefRenderer, "altitude" | "azimuth" | "hillshadeType" | "pixelSizeFactor" | "pixelSizePower" | "scalingType" | "zFactor">> { /** The color ramp to display the shaded relief. By default, the grayscale is applied. */ colorRamp?: ColorRampProperties | null; } /** * RasterShadedReliefRenderer produces a grayscale or colored 3D representation of the surface on an [ImageryLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ImageryLayer/) * or [ImageryTileLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ImageryTileLayer/), with the sun's relative position taken into account * for shading the image. This renderer uses the [altitude](https://developers.arcgis.com/javascript/latest/references/core/renderers/RasterShadedReliefRenderer/#altitude) and [azimuth](https://developers.arcgis.com/javascript/latest/references/core/renderers/RasterShadedReliefRenderer/#azimuth) properties to specify the sun's position. * By default, a grayscale color ramp is used to display a hillshade elevation model. * * This renderer uses a hillshading technique for visualizing terrain determined by a light source and the slope and aspect of the elevation * surface. It is a qualitative method for visualizing topography and does not give absolute elevation values. This renderer provides two * options for generating [hillshades](https://developers.arcgis.com/javascript/latest/references/core/renderers/RasterShadedReliefRenderer/#hillshadeType): `traditional` and `multi-directional`. * The following images display an elevation model using the traditional hillshade type, followed by the `multi-directional` hillshade type. * * Traditional | Multi-directional | * ----------- | ----------------- | * <img alt="Undo update" src="https://developers.arcgis.com/javascript/latest/assets/references/core/renderers/renderer-shadedRelief-traditional.png">|<img alt="Undo update" src="https://developers.arcgis.com/javascript/latest/assets/references/core/renderers/renderer-shadedRelief-multidirectional.png">| * * @since 4.16 * @see [Hillshade function](https://pro.arcgis.com/en/pro-app/latest/help/data/imagery/hillshade-function.htm) * @see [Shaded relief function](https://pro.arcgis.com/en/pro-app/latest/help/data/imagery/shaded-relief-function.htm) */ export default class RasterShadedReliefRenderer extends JSONSupport { constructor(properties?: RasterShadedReliefRendererProperties); /** * The sun's angle of elevation above the horizon, ranging 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. * * @default 45 */ accessor altitude: number; /** * The sun's relative position along the horizon, ranging from 0 to 360 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. * * @default 315 */ accessor azimuth: number; /** The color ramp to display the shaded relief. By default, the grayscale is applied. */ get colorRamp(): ColorRamp | null | undefined; set colorRamp(value: ColorRampProperties | null | undefined); /** * The type of hillshading being applied on the elevation surface. * * Value | Description | * ----- | ----------- | * traditional | Calculates the hillshade using an illumination source from one direction using the altitude and azimuth properties to specify the sun's position. * multi-directional | Combines light from multiple sources to represent the hillshaded terrain. The advantage of the multidirectional hillshade method is that more detail is displayed in areas typically affected by over saturation and deep shadows than when using the traditional hillshade method. * * @default "traditional" */ accessor hillshadeType: HillshadeType; /** * 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 [scalingType](https://developers.arcgis.com/javascript/latest/references/core/renderers/RasterShadedReliefRenderer/#scalingType) is `adjusted`. * * @default 0.024 */ accessor pixelSizeFactor: number; /** * 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 [scalingType](https://developers.arcgis.com/javascript/latest/references/core/renderers/RasterShadedReliefRenderer/#scalingType) is `adjusted`. * * @default 0.664 */ accessor pixelSizePower: number; /** * Applies a constant or adjusted z-factor based on resolution changes. * The shaded result is scaled dynamically by adjusting the z-factor using one of two options. * * **Possible Values** * * Value | Description | * ----- | ----------- | * none | No scaling is applied. This is ideal for a single raster dataset covering a local area. This is not recommended for worldwide datasets with large variations in elevation or multi scale maps, as it will produce terrain relief with little variation at small scales. * adjusted | A nonlinear adjustment is applied using the [pixelSizePower](https://developers.arcgis.com/javascript/latest/references/core/renderers/RasterShadedReliefRenderer/#pixelSizePower) and [pixelSizeFactor](https://developers.arcgis.com/javascript/latest/references/core/renderers/RasterShadedReliefRenderer/#pixelSizeFactor) values, which accommodate a wide variety of altitude changes (scale) as the viewer zooms in and out. The Adjusted option is recommended when using a worldwide dataset. * * @default "none" */ accessor scalingType: "none" | "adjusted"; /** The type of Renderer. */ get type(): "raster-shaded-relief"; /** * A ratio of z unit / xy unit, with optional exaggeration factored in. * If the units for the z (elevation) units are the same as the x,y (linear) units, then the z conversion factor is 1. * If your dataset is using a projected coordinate system and your elevation and linear units are different, * then you will need to define a z conversion factor to account for the difference. * * @default 1 */ accessor zFactor: number; /** * Creates a deep clone of the renderer. * * @returns A deep clone of the object that * invoked this method. * @example * // Creates a deep clone of the first layer's renderer * let renderer = view.map.layers.at(0).renderer.clone(); */ clone(): RasterShadedReliefRenderer; }