Skip To Content ArcGIS for Developers Sign In Dashboard

TransformationCatalog Class

class Esri::ArcGISRuntime::TransformationCatalog

A class for discovering and managing transformations. More...

Header: #include <TransformationCatalog>
Since: Esri::ArcGISRuntime 100.2
Inherits: Esri::ArcGISRuntime::Object

This class was introduced in Esri::ArcGISRuntime 100.2.

Public Functions

virtual ~TransformationCatalog() override

Static Public Members

Esri::ArcGISRuntime::TransformationCatalog *instance()
QString projectionEngineDirectory()
void setProjectionEngineDirectory(const QString &projectionEngineDirectory)
Esri::ArcGISRuntime::DatumTransformation *transformation(const Esri::ArcGISRuntime::SpatialReference &inputSpatialReference, const Esri::ArcGISRuntime::SpatialReference &outputSpatialReference)
Esri::ArcGISRuntime::DatumTransformation *transformation(const Esri::ArcGISRuntime::SpatialReference &inputSpatialReference, const Esri::ArcGISRuntime::SpatialReference &outputSpatialReference, const Esri::ArcGISRuntime::Envelope &areaOfInterest)
Esri::ArcGISRuntime::DatumTransformation *transformation(const Esri::ArcGISRuntime::SpatialReference &inputSpatialReference, const Esri::ArcGISRuntime::SpatialReference &outputSpatialReference, const Esri::ArcGISRuntime::Envelope &areaOfInterest, bool ignoreVertical)
QList<Esri::ArcGISRuntime::DatumTransformation *> transformationsBySuitability(const Esri::ArcGISRuntime::SpatialReference &inputSpatialReference, const Esri::ArcGISRuntime::SpatialReference &outputSpatialReference)
QList<Esri::ArcGISRuntime::DatumTransformation *> transformationsBySuitability(const Esri::ArcGISRuntime::SpatialReference &inputSpatialReference, const Esri::ArcGISRuntime::SpatialReference &outputSpatialReference, const Esri::ArcGISRuntime::Envelope &areaOfInterest)
QList<Esri::ArcGISRuntime::DatumTransformation *> transformationsBySuitability(const Esri::ArcGISRuntime::SpatialReference &inputSpatialReference, const Esri::ArcGISRuntime::SpatialReference &outputSpatialReference, const Esri::ArcGISRuntime::Envelope &areaOfInterest, bool ignoreVertical)

Detailed Description

The transformation catalog class provides a mechanism for discovering available DatumTransformation objects. You can retrieve the default transformation used internally by Runtime to convert coordinates, and find other available transformations. An area of interest may be taken into account.

This class also lets you set the location where Projection Engine data files needed for some transformations are found on local storage. The TransformationCatalog::projectionEngineDirectory property must be set before using any geometry classes.

Default transformations

The default transformation used when reprojecting geometries is the most suitable available transformation across the area covered by the input and output spatial references. You can sometimes get a more suitable transformation for work within a smaller area by specifying the extent of your specific work area, using TransformationCatalog::transformationsBySuitability(inputSpatialReference, outputSpatialReference, areaOfInterest).

Member Function Documentation

[override virtual] TransformationCatalog::~TransformationCatalog()

Destructor.

[static] Esri::ArcGISRuntime::TransformationCatalog *TransformationCatalog::instance()

Returns the singleton instance of the TransformationCatalog.

Use this method to get a reference to this instance so you can connect its signals to slots.

[static] QString TransformationCatalog::projectionEngineDirectory()

Returns the location where Projection Engine data files are found on the local file system.

See also setProjectionEngineDirectory.

[static] void TransformationCatalog::setProjectionEngineDirectory(const QString &projectionEngineDirectory)

Sets the location of Projection Engine files on the local file system to projectionEngineDirectory.

This property must be set immediately upon process startup before any other API method calls.

See also projectionEngineDirectory().

[static] Esri::ArcGISRuntime::DatumTransformation *TransformationCatalog::transformation(const Esri::ArcGISRuntime::SpatialReference &inputSpatialReference, const Esri::ArcGISRuntime::SpatialReference &outputSpatialReference)

Returns the default transformation used to transform between the input and output spatial references, without taking into account an area of interest.

