shapePreservingProjectOperator

AMD: require(["esri/geometry/operators/shapePreservingProjectOperator"], (shapePreservingProjectOperator) => { /* code goes here */ });
ESM: import * as shapePreservingProjectOperator from "@arcgis/core/geometry/operators/shapePreservingProjectOperator.js";
Object: esri/geometry/operators/shapePreservingProjectOperator
Since: ArcGIS Maps SDK for JavaScript 4.32

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() and getTransformations() methods which return the default geographic transformation for the given projection or a list of suitable geographic transformations.

Notes

  • Verify that isLoaded() returns true before using this module.
  • Use load() to load this module's dependencies.

Property Overview

Name Type Summary Object

Indicates if the operator supports input geometries that contain curves.

shapePreservingProjectOperator

Property Details

supportsCurves

Property
supportsCurves Boolean |null |undefinedreadonly

Indicates if the operator supports input geometries that contain curves.

Default Value:false

Method Overview

Name Return Type Summary Object

Performs the shape preserving project operation on a single geometry.

shapePreservingProjectOperator

Performs the shape preserving project operation on multiple geometries.

shapePreservingProjectOperator

Indicates if all dependencies of this module have been loaded.

shapePreservingProjectOperator
Promise

Loads this module's dependencies.

shapePreservingProjectOperator

Method Details

execute

Method
execute(geometry, outSpatialReference, options){GeometryUnion}

Performs the shape preserving project operation on a single geometry.

Parameters
Specification
geometry GeometryUnion

The geometry to be projected.

outSpatialReference SpatialReference

The spatial reference to which the input geometry is projected.

options Object
optional

Additional options.

Specification
areaOfInterestExtent Extent
optional

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 spatial reference of the input geometry.

geographicTransformation GeographicTransformation
optional

The geographic transformation to use in the projection.

minSegmentLengthInDegrees Number
optional
Default Value: 0

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.

maxDeviationInSrTo Number
optional
Default Value: 0

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.

Returns
Type Description
GeometryUnion The projected geometry.
Example
if (!shapePreservingProjectOperator.isLoaded()) {
  await shapePreservingProjectOperator.load();
}

// Project a geometry to a different spatial reference while preserving its shape.
const geometry = shapePreservingProjectOperator.execute(polyline, spatialReference);

executeMany

Method
executeMany(geometries, outSpatialReference, options){GeometryUnion[]}

Performs the shape preserving project operation on multiple geometries.

Parameters
Specification
geometries GeometryUnion[]

The geometries to be projected. All the geometries must have the same spatial reference.

outSpatialReference SpatialReference

The spatial reference to which the input geometries are projected.

options Object
optional

Additional options.

Specification
areaOfInterestExtent Extent
optional

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.

geographicTransformation GeographicTransformation
optional

The geographic transformation to use in the projections.

minSegmentLengthInDegrees Number
optional
Default Value: 0

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.

maxDeviationInSrTo Number
optional
Default Value: 0

Controls how much the result of the projectios are allowed to deviate from the true preserved shape. The default setting of 0 represents 100 * output tolerance.

Returns
Type Description
GeometryUnion[] Returns the projected geometries.

isLoaded

Method
isLoaded(){Boolean}

Indicates if all dependencies of this module have been loaded.

Returns
Type Description
Boolean Returns true if this module's dependencies have been loaded.

load

Method
load(){Promise}

Loads this module's dependencies. This method must be called first if isLoaded returns false.

Returns
Type Description
Promise Resolves when the dependencies have been loaded.
See also

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close