projectOperator

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

Projects 2D geometries from one SpatialReference to another. You can specify a geographic (datum) transformation for this operation, accept the default transformation if one is needed, or set the area of interest.

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

Known Limitations

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.

projectOperator

Property Details

supportsCurves

Property
supportsCurves Boolean |null |undefinedreadonly

Indicates if the operator supports input geometries that contain curves. This will produce densified output geometries.

Default Value:true

Method Overview

Name Return Type Summary Object

Projects a geometry to the specified output spatial reference.

projectOperator

Projects an array of geometries to the specified output spatial reference.

projectOperator

Indicates if all dependencies of this module have been loaded.

projectOperator
Promise

Loads this module's dependencies.

projectOperator

Method Details

execute

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

Projects a geometry to the specified output spatial reference.

Parameters
Specification
geometry GeometryUnion

The geometry to project.

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 used to transform the geometries. Specify this parameter to project a geometry when the default transformation is not appropriate for your requirements.

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

const outSpatialReference = new SpatialReference({
  wkid: 53008 //Sphere_Sinusoidal projection
});

// Project a geometry to a different spatial reference
const geometry = projectOperator.execute(polygon, outSpatialReference);

executeMany

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

Projects an array of geometries to the specified output spatial reference.

Parameters
Specification
geometries GeometryUnion[]

An array of geometries to project. All the geometries must have the same spatial reference.

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 geometries spatial reference.

geographicTransformation GeographicTransformation
optional

The geographic transformation used to transform the geometries. Specify this parameter to project a geometry when the default transformation is not appropriate for your requirements.

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