Returns a DatumTransformation instance that represents the best choice given the parameters. Returns nullptr if no usable transformation is available for the given input parameters, or if no transformation is required.

The default transformation is the one used in cases such as when calling GeometryEngine::project without specifying a transformation.

See TransformationCatalog::transformation(inputSpatialReference, outputSpatialReference, areaOfInterest).

[static] Esri::ArcGISRuntime::DatumTransformation *TransformationCatalog::transformation(const Esri::ArcGISRuntime::SpatialReference &inputSpatialReference, const Esri::ArcGISRuntime::SpatialReference &outputSpatialReference, const Esri::ArcGISRuntime::Envelope &areaOfInterest)

Returns the default transformation used to transform between the input and output spatial references, taking into account the area of interest, if specified.

Returns nullptr if no usable transformation is available for the given input parameters, or if no transformation is required.

Geometry mapGeometry = GeometryEngine::project(geometry, map.getSpatialReference());
  • inputSpatialReference - The spatial reference to use as the input.
  • outputSpatialReference - The spatial reference to use as the output. is to.
  • areaOfInterest - The bounding box of coordinates to be transformed, or null to consider the entire world extent. If areaOfInterest is nullptr or if Geometry::isEmpty, the returned transformation does not take into account an area of interest, and the best choice for the entire world extent is effectively assumed. Otherwise, if areaOfInterest does not intersect the area of use of inputSpatialReference, this method returns nullptr.

If areaOfInterest has a different spatial reference than inputSpatialReference, it will be reprojected to inputSpatialReference. If areaOfInterest doesn't intersect the area of use of inputSpatialReference, this method returns nullptr.

[static] Esri::ArcGISRuntime::DatumTransformation *TransformationCatalog::transformation(const Esri::ArcGISRuntime::SpatialReference &inputSpatialReference, const Esri::ArcGISRuntime::SpatialReference &outputSpatialReference, const Esri::ArcGISRuntime::Envelope &areaOfInterest, bool ignoreVertical)

Returns the default transformation used to transform between the input and output spatial references, taking into account the area of interest, if specified. Optionally disregards any vertical transformations.

  • inputSpatialReference - The spatial reference to use as the input.
  • outputSpatialReference - The spatial reference to use as the output.
  • areaOfInterest - The bounding box of coordinates to be transformed, or nullptr to consider the entire world extent.
  • ignoreVertical - true if TransformationCatalog should ignore any vertical coordinate system set on the inputSpatialReference or outputSpatialReference, and only consider horizontal (geographic) transformations; false otherwise.

Use this method to determine whether or not any vertical coordinate systems set on the spatial reference parameters should be accounted for in the returned transformation. This method can be used to replicate the former (prior to version Esri::ArcGISRuntime 100.9) behavior of the TransformationCatalog::transformation(const Esri::ArcGISRuntime::SpatialReference&, const Esri::ArcGISRuntime::SpatialReference&) and TransformationCatalog::transformation(const Esri::ArcGISRuntime::SpatialReference&, const Esri::ArcGISRuntime::SpatialReference&, const Esri::ArcGISRuntime::Envelope&) methods:

Calling this method with `ignoreVertical == false` is equivalent to calling TransformationCatalog::transformation(const Esri::ArcGISRuntime::SpatialReference&, const Esri::ArcGISRuntime::SpatialReference&, const Esri::ArcGISRuntime::Envelope&). Calling this method with `ignoreVertical == true` is equivalent to calling TransformationCatalog::transformation(const Esri::ArcGISRuntime::SpatialReference&, const Esri::ArcGISRuntime::SpatialReference&, const Esri::ArcGISRuntime::Envelope&) in releases prior to Esri::ArcGISRuntime 100.9

This function was introduced in Esri::ArcGISRuntime 100.9.

[static] QList<Esri::ArcGISRuntime::DatumTransformation *> TransformationCatalog::transformationsBySuitability(const Esri::ArcGISRuntime::SpatialReference &inputSpatialReference, const Esri::ArcGISRuntime::SpatialReference &outputSpatialReference)

Returns a list containing DatumTransformation objects, each for projecting between spatial references without taking into account an area of interest.

The list is ordered in descending order by suitability, with the most suitable being first in the list. Some transformations require a supporting Projection Engine dataset to function correctly; see GeographicTransformationStep::projectionEngineFilenames. The list may include grid-based transformations, whether or not these datasets can be located by the Runtime; see DatumTransformation::isMissingProjectionEngineFiles.

[static] QList<Esri::ArcGISRuntime::DatumTransformation *> TransformationCatalog::transformationsBySuitability(const Esri::ArcGISRuntime::SpatialReference &inputSpatialReference, const Esri::ArcGISRuntime::SpatialReference &outputSpatialReference, const Esri::ArcGISRuntime::Envelope &areaOfInterest)

Returns a list containing DatumTransformation objects, each for projecting between spatial references and takes into account the area of interest.

The list is ordered in descending order by suitability, with the most suitable being first in the list. Note that providing an area of interest may affect the number and order of transformations returned. Some transformations require a supporting Projection Engine dataset to function correctly; see GeographicTransformationStep::projectionEngineFilenames. The list may include grid-based transformations, whether or not these datasets can be located by the Runtime; see DatumTransformation::isMissingProjectionEngineFiles.

  • inputSpatialReference - The SpatialReference that transformation is from.
  • outputSpatialReference - The SpatialReference that transformation is to.
  • areaOfInterest - A geographic extent expressed as an Envelope.

If areaOfInterest has a different spatial reference than inputSpatialReference, it will be reprojected to inputSpatialReference. If areaOfInterest doesn't intersect the area of use of inputSpatialReference, this method returns an empty list.

[static] QList<Esri::ArcGISRuntime::DatumTransformation *> TransformationCatalog::transformationsBySuitability(const Esri::ArcGISRuntime::SpatialReference &inputSpatialReference, const Esri::ArcGISRuntime::SpatialReference &outputSpatialReference, const Esri::ArcGISRuntime::Envelope &areaOfInterest, bool ignoreVertical)

Returns a collection of transformations suitable for projecting between the input and output spatial references, taking into account the area of interest, if specified. Optionally checks for suitable vertical transformations.

  • inputSpatialReference
  • outputSpatialReference
  • areaOfInterest - The bounding box of coordinates to be transformed, or nullptr to consider the entire world extent.
  • ignoreVertical - true if TransformationCatalog should ignore any vertical coordinate systems set on the inputSpatialReference or outputSpatialReference, and only consider horizontal (geographic) transformations; false otherwise.

The collection is ordered in descending order by suitability, with the most suitable being first in the list.

A geographic transformation is not needed when input and output spatial references have the same underlying geographic coordinate system, in which case an empty list is returned. A vertical transformation is not needed if both datums (for ellipsoidal heights) or vertical datums (for gravity-related heights) are the same. If neither type of transformation is needed, an empty collection is returned.

Use this method to determine whether or not any vertical coordinate systems set on the spatial reference parameters should be accounted for in the returned list of transformations. This method can be used to replicate the former (prior to version Esri::ArcGISRuntime 100.9) behavior of the TransformationCatalog::transformationsBySuitability(const Esri::ArcGISRuntime::SpatialReference&, const Esri::ArcGISRuntime::SpatialReference&) and TransformationCatalog::transformationsBySuitability(const Esri::ArcGISRuntime::SpatialReference&, const Esri::ArcGISRuntime::SpatialReference&, const Esri::ArcGISRuntime::Envelope&) methods:

Calling this method with `ignoreVertical == false` is equivalent to calling TransformationCatalog::transformationsBySuitability(const Esri::ArcGISRuntime::SpatialReference&, const Esri::ArcGISRuntime::SpatialReference&, const Esri::ArcGISRuntime::Envelope&). Calling this method with `ignoreVertical == true` is equivalent to calling TransformationCatalog::transformationsBySuitability(const Esri::ArcGISRuntime::SpatialReference&, const Esri::ArcGISRuntime::SpatialReference&, const Esri::ArcGISRuntime::Envelope&) in releases prior to Esri::ArcGISRuntime 100.9

Some transformations require a supporting Projection Engine (PE) dataset to function correctly - see GeographicTransformationStep::projectionEngineFilenames and HorizontalVerticalTransformationStep::projectionEngineFilenames. The returned list may include grid-based transformations, whether or not these datasets can be located by the Runtime - see DatumTransformation::isMissingProjectionEngineFiles.

This function was introduced in Esri::ArcGISRuntime 100.9.


Feedback on this topic?