import type Extent from "./Extent.js"; import type SpatialReference from "./SpatialReference.js"; import type { JSONSupport } from "../core/JSONSupport.js"; import type { SpatialReferenceProperties } from "./SpatialReference.js"; export interface GeometryProperties extends Partial> { /** * The spatial reference of the geometry. * * @default SpatialReference.WGS84 // wkid: 4326 */ spatialReference?: SpatialReferenceProperties; } /** * The base class for geometry objects. * This class has no constructor. To construct geometries see [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/), * [Polyline](https://developers.arcgis.com/javascript/latest/references/core/geometry/Polyline/), or [Polygon](https://developers.arcgis.com/javascript/latest/references/core/geometry/Polygon/). * * @since 4.0 * @see [Graphic](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) */ export default abstract class Geometry extends JSONSupport { /** * The cache is used to store values computed from geometries that need to be cleared or recomputed upon mutation. * An example is the extent of a polygon. */ get cache(): Record; /** The extent of the geometry. For a point, the extent is null. */ get extent(): Extent | null | undefined; /** * Indicates if the geometry has m-values (measure). M-values allow attribute values to be stored with the geometry. * - `true`: The geometry is m aware. M-values are part of the geometry coordinates. * - `false`: The geometry is not m aware. M-values are not part of the coordinates. * * @default false * @see [Point.m](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/#m) for more information on how m-values are represented in geometries. * @see [returnM](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/FeatureLayerBase/#returnM) for details regarding fetching m-values with features from a layer * @see [Linear referencing](https://pro.arcgis.com/en/pro-app/latest/help/data/linear-referencing/introduction-to-linear-referencing.htm) */ accessor hasM: boolean; /** * Indicates if the geometry has z-values (elevation). * - `true`: The geometry is z aware. Z-values are part of the geometry coordinates. * - `false`: The geometry is not z aware. Z-values are not part of the coordinates. * * @default false * @see [Point.z](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/#z) for more information on how z-values are represented in geometries * @see [returnZ](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/FeatureLayerBase/#returnZ) for details regarding fetching z-values with features from a layer */ accessor hasZ: boolean; /** * The spatial reference of the geometry. * * @default SpatialReference.WGS84 // wkid: 4326 */ get spatialReference(): SpatialReference; set spatialReference(value: SpatialReferenceProperties); /** The geometry type. */ get type(): "point" | "multipoint" | "polyline" | "polygon" | "extent" | "mesh"; /** * Creates a deep clone of the geometry. * * @returns A new instance of a Geometry object equal to the object used to call `.clone()`. */ clone(): Geometry; }