projectOrNull

fun <T : Geometry> projectOrNull(geometry: T, spatialReference: SpatialReference): T?

Projects the given geometry from its current spatial reference system into the given spatial reference system. A default best-choice DatumTransformation is applied to the project operation. To control the specific transformation used, use the GeometryEngine.project(Geometry, SpatialReference, DatumTransformation) overload.

If the geometry parameter has z-values then those z-values will also be transformed, providing the SpatialReference of that geometry, and the spatialReference parameter, both have a vertical coordinate system set.

Supports true curves. Projecting curves located at poles and coordinate system horizons using this API may give results that differ slightly from other ArcGIS software. This is because it uses a different geometry projection function.

Return

The geometry projected into the given SpatialReference. If the input geometry has a null SpatialReference, no projection occurs; instead, an identical geometry with the given SpatialReference is returned.

Since

200.1.0

Parameters

geometry

The geometry to be projected

spatialReference

The spatial reference to project the geometry into


fun <T : Geometry> projectOrNull(geometry: T, outputSpatialReference: SpatialReference, datumTransformation: DatumTransformation?): T?

Projects the given geometry from its current spatial reference system into the given output spatial reference system, applying the datum transformation provided. Use this overload to project a geometry if the difference between the input geometry's SpatialReference and the outputSpatialReference involves a change of datum, and you do not wish to use the default datum transformation used by GeometryEngine.project(Geometry, SpatialReference).

Supports true curves. Projecting curves located at poles and coordinate system horizons using this API may give results that differ slightly from other ArcGIS software because it uses a different geometry projection function.

Return

The geometry projected into the given SpatialReference. If the input geometry has a null SpatialReference, no projection occurs; instead, an identical geometry with the given SpatialReference is returned.

Since

200.1.0

Parameters

geometry

The geometry to be projected

spatialReference

The spatial reference to project the geometry into

datumTransformation

The datum transformation to apply