UNPKG

@arcgis/core

Version:

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

119 lines (117 loc) 5.58 kB
import type Point from "../geometry/Point.js"; import type { FeatureReference } from "./types.js"; import type { Clonable } from "../core/Clonable.js"; import type { JSONSupportMixin } from "../core/JSONSupport.js"; import type { PointProperties } from "../geometry/Point.js"; export interface ViewshedProperties extends Partial<Pick<Viewshed, "farDistance" | "feature" | "heading" | "horizontalFieldOfView" | "tilt" | "verticalFieldOfView">> { /** A [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/) specifying the position the viewshed is calculated from. */ observer?: PointProperties | null; } /** * Viewshed defines the geometry for a viewshed analysis. * The viewshed is determined by a position, distance, orientation (defined by heading and tilt), * and field of view angles. * * * ```js * const viewshed = new Viewshed({ * observer: new Point({ * spatialReference: { * latestWkid: 3857, * wkid: 102100 * }, * x: -9754426, * y: 5143111, * z: 330 * }), * farDistance: 900, * heading: 64, * tilt: 84, * horizontalFieldOfView: 85, * verticalFieldOfView: 52 * }); * const viewshedAnalysis = new ViewshedAnalysis({ * viewsheds: [viewshed], * }); * * // add the analysis to the view * view.analyses.add(viewshedAnalysis); * ``` * * To create a view dome, set [horizontalFieldOfView](https://developers.arcgis.com/javascript/latest/references/core/analysis/Viewshed/#horizontalFieldOfView) to 360, and [verticalFieldOfView](https://developers.arcgis.com/javascript/latest/references/core/analysis/Viewshed/#verticalFieldOfView) to 180. * * > [!WARNING] * > * > Note that when placing viewsheds interactively, the viewshed is created with a 1.5 meter vertical offset from the scene. * > _This behavior is subject to change in a future release._ * * @since 4.30 * @see [ViewshedLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ViewshedLayer/) * @see [ViewshedAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/ViewshedAnalysis/) * @see [Sample - Interactive viewshed analysis](https://developers.arcgis.com/javascript/latest/sample-code/analysis-viewshed/) * @see [Sample - ViewshedLayer in slides](https://developers.arcgis.com/javascript/latest/sample-code/layers-viewshed/) * @see [Sample - Analysis objects](https://developers.arcgis.com/javascript/latest/sample-code/analysis-objects/) * @see [3D viewshed overview](https://developers.arcgis.com/documentation/spatial-analysis-services/3d-visual/3d-viewshed/) */ export default class Viewshed extends ViewshedSuperclass { constructor(properties?: ViewshedProperties); /** * The maximum distance from the observer in which to perform the viewshed analysis (in meters). * * @default 1000 */ accessor farDistance: number; /** * References a feature from which the observer is internally offset, provided that its geometry faces are close enough to the observer. * It is used to ensure that the analysis results remain independent of changes in the level of detail (LOD) of this feature's geometry. * * When creating viewsheds interactively, this property is populated automatically. * * Note that you can assign client side graphics which will be taken into account accordingly. However, information about * client side [graphics](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) will not be persisted and results in an empty reference after de-serialization. * * @since 4.31 */ accessor feature: FeatureReference | null | undefined; /** * The compass heading of the observer's view direction (in degrees). * A heading of zero points the viewshed to north and it increases as the viewshed rotates clockwise. * * @default 0 */ accessor heading: number; /** * The horizontal field of view (FOV) angle defines the width of the scope being analyzed (in degrees). * A value of 360 means the observer's horizontal FOV captures their entire surroundings. * Values closer to 0 narrow the horizontal FOV in the direction of the heading. * * @default 45 */ accessor horizontalFieldOfView: number; /** A [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/) specifying the position the viewshed is calculated from. */ get observer(): Point | null | undefined; set observer(value: PointProperties | null | undefined); /** * The tilt of the observer's view direction (in degrees). * A tilt of zero points the viewshed looking straight down and 90 degrees points it looking parallel to the surface. * * @default 90 */ accessor tilt: number; /** * Indicates whether the viewshed is ready to be computed and interacted with in the view. * It requires the [observer](https://developers.arcgis.com/javascript/latest/references/core/analysis/Viewshed/#observer) to be set and have a position, and the [farDistance](https://developers.arcgis.com/javascript/latest/references/core/analysis/Viewshed/#farDistance) to be * greater than 0. * * @since 4.33 */ get valid(): boolean; /** * The vertical field of view (FOV) angle defines the height of the scope being analyzed (in degrees). * This value can vary from 0 to 180. Values closer to 0 narrow the vertical FOV in the direction of the tilt. * * @default 45 */ accessor verticalFieldOfView: number; } declare const ViewshedSuperclass: typeof Clonable & typeof JSONSupportMixin