/** * Transforms 2D geometry segment end points and interior points, thus preserving the geographic location of the segment interior and more accurately maintaining its original shape. * A maximum offset deviation parameter controls how much the result of the projection is allowed to deviate from the true preserved shape. * * Projecting your data between coordinate systems sometimes requires transforming * between geographic coordinate systems. Geographic transformations are used * to transform coordinates between spatial references that have different geographic * coordinate systems, and thus different datums. * Using the most suitable transformation ensures the best possible accuracy when * converting geometries from one spatial reference to another. * * The `geographicTransformationUtils` module provides the [getTransformation()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/support/geographicTransformationUtils/#getTransformation) and * [getTransformations()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/support/geographicTransformationUtils/#getTransformations) methods which return the default geographic transformation * for the given projection or a list of suitable geographic transformations. * * > [!WARNING] * > * > **Known Limitations** * > * > * This operator currently only supports [equation-based geographic transformations](https://developers.arcgis.com/rest/services-reference/enterprise/using-spatial-references/#transformation-pdfs). * > * Grid-based transformations are not supported. * > * Vertical coordinate system projections are not supported. * > * The result geometry is not guaranteed to be simple. Apply the [simplifyOperator](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/simplifyOperator/) to ensure the result is topologically simple. * > * Projecting an Extent may return an Extent with a larger area than the input. * > * Curves are not supported. * * > [!WARNING] * > * > **Notes** * > * > Verify that `isLoaded()` returns `true` before using this module. * > Use `load()` to load this module's dependencies. * * @since 4.32 * @see [projectOperator](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/projectOperator/) * @see [Spatial References](https://developers.arcgis.com/documentation/spatial-references/) * @see [Coordinate systems, map projections, and transformations](https://pro.arcgis.com/en/pro-app/latest/help/mapping/properties/coordinate-systems-and-projections.htm) * @see [Geographic datum transformations](https://pro.arcgis.com/en/pro-app/latest/help/mapping/properties/geographic-coordinate-system-transformation.htm) */ import type Extent from "../Extent.js"; import type SpatialReference from "../SpatialReference.js"; import type GeographicTransformation from "./support/GeographicTransformation.js"; import type { GeometryUnion, GeometryWithoutMeshUnion } from "../types.js"; /** @since 5.2 */ export interface ShapePreservingProjectOptions { /** * An extent used to help pick the correct transform. * This is not used if the `geographicTransformation` option is provided. * The extent's spatial reference should be the same as the `geometries` spatial reference. */ areaOfInterestExtent?: Extent; /** * The equation-based geographic transformation used to transform the geometries. * Grid-based transformations are not supported. */ geographicTransformation?: GeographicTransformation; /** * Controls how much the result of the projection is allowed to deviate from the true preserved shape. * The default setting of 0 represents 100 * output tolerance. * * @default 0 */ maxDeviationInSrTo?: number; /** * A lower bound controlling the densification in the input coordinate system. * The default setting of 0 represents 1e-5 degrees. If the input coordinate system is a projected coordinate system, then this value is translated to length in linear units at the equator. * * @default 0 */ minSegmentLengthInDegrees?: number; } /** * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [ShapePreservingProjectOptions](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/shapePreservingProjectOperator/#ShapePreservingProjectOptions). */ export type Options = ShapePreservingProjectOptions; /** * Indicates if all dependencies of this module have been loaded. * * @returns Returns `true` if this module's dependencies have been loaded. * @since 5.2 */ export function shapePreservingProjectIsLoaded(): boolean; /** * Indicates if all dependencies of this module have been loaded. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [shapePreservingProjectIsLoaded()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/shapePreservingProjectOperator/#shapePreservingProjectIsLoaded). * @returns Returns `true` if this module's dependencies have been loaded. */ export function isLoaded(): boolean; /** * Loads this module's dependencies. This method must be called first if `shapePreservingProjectIsLoaded` returns `false`. * * @returns Resolves when the dependencies have been loaded. * @since 5.2 * @see [shapePreservingProjectIsLoaded()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/shapePreservingProjectOperator/#shapePreservingProjectIsLoaded) */ export function shapePreservingProjectLoad(): Promise; /** * Loads this module's dependencies. This method must be called first if `isLoaded` returns `false`. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [shapePreservingProjectLoad()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/shapePreservingProjectOperator/#shapePreservingProjectLoad). * @returns Resolves when the dependencies have been loaded. * @see [isLoaded()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/shapePreservingProjectOperator/#isLoaded) */ export function load(): Promise; /** * Performs the shape preserving project operation on a single geometry. * * @param geometry - The geometry to be projected. * @param outSpatialReference - The spatial reference to which the input geometry is projected. * @param options - Additional options. * @returns The projected geometry or null. * @since 5.2 * @example * if (!shapePreservingProjectIsLoaded()) { * await shapePreservingProjectLoad(); * } * * // Project a geometry to a different spatial reference while preserving its shape. * const geometry = shapePreservingProjectExecute(polyline, spatialReference); */ export function shapePreservingProjectExecute(geometry: GeometryUnion, outSpatialReference: SpatialReference, options?: ShapePreservingProjectOptions): GeometryWithoutMeshUnion | null | undefined; /** * Performs the shape preserving project operation on a single geometry. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [shapePreservingProjectExecute()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/shapePreservingProjectOperator/#shapePreservingProjectExecute). * @param geometry - The geometry to be projected. * @param outSpatialReference - The spatial reference to which the input geometry is projected. * @param options - Additional options. * @returns The projected geometry or null. * @example * if (!shapePreservingProjectIsLoaded()) { * await shapePreservingProjectLoad(); * } * * // Project a geometry to a different spatial reference while preserving its shape. * const geometry = shapePreservingProjectExecute(polyline, spatialReference); */ export function execute(geometry: GeometryUnion, outSpatialReference: SpatialReference, options?: ShapePreservingProjectOptions): GeometryWithoutMeshUnion | null | undefined; /** * Performs the shape preserving project operation on multiple geometries. * * @param geometries - The geometries to be projected. * All the geometries must have the same spatial reference. * @param outSpatialReference - The spatial reference to which the input geometries are projected. * @param options - Additional options. * @returns Returns an array of projected geometries, and individual entries may be `null` or `undefined`. * @since 5.2 */ export function shapePreservingProjectExecuteMany(geometries: GeometryUnion[], outSpatialReference: SpatialReference, options?: ShapePreservingProjectOptions): (GeometryWithoutMeshUnion | null | undefined)[]; /** * Performs the shape preserving project operation on multiple geometries. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [shapePreservingProjectExecuteMany()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/shapePreservingProjectOperator/#shapePreservingProjectExecuteMany). * @param geometries - The geometries to be projected. * All the geometries must have the same spatial reference. * @param outSpatialReference - The spatial reference to which the input geometries are projected. * @param options - Additional options. * @returns Returns an array of projected geometries, and individual entries may be `null` or `undefined`. */ export function executeMany(geometries: GeometryUnion[], outSpatialReference: SpatialReference, options?: ShapePreservingProjectOptions): (GeometryWithoutMeshUnion | null | undefined)[]; /** * Indicates if the operator supports input geometries that contain curves. * The value is `null` or `undefined` until the operator is loaded, then it will always be `false`. * * @since 5.2 */ export const shapePreservingProjectSupportsCurves: boolean | null | undefined; /** * Indicates if the operator supports input geometries that contain curves. * The value is `null` or `undefined` until the operator is loaded, then it will always be `false`. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [shapePreservingProjectSupportsCurves](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/shapePreservingProjectOperator/#shapePreservingProjectSupportsCurves). */ export const supportsCurves: boolean | null | undefined;