From a3f43744feec86272fe532124679d3a013ef9a8c Mon Sep 17 00:00:00 2001 From: PROJ deploybot Date: Tue, 22 Mar 2022 20:00:06 +0000 Subject: update with results of commit https://github.com/OSGeo/PROJ/commit/53c07a8bd211b7aee4bc07a9c6726005504b7181 --- development/reference/cpp/common.html | 896 +++++++ development/reference/cpp/cpp_general.html | 249 ++ development/reference/cpp/crs.html | 1966 ++++++++++++++ development/reference/cpp/cs.html | 1312 +++++++++ development/reference/cpp/datum.html | 1180 ++++++++ development/reference/cpp/index.html | 171 ++ development/reference/cpp/io.html | 2208 +++++++++++++++ development/reference/cpp/metadata.html | 872 ++++++ development/reference/cpp/operation.html | 4030 ++++++++++++++++++++++++++++ development/reference/cpp/util.html | 688 +++++ development/reference/datatypes.html | 2275 ++++++++++++++++ development/reference/functions.html | 3681 +++++++++++++++++++++++++ development/reference/index.html | 154 ++ development/reference/macros.html | 195 ++ 14 files changed, 19877 insertions(+) create mode 100644 development/reference/cpp/common.html create mode 100644 development/reference/cpp/cpp_general.html create mode 100644 development/reference/cpp/crs.html create mode 100644 development/reference/cpp/cs.html create mode 100644 development/reference/cpp/datum.html create mode 100644 development/reference/cpp/index.html create mode 100644 development/reference/cpp/io.html create mode 100644 development/reference/cpp/metadata.html create mode 100644 development/reference/cpp/operation.html create mode 100644 development/reference/cpp/util.html create mode 100644 development/reference/datatypes.html create mode 100644 development/reference/functions.html create mode 100644 development/reference/index.html create mode 100644 development/reference/macros.html (limited to 'development/reference') diff --git a/development/reference/cpp/common.html b/development/reference/cpp/common.html new file mode 100644 index 00000000..8ed8ce86 --- /dev/null +++ b/development/reference/cpp/common.html @@ -0,0 +1,896 @@ + + + + + + + common namespace — PROJ 9.0.0 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

common namespace

+
+
+namespace osgeo::proj::common
+

Common classes.

+

osgeo.proj.common namespace

+
+

Typedefs

+
+
+typedef std::shared_ptr<UnitOfMeasure> UnitOfMeasurePtr
+

Shared pointer of UnitOfMeasure.

+
+ +
+
+typedef util::nn<UnitOfMeasurePtr> UnitOfMeasureNNPtr
+

Non-null shared pointer of UnitOfMeasure.

+
+ +
+
+typedef std::shared_ptr<IdentifiedObject> IdentifiedObjectPtr
+

Shared pointer of IdentifiedObject.

+
+ +
+
+typedef util::nn<IdentifiedObjectPtr> IdentifiedObjectNNPtr
+

Non-null shared pointer of IdentifiedObject.

+
+ +
+
+using ObjectDomainPtr = std::shared_ptr<ObjectDomain>
+

Shared pointer of ObjectDomain.

+
+ +
+
+using ObjectDomainNNPtr = util::nn<ObjectDomainPtr>
+

Non-null shared pointer of ObjectDomain.

+
+ +
+
+using ObjectUsagePtr = std::shared_ptr<ObjectUsage>
+

Shared pointer of ObjectUsage.

+
+ +
+
+using ObjectUsageNNPtr = util::nn<ObjectUsagePtr>
+

Non-null shared pointer of ObjectUsage.

+
+ +
+
+
+class Angle : public osgeo::proj::common::Measure
+
+#include <common.hpp>
+

Numeric value, with a angular unit of measure.

+
+

Public Functions

+
+
+explicit Angle(double valueIn = 0.0)
+

Instantiate a Angle.

+
+
Parameters
+

valueIn – value

+
+
+
+ +
+
+Angle(double valueIn, const UnitOfMeasure &unitIn)
+

Instantiate a Angle.

+
+
Parameters
+
+
+
+
+ +
+
+ +
+
+class DataEpoch
+
+#include <common.hpp>
+

Data epoch.

+
+

Public Functions

+
+
+const Measure &coordinateEpoch() const
+

Return the coordinate epoch, as a measure in decimal year.

+
+ +
+
+ +
+
+class DateTime
+
+#include <common.hpp>
+

Date-time value, as a ISO:8601 encoded string, or other string encoding.

+
+

Public Functions

+
+
+bool isISO_8601() const
+

Return whether the DateTime is ISO:8601 compliant.

+

+

Remark

+

The current implementation is really simplistic, and aimed at detecting date-times that are not ISO:8601 compliant.

+
+

+
+ +
+
+std::string toString() const
+

Return the DateTime as a string.

+
+ +
+
+

Public Static Functions

+
+
+static DateTime create(const std::string &str)
+

Instantiate a DateTime.

+
+ +
+
+ +
+
+class IdentifiedObject : public osgeo::proj::util::BaseObject, public osgeo::proj::util::IComparable, public osgeo::proj::io::IWKTExportable
+
+#include <common.hpp>
+

Abstract class representing a CRS-related object that has an identification.

+

+

Remark

+

Implements IdentifiedObject from ISO 19111:2019

+
+

+

Subclassed by osgeo::proj::common::ObjectUsage, osgeo::proj::cs::CoordinateSystem, osgeo::proj::cs::CoordinateSystemAxis, osgeo::proj::cs::Meridian, osgeo::proj::datum::Ellipsoid, osgeo::proj::datum::PrimeMeridian, osgeo::proj::operation::GeneralOperationParameter, osgeo::proj::operation::OperationMethod

+
+

Public Functions

+
+
+const metadata::IdentifierNNPtr &name()
+

Return the name of the object.

+

Generally, the only interesting field of the name will be name()->description().

+
+ +
+
+const std::string &nameStr()
+

Return the name of the object.

+

Return *(name()->description())

+
+ +
+
+const std::vector<metadata::IdentifierNNPtr> &identifiers()
+

Return the identifier(s) of the object.

+

Generally, those will have Identifier::code() and Identifier::codeSpace() filled.

+
+ +
+
+const std::vector<util::GenericNameNNPtr> &aliases()
+

Return the alias(es) of the object.

+
+ +
+
+const std::string &remarks()
+

Return the remarks.

+
+ +
+
+bool isDeprecated()
+

Return whether the object is deprecated.

+

+

Remark

+

Extension of ISO 19111:2019

+
+

+
+ +
+
+std::string alias()
+

Return the (first) alias of the object as a string.

+

Shortcut for aliases()[0]->toFullyQualifiedName()->toString()

+
+ +
+
+int getEPSGCode()
+

Return the EPSG code.

+
+
Returns
+

code, or 0 if not found

+
+
+
+ +
+
+

Public Static Attributes

+
+
+static const std::string NAME_KEY
+

Key to set the name of a common::IdentifiedObject.

+

The value is to be provided as a string or metadata::IdentifierNNPtr.

+
+ +
+
+static const std::string IDENTIFIERS_KEY
+

Key to set the identifier(s) of a common::IdentifiedObject.

+

The value is to be provided as a common::IdentifierNNPtr or a util::ArrayOfBaseObjectNNPtr of common::IdentifierNNPtr.

+
+ +
+
+static const std::string ALIAS_KEY
+

Key to set the alias(es) of a common::IdentifiedObject.

+

The value is to be provided as string, a util::GenericNameNNPtr or a util::ArrayOfBaseObjectNNPtr of util::GenericNameNNPtr.

+
+ +
+
+static const std::string REMARKS_KEY
+

Key to set the remarks of a common::IdentifiedObject.

+

The value is to be provided as a string.

+
+ +
+
+static const std::string DEPRECATED_KEY
+

Key to set the deprecation flag of a common::IdentifiedObject.

+

The value is to be provided as a boolean.

+
+ +
+
+ +
+
+class Length : public osgeo::proj::common::Measure
+
+#include <common.hpp>
+

Numeric value, with a linear unit of measure.

+
+

Public Functions

+
+
+explicit Length(double valueIn = 0.0)
+

Instantiate a Length.

+
+
Parameters
+

valueIn – value

+
+
+
+ +
+
+Length(double valueIn, const UnitOfMeasure &unitIn)
+

Instantiate a Length.

+
+
Parameters
+
+
+
+
+ +
+
+ +
+
+class Measure : public osgeo::proj::util::BaseObject
+
+#include <common.hpp>
+

Numeric value associated with a UnitOfMeasure.

+

Subclassed by osgeo::proj::common::Angle, osgeo::proj::common::Length, osgeo::proj::common::Scale

+
+

Public Functions

+
+
+Measure(double valueIn = 0.0, const UnitOfMeasure &unitIn = UnitOfMeasure())
+

Instantiate a Measure.

+
+ +
+
+const UnitOfMeasure &unit()
+

Return the unit of the Measure.

+
+ +
+
+double getSIValue()
+

Return the value of the Measure, after conversion to the corresponding unit of the International System.

+
+ +
+
+double value()
+

Return the value of the measure, expressed in the unit()

+
+ +
+
+double convertToUnit(const UnitOfMeasure &otherUnit)
+

Return the value of this measure expressed into the provided unit.

+
+ +
+
+bool operator==(const Measure &other)
+

Return whether two measures are equal.

+

The comparison is done both on the value and the unit.

+
+ +
+
+bool _isEquivalentTo(const Measure &other, util::IComparable::Criterion criterion = util::IComparable::Criterion::STRICT, double maxRelativeError = DEFAULT_MAX_REL_ERROR) const
+

Returns whether an object is equivalent to another one.

+
+
Parameters
+
    +
  • other – other object to compare to

  • +
  • criterion – comparison criterion.

  • +
  • maxRelativeError – Maximum relative error allowed.

  • +
+
+
Returns
+

true if objects are equivalent.

+
+
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr double DEFAULT_MAX_REL_ERROR = 1e-10
+

Default maximum resulative error.

+
+ +
+
+ +
+
+class ObjectDomain : public osgeo::proj::util::BaseObject, public osgeo::proj::util::IComparable
+
+#include <common.hpp>
+

The scope and validity of a CRS-related object.

+

+

Remark

+

Implements ObjectDomain from ISO 19111:2019

+
+

+
+

Public Functions

+
+
+const util::optional<std::string> &scope()
+

Return the scope.

+
+
Returns
+

the scope, or empty.

+
+
+
+ +
+
+const metadata::ExtentPtr &domainOfValidity()
+

Return the domain of validity.

+
+
Returns
+

the domain of validity, or nullptr.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static ObjectDomainNNPtr create(const util::optional<std::string> &scopeIn, const metadata::ExtentPtr &extent)
+

Instantiate a ObjectDomain.

+
+ +
+
+ +
+
+class ObjectUsage : public osgeo::proj::common::IdentifiedObject
+
+#include <common.hpp>
+

Abstract class of a CRS-related object that has usages.

+

+

Remark

+

Implements ObjectUsage from ISO 19111:2019

+
+

+

Subclassed by osgeo::proj::crs::CRS, osgeo::proj::datum::Datum, osgeo::proj::datum::DatumEnsemble, osgeo::proj::operation::CoordinateOperation

+
+

Public Functions

+
+
+const std::vector<ObjectDomainNNPtr> &domains()
+

Return the domains of the object.

+
+ +
+
+

Public Static Attributes

+
+
+static const std::string SCOPE_KEY
+

Key to set the scope of a common::ObjectUsage.

+

The value is to be provided as a string.

+
+ +
+
+static const std::string DOMAIN_OF_VALIDITY_KEY
+

Key to set the domain of validity of a common::ObjectUsage.

+

The value is to be provided as a common::ExtentNNPtr.

+
+ +
+
+static const std::string OBJECT_DOMAIN_KEY
+

Key to set the object domain(s) of a common::ObjectUsage.

+

The value is to be provided as a common::ObjectDomainNNPtr or a util::ArrayOfBaseObjectNNPtr of common::ObjectDomainNNPtr.

+
+ +
+
+ +
+
+class Scale : public osgeo::proj::common::Measure
+
+#include <common.hpp>
+

Numeric value, without a physical unit of measure.

+
+

Public Functions

+
+
+explicit Scale(double valueIn = 0.0)
+

Instantiate a Scale.

+
+
Parameters
+

valueIn – value

+
+
+
+ +
+
+explicit Scale(double valueIn, const UnitOfMeasure &unitIn)
+

Instantiate a Scale.

+
+
Parameters
+
+
+
+
+ +
+
+ +
+
+class UnitOfMeasure : public osgeo::proj::util::BaseObject
+
+#include <common.hpp>
+

Unit of measure.

+

This is a mutable object.

+
+

Public Types

+
+
+enum class Type
+

Type of unit of measure.

+

Values:

+
+
+enumerator UNKNOWN
+

Unknown unit of measure

+
+ +
+
+enumerator NONE
+

No unit of measure

+
+ +
+
+enumerator ANGULAR
+

Angular unit of measure

+
+ +
+
+enumerator LINEAR
+

Linear unit of measure

+
+ +
+
+enumerator SCALE
+

Scale unit of measure

+
+ +
+
+enumerator TIME
+

Time unit of measure

+
+ +
+
+enumerator PARAMETRIC
+

Parametric unit of measure

+
+ +
+ +
+
+

Public Functions

+
+
+UnitOfMeasure(const std::string &nameIn = std::string(), double toSIIn = 1.0, Type typeIn = Type::UNKNOWN, const std::string &codeSpaceIn = std::string(), const std::string &codeIn = std::string())
+

Creates a UnitOfMeasure.

+
+ +
+
+const std::string &name()
+

Return the name of the unit of measure.

+
+ +
+
+double conversionToSI()
+

Return the conversion factor to the unit of the International System of Units of the same Type.

+

For example, for foot, this would be 0.3048 (metre)

+
+
Returns
+

the conversion factor, or 0 if no conversion exists.

+
+
+
+ +
+
+Type type()
+

Return the type of the unit of measure.

+
+ +
+
+const std::string &codeSpace()
+

Return the code space of the unit of measure.

+

For example “EPSG”

+
+
Returns
+

the code space, or empty string.

+
+
+
+ +
+
+const std::string &code()
+

Return the code of the unit of measure.

+
+
Returns
+

the code, or empty string.

+
+
+
+ +
+
+bool operator==(const UnitOfMeasure &other)
+

Returns whether two units of measures are equal.

+

The comparison is based on the name.

+
+ +
+
+bool operator!=(const UnitOfMeasure &other)
+

Returns whether two units of measures are different.

+

The comparison is based on the name.

+
+ +
+
+

Public Static Attributes

+
+
+static const UnitOfMeasure NONE
+

“Empty”/”None”, unit of measure of type NONE.

+
+ +
+
+static const UnitOfMeasure SCALE_UNITY
+

Scale unity, unit of measure of type SCALE.

+
+ +
+
+static const UnitOfMeasure PARTS_PER_MILLION
+

Parts-per-million, unit of measure of type SCALE.

+
+ +
+
+static const UnitOfMeasure PPM_PER_YEAR
+

Parts-per-million per year, unit of measure of type SCALE.

+
+ +
+
+static const UnitOfMeasure METRE
+

Metre, unit of measure of type LINEAR (SI unit).

+
+ +
+
+static const UnitOfMeasure METRE_PER_YEAR
+

Metre per year, unit of measure of type LINEAR.

+
+ +
+
+static const UnitOfMeasure FOOT
+

Foot, unit of measure of type LINEAR.

+
+ +
+
+static const UnitOfMeasure US_FOOT
+

US survey foot, unit of measure of type LINEAR.

+
+ +
+
+static const UnitOfMeasure RADIAN
+

Radian, unit of measure of type ANGULAR (SI unit).

+
+ +
+
+static const UnitOfMeasure MICRORADIAN
+

Microradian, unit of measure of type ANGULAR.

+
+ +
+
+static const UnitOfMeasure DEGREE
+

Degree, unit of measure of type ANGULAR.

+
+ +
+
+static const UnitOfMeasure ARC_SECOND
+

Arc-second, unit of measure of type ANGULAR.

+
+ +
+
+static const UnitOfMeasure GRAD
+

Grad, unit of measure of type ANGULAR.

+
+ +
+
+static const UnitOfMeasure ARC_SECOND_PER_YEAR
+

Arc-second per year, unit of measure of type ANGULAR.

+
+ +
+
+static const UnitOfMeasure SECOND
+

Second, unit of measure of type TIME (SI unit).

+
+ +
+
+static const UnitOfMeasure YEAR
+

Year, unit of measure of type TIME.

+
+ +
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/development/reference/cpp/cpp_general.html b/development/reference/cpp/cpp_general.html new file mode 100644 index 00000000..81e045b5 --- /dev/null +++ b/development/reference/cpp/cpp_general.html @@ -0,0 +1,249 @@ + + + + + + + General documentation — PROJ 9.0.0 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

General documentation

+
+
+page general_doc
+
+

General API design

+

The design of the class hierarchy is strongly derived from ISO 19111:2019.

+

Classes for which the constructors are not directly accessible have their instances constructed with create() methods. The returned object is a non-null shared pointer. Such objects are immutable, and thread-safe.

+

TODO

+
+
+

General properties

+

All classes deriving from IdentifiedObject have general properties that can be defined at creation time. Those properties are:

+

+

+
+
+

Applicable standards

+
+

ISO:19111 / OGC Topic 2 standard

+

Topic 2 - Spatial referencing by coordinates.

+

This is an Abstract Specification describes the data elements, relationships and associated metadata required for spatial referencing by coordinates. It describes Coordinate Reference Systems (CRS), coordinate systems (CS) and coordinate transformation or coordinate conversion between two different coordinate reference systems.

+
+

ISO 19111:2019

+

This is the revision mostly used for PROJ C++ modelling.

+

[OGC 18-005r4, 2019-02-08, ISO 19111:2019] (http://docs.opengeospatial.org/as/18-005r4/18-005r4.html)

+
+
+

ISO 19111:2007

+

The precedent version of the specification was: [OGC 08-015r2, 2010-04-27, ISO 19111:2007] (http://portal.opengeospatial.org/files/?artifact_id=39049)

+
+
+
+

WKT2 standard

+

Well-known text representation of coordinate reference systems.

+

Well-known Text (WKT) offers a compact machine- and human-readable representation of the critical elements of coordinate reference system (CRS) definitions, and coordinate operations. This is an implementation of ISO:19111 / OGC Topic 2 standard

+

PROJ implements the two following revisions of the standard:

+
+

WKT2:2019

+

[OGC 18-010r7, 2019-06-24, WKT2-2019] (http://docs.opengeospatial.org/is/18-010r7/18-010r7.html)

+
+
+

WKT2:2015

+

[OGC 12-063r5, 2015-05-01, ISO 19162:2015(E), WKT2-2015] (http://docs.opengeospatial.org/is/12-063r5/12-063r5.html)

+
+
+
+

WKT1 specification

+

Older specifications of well-known text representation of coordinate reference systems are also supported by PROJ, mostly for compatibility with legacy systems, or older versions of GDAL.

+

GDAL v2.4 and earlier mostly implements:

+

[OGC 01-009, 2001-01-12, OpenGIS Coordinate Transformation Service Implementation Specification] (http://portal.opengeospatial.org/files/?artifact_id=999)

+

The [GDAL documentation, OGC WKT Coordinate System Issues] (https://gdal.org/tutorials/wktproblems.html) discusses issues, and GDAL implementation choices.

+

An older specification of WKT1 is/was used by some software packages:

+

[OGC 99-049, 1999-05-05, OpenGIS Simple Features Specification For SQL v1.1] (http://portal.opengeospatial.org/files/?artifact_id=829)

+
+
+

ISO 19115 (Metadata)

+

Defines the schema required for describing geographic information and services. It provides information about the identification, the extent, the quality, the spatial and temporal schema, spatial reference, and distribution of digital geographic data.

+

PROJ implements a simplified subset of ISO 19115.

+
+
+

GeoAPI

+

A set of Java and Python language programming interfaces for geospatial applications.

+

GeoAPI main page

+

GeoAPI Javadoc

+

[OGC GeoAPI Implementation Specification] (http://www.opengeospatial.org/standards/geoapi)

+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/development/reference/cpp/crs.html b/development/reference/cpp/crs.html new file mode 100644 index 00000000..943366a3 --- /dev/null +++ b/development/reference/cpp/crs.html @@ -0,0 +1,1966 @@ + + + + + + + crs namespace — PROJ 9.0.0 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

crs namespace

+
+
+namespace osgeo::proj::crs
+

CRS (coordinate reference system = coordinate system with a datum).

+

osgeo.proj.crs namespace

+
+

Typedefs

+
+
+typedef std::shared_ptr<CRS> CRSPtr
+

Shared pointer of CRS

+
+ +
+
+typedef util::nn<CRSPtr> CRSNNPtr
+

Non-null shared pointer of CRS

+
+ +
+
+typedef std::shared_ptr<GeographicCRS> GeographicCRSPtr
+

Shared pointer of GeographicCRS

+
+ +
+
+typedef util::nn<GeographicCRSPtr> GeographicCRSNNPtr
+

Non-null shared pointer of GeographicCRS

+
+ +
+
+typedef std::shared_ptr<VerticalCRS> VerticalCRSPtr
+

Shared pointer of VerticalCRS

+
+ +
+
+typedef util::nn<VerticalCRSPtr> VerticalCRSNNPtr
+

Non-null shared pointer of VerticalCRS

+
+ +
+
+using BoundCRSPtr = std::shared_ptr<BoundCRS>
+

Shared pointer of BoundCRS

+
+ +
+
+using BoundCRSNNPtr = util::nn<BoundCRSPtr>
+

Non-null shared pointer of BoundCRS

+
+ +
+
+typedef std::shared_ptr<CompoundCRS> CompoundCRSPtr
+

Shared pointer of CompoundCRS

+
+ +
+
+typedef util::nn<CompoundCRSPtr> CompoundCRSNNPtr
+

Non-null shared pointer of CompoundCRS

+
+ +
+
+using SingleCRSPtr = std::shared_ptr<SingleCRS>
+

Shared pointer of SingleCRS

+
+ +
+
+using SingleCRSNNPtr = util::nn<SingleCRSPtr>
+

Non-null shared pointer of SingleCRS

+
+ +
+
+typedef std::shared_ptr<GeodeticCRS> GeodeticCRSPtr
+

Shared pointer of GeodeticCRS

+
+ +
+
+typedef util::nn<GeodeticCRSPtr> GeodeticCRSNNPtr
+

Non-null shared pointer of GeodeticCRS

+
+ +
+
+using DerivedCRSPtr = std::shared_ptr<DerivedCRS>
+

Shared pointer of DerivedCRS

+
+ +
+
+using DerivedCRSNNPtr = util::nn<DerivedCRSPtr>
+

Non-null shared pointer of DerivedCRS

+
+ +
+
+typedef std::shared_ptr<ProjectedCRS> ProjectedCRSPtr
+

Shared pointer of ProjectedCRS

+
+ +
+
+typedef util::nn<ProjectedCRSPtr> ProjectedCRSNNPtr
+

Non-null shared pointer of ProjectedCRS

+
+ +
+
+using TemporalCRSPtr = std::shared_ptr<TemporalCRS>
+

Shared pointer of TemporalCRS

+
+ +
+
+using TemporalCRSNNPtr = util::nn<TemporalCRSPtr>
+

Non-null shared pointer of TemporalCRS

+
+ +
+
+using EngineeringCRSPtr = std::shared_ptr<EngineeringCRS>
+

Shared pointer of EngineeringCRS

+
+ +
+
+using EngineeringCRSNNPtr = util::nn<EngineeringCRSPtr>
+

Non-null shared pointer of EngineeringCRS

+
+ +
+
+using ParametricCRSPtr = std::shared_ptr<ParametricCRS>
+

Shared pointer of ParametricCRS

+
+ +
+
+using ParametricCRSNNPtr = util::nn<ParametricCRSPtr>
+

Non-null shared pointer of ParametricCRS

+
+ +
+
+using DerivedGeodeticCRSPtr = std::shared_ptr<DerivedGeodeticCRS>
+

Shared pointer of DerivedGeodeticCRS

+
+ +
+
+using DerivedGeodeticCRSNNPtr = util::nn<DerivedGeodeticCRSPtr>
+

Non-null shared pointer of DerivedGeodeticCRS

+
+ +
+
+using DerivedGeographicCRSPtr = std::shared_ptr<DerivedGeographicCRS>
+

Shared pointer of DerivedGeographicCRS

+
+ +
+
+using DerivedGeographicCRSNNPtr = util::nn<DerivedGeographicCRSPtr>
+

Non-null shared pointer of DerivedGeographicCRS

+
+ +
+
+using DerivedProjectedCRSPtr = std::shared_ptr<DerivedProjectedCRS>
+

Shared pointer of DerivedProjectedCRS

+
+ +
+
+using DerivedProjectedCRSNNPtr = util::nn<DerivedProjectedCRSPtr>
+

Non-null shared pointer of DerivedProjectedCRS

+
+ +
+
+using DerivedVerticalCRSPtr = std::shared_ptr<DerivedVerticalCRS>
+

Shared pointer of DerivedVerticalCRS

+
+ +
+
+using DerivedVerticalCRSNNPtr = util::nn<DerivedVerticalCRSPtr>
+

Non-null shared pointer of DerivedVerticalCRS

+
+ +
+
+using DerivedEngineeringCRSPtr = std::shared_ptr<DerivedEngineeringCRS>
+

Shared pointer of DerivedEngineeringCRS

+
+ +
+
+using DerivedEngineeringCRSNNPtr = util::nn<DerivedEngineeringCRSPtr>
+

Non-null shared pointer of DerivedEngineeringCRS

+
+ +
+
+using DerivedParametricCRSPtr = std::shared_ptr<DerivedParametricCRS>
+

Shared pointer of DerivedParametricCRS

+
+ +
+
+using DerivedParametricCRSNNPtr = util::nn<DerivedParametricCRSPtr>
+

Non-null shared pointer of DerivedParametricCRS

+
+ +
+
+using DerivedTemporalCRSPtr = std::shared_ptr<DerivedTemporalCRS>
+

Shared pointer of DerivedTemporalCRS

+
+ +
+
+using DerivedTemporalCRSNNPtr = util::nn<DerivedTemporalCRSPtr>
+

Non-null shared pointer of DerivedTemporalCRS

+
+ +
+
+
+class BoundCRS : public osgeo::proj::crs::CRS, public osgeo::proj::io::IPROJStringExportable
+
+#include <crs.hpp>
+

A coordinate reference system with an associated transformation to a target/hub CRS.

+

The definition of a CRS is not dependent upon any relationship to an independent CRS. However in an implementation that merges datasets referenced to differing CRSs, it is sometimes useful to associate the definition of the transformation that has been used with the CRS definition. This facilitates the interrelationship of CRS by concatenating transformations via a common or hub CRS. This is sometimes referred to as “early-binding”. WKT2 standard permits the association of an abridged coordinate transformation description with a coordinate reference system description in a single text string. In a BoundCRS, the abridged coordinate transformation is applied to the source CRS with the target CRS being the common or hub system.

+

Coordinates referring to a BoundCRS are expressed into its source/base CRS.

+

This abstraction can for example model the concept of TOWGS84 datum shift present in WKT1 specification.

+

+

Remark

+

Implements BoundCRS from WKT2 standard

+
+

+
+

Note

+

Contrary to other CRS classes of this package, there is no ISO 19111:2019 modelling of a BoundCRS.

+
+
+

Public Functions

+
+
+const CRSNNPtr &baseCRS()
+

Return the base CRS.

+

This is the CRS into which coordinates of the BoundCRS are expressed.

+
+
Returns
+

the base CRS.

+
+
+
+ +
+
+CRSNNPtr baseCRSWithCanonicalBoundCRS() const
+

Return a shallow clone of the base CRS that points to a shallow clone of this BoundCRS.

+

The base CRS is the CRS into which coordinates of the BoundCRS are expressed.

+

The returned CRS will actually be a shallow clone of the actual base CRS, with the extra property that CRS::canonicalBoundCRS() will point to a shallow clone of this BoundCRS. Use this only if you want to work with the base CRS object rather than the BoundCRS, but wanting to be able to retrieve the BoundCRS later.

+
+
Returns
+

the base CRS.

+
+
+
+ +
+
+const CRSNNPtr &hubCRS()
+

Return the target / hub CRS.

+
+
Returns
+

the hub CRS.

+
+
+
+ +
+
+const operation::TransformationNNPtr &transformation()
+

Return the transformation to the hub RS.

+
+
Returns
+

transformation.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static BoundCRSNNPtr create(const util::PropertyMap &properties, const CRSNNPtr &baseCRSIn, const CRSNNPtr &hubCRSIn, const operation::TransformationNNPtr &transformationIn)
+

Instantiate a BoundCRS from a base CRS, a hub CRS and a transformation.

+

+
Since

PROJ 8.2

+
+
+

+
+
Parameters
+
    +
  • properties – See General properties.

  • +
  • baseCRSIn – base CRS.

  • +
  • hubCRSIn – hub CRS.

  • +
  • transformationIn – transformation from base CRS to hub CRS.

  • +
+
+
Returns
+

new BoundCRS.

+
+
+
+ +
+
+static BoundCRSNNPtr create(const CRSNNPtr &baseCRSIn, const CRSNNPtr &hubCRSIn, const operation::TransformationNNPtr &transformationIn)
+

Instantiate a BoundCRS from a base CRS, a hub CRS and a transformation.

+
+
Parameters
+
    +
  • baseCRSIn – base CRS.

  • +
  • hubCRSIn – hub CRS.

  • +
  • transformationIn – transformation from base CRS to hub CRS.

  • +
+
+
Returns
+

new BoundCRS.

+
+
+
+ +
+
+static BoundCRSNNPtr createFromTOWGS84(const CRSNNPtr &baseCRSIn, const std::vector<double> &TOWGS84Parameters)
+

Instantiate a BoundCRS from a base CRS and TOWGS84 parameters.

+
+
Parameters
+
    +
  • baseCRSIn – base CRS.

  • +
  • TOWGS84Parameters – a vector of 3 or 7 double values representing WKT1 TOWGS84 parameter.

  • +
+
+
Returns
+

new BoundCRS.

+
+
+
+ +
+
+static BoundCRSNNPtr createFromNadgrids(const CRSNNPtr &baseCRSIn, const std::string &filename)
+

Instantiate a BoundCRS from a base CRS and nadgrids parameters.

+
+
Parameters
+
    +
  • baseCRSIn – base CRS.

  • +
  • filename – Horizontal grid filename

  • +
+
+
Returns
+

new BoundCRS.

+
+
+
+ +
+
+ +
+
+class CompoundCRS : public osgeo::proj::crs::CRS, public osgeo::proj::io::IPROJStringExportable
+
+#include <crs.hpp>
+

A coordinate reference system describing the position of points through two or more independent single coordinate reference systems.

+

+

Remark

+

Implements CompoundCRS from ISO 19111:2019

+
+

+
+

Note

+

Two coordinate reference systems are independent of each other if coordinate values in one cannot be converted or transformed into coordinate values in the other.

+
+
+

Note

+

As a departure to ISO 19111:2019, we allow to build a CompoundCRS from CRS objects, whereas ISO19111:2019 restricts the components to SingleCRS.

+
+
+

Public Functions

+
+
+const std::vector<CRSNNPtr> &componentReferenceSystems()
+

Return the components of a CompoundCRS.

+
+
Returns
+

the components.

+
+
+
+ +
+
+std::list<std::pair<CompoundCRSNNPtr, int>> identify(const io::AuthorityFactoryPtr &authorityFactory) const
+

Identify the CRS with reference CRSs.

+

The candidate CRSs are looked in the database when authorityFactory is not null.

+

Note that the implementation uses a set of heuristics to have a good compromise of successful identifications over execution time. It might miss legitimate matches in some circumstances.

+

The method returns a list of matching reference CRS, and the percentage (0-100) of confidence in the match. The list is sorted by decreasing confidence.

+

100% means that the name of the reference entry perfectly matches the CRS name, and both are equivalent. In which case a single result is returned. 90% means that CRS are equivalent, but the names are not exactly the same. 70% means that CRS are equivalent (equivalent horizontal and vertical CRS), but the names are not equivalent. 25% means that the CRS are not equivalent, but there is some similarity in the names.

+
+
Parameters
+

authorityFactory – Authority factory (if null, will return an empty list)

+
+
Returns
+

a list of matching reference CRS, and the percentage (0-100) of confidence in the match.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static CompoundCRSNNPtr create(const util::PropertyMap &properties, const std::vector<CRSNNPtr> &components)
+

Instantiate a CompoundCRS from a vector of CRS.

+
+
Parameters
+
+
+
Throws
+

InvalidCompoundCRSException

+
+
Returns
+

new CompoundCRS.

+
+
+
+ +
+
+ +
+
+class CRS : public osgeo::proj::common::ObjectUsage, public osgeo::proj::io::IJSONExportable
+
+#include <crs.hpp>
+

Abstract class modelling a coordinate reference system which is usually single but may be compound.

+

+

Remark

+

Implements CRS from ISO 19111:2019

+
+

+

Subclassed by osgeo::proj::crs::BoundCRS, osgeo::proj::crs::CompoundCRS, osgeo::proj::crs::SingleCRS

+
+

Public Functions

+
+
+GeodeticCRSPtr extractGeodeticCRS() const
+

Return the GeodeticCRS of the CRS.

+

Returns the GeodeticCRS contained in a CRS. This works currently with input parameters of type GeodeticCRS or derived, ProjectedCRS, CompoundCRS or BoundCRS.

+
+
Returns
+

a GeodeticCRSPtr, that might be null.

+
+
+
+ +
+
+GeographicCRSPtr extractGeographicCRS() const
+

Return the GeographicCRS of the CRS.

+

Returns the GeographicCRS contained in a CRS. This works currently with input parameters of type GeographicCRS or derived, ProjectedCRS, CompoundCRS or BoundCRS.

+
+
Returns
+

a GeographicCRSPtr, that might be null.

+
+
+
+ +
+
+VerticalCRSPtr extractVerticalCRS() const
+

Return the VerticalCRS of the CRS.

+

Returns the VerticalCRS contained in a CRS. This works currently with input parameters of type VerticalCRS or derived, CompoundCRS or BoundCRS.

+
+
Returns
+

a VerticalCRSPtr, that might be null.

+
+
+
+ +
+
+CRSNNPtr createBoundCRSToWGS84IfPossible(const io::DatabaseContextPtr &dbContext, operation::CoordinateOperationContext::IntermediateCRSUse allowIntermediateCRSUse) const
+

Returns potentially a BoundCRS, with a transformation to EPSG:4326, wrapping this CRS.

+

If no such BoundCRS is possible, the object will be returned.

+

The purpose of this method is to be able to format a PROJ.4 string with a +towgs84 parameter or a WKT1:GDAL string with a TOWGS node.

+

This method will fetch the GeographicCRS of this CRS and find a transformation to EPSG:4326 using the domain of the validity of the main CRS, and there’s only one Helmert transformation.

+
+
Returns
+

a CRS.

+
+
+
+ +
+
+CRSNNPtr stripVerticalComponent() const
+

Returns a CRS whose coordinate system does not contain a vertical component.

+
+
Returns
+

a CRS.

+
+
+
+ +
+
+const BoundCRSPtr &canonicalBoundCRS()
+

Return the BoundCRS potentially attached to this CRS.

+

In the case this method is called on a object returned by BoundCRS::baseCRSWithCanonicalBoundCRS(), this method will return this BoundCRS

+
+
Returns
+

a BoundCRSPtr, that might be null.

+
+
+
+ +
+
+std::list<std::pair<CRSNNPtr, int>> identify(const io::AuthorityFactoryPtr &authorityFactory) const
+

Identify the CRS with reference CRSs.

+

The candidate CRSs are either hard-coded, or looked in the database when authorityFactory is not null.

+

Note that the implementation uses a set of heuristics to have a good compromise of successful identifications over execution time. It might miss legitimate matches in some circumstances.

+

The method returns a list of matching reference CRS, and the percentage (0-100) of confidence in the match. The list is sorted by decreasing confidence.

    +
  • 100% means that the name of the reference entry perfectly matches the CRS name, and both are equivalent. In which case a single result is returned. Note: in the case of a GeographicCRS whose axis order is implicit in the input definition (for example ESRI WKT), then axis order is ignored for the purpose of identification. That is the CRS

    built from GEOGCS[“GCS_WGS_1984”,DATUM[“D_WGS_1984”,SPHEROID[“WGS_1984”,6378137.0,298.257223563]], PRIMEM[“Greenwich”,0.0],UNIT[“Degree”,0.0174532925199433]] will be identified to EPSG:4326, but will not pass a isEquivalentTo(EPSG_4326, util::IComparable::Criterion::EQUIVALENT) test, but rather isEquivalentTo(EPSG_4326,

    +

    util::IComparable::Criterion::EQUIVALENT_EXCEPT_AXIS_ORDER_GEOGCRS)

    +

  • +
  • 90% means that CRS are equivalent, but the names are not exactly the same.

  • +
  • 70% means that CRS are equivalent), but the names do not match at all.

  • +
  • 25% means that the CRS are not equivalent, but there is some similarity in the names.

  • +
+ +Other confidence values may be returned by some specialized implementations.

+

This is implemented for GeodeticCRS, ProjectedCRS, VerticalCRS and CompoundCRS.

+
+
Parameters
+

authorityFactory – Authority factory (or null, but degraded functionality)

+
+
Returns
+

a list of matching reference CRS, and the percentage (0-100) of confidence in the match.

+
+
+
+ +
+
+std::list<CRSNNPtr> getNonDeprecated(const io::DatabaseContextNNPtr &dbContext) const
+

Return CRSs that are non-deprecated substitutes for the current CRS.

+
+ +
+
+CRSNNPtr promoteTo3D(const std::string &newName, const io::DatabaseContextPtr &dbContext) const
+

Return a variant of this CRS “promoted” to a 3D one, if not already the case.

+

The new axis will be ellipsoidal height, oriented upwards, and with metre units.

+

+
Since

6.3

+
+
+

+
+
Parameters
+
    +
  • newName – Name of the new CRS. If empty, nameStr() will be used.

  • +
  • dbContext – Database context to look for potentially already registered 3D CRS. May be nullptr.

  • +
+
+
Returns
+

a new CRS promoted to 3D, or the current one if already 3D or not applicable.

+
+
+
+ +
+
+CRSNNPtr demoteTo2D(const std::string &newName, const io::DatabaseContextPtr &dbContext) const
+

Return a variant of this CRS “demoted” to a 2D one, if not already the case.

+

+
Since

6.3

+
+
+

+
+
Parameters
+
    +
  • newName – Name of the new CRS. If empty, nameStr() will be used.

  • +
  • dbContext – Database context to look for potentially already registered 2D CRS. May be nullptr.

  • +
+
+
Returns
+

a new CRS demoted to 2D, or the current one if already 2D or not applicable.

+
+
+
+ +
+
+ +
+
+class DerivedCRS : public virtual osgeo::proj::crs::SingleCRS
+
+#include <crs.hpp>
+

Abstract class modelling a single coordinate reference system that is defined through the application of a specified coordinate conversion to the definition of a previously established single coordinate reference system referred to as the base CRS.

+

A derived coordinate reference system inherits its datum (or datum ensemble) from its base CRS. The coordinate conversion between the base and derived coordinate reference system is implemented using the parameters and formula(s) specified in the definition of the coordinate conversion.

+

+

Remark

+

Implements DerivedCRS from ISO 19111:2019

+
+

+

Subclassed by osgeo::proj::crs::DerivedCRSTemplate< DerivedEngineeringCRSTraits >, osgeo::proj::crs::DerivedCRSTemplate< DerivedParametricCRSTraits >, osgeo::proj::crs::DerivedCRSTemplate< DerivedTemporalCRSTraits >, osgeo::proj::crs::DerivedCRSTemplate< DerivedCRSTraits >, osgeo::proj::crs::DerivedGeodeticCRS, osgeo::proj::crs::DerivedGeographicCRS, osgeo::proj::crs::DerivedProjectedCRS, osgeo::proj::crs::DerivedVerticalCRS, osgeo::proj::crs::ProjectedCRS

+
+

Public Functions

+
+
+const SingleCRSNNPtr &baseCRS()
+

Return the base CRS of a DerivedCRS.

+
+
Returns
+

the base CRS.

+
+
+
+ +
+
+const operation::ConversionNNPtr derivingConversion() const
+

Return the deriving conversion from the base CRS to this CRS.

+
+
Returns
+

the deriving conversion.

+
+
+
+ +
+
+ +
+
+template<class DerivedCRSTraits>
class DerivedCRSTemplate : public DerivedCRSTraits::BaseType, public osgeo::proj::crs::DerivedCRS
+
+#include <crs.hpp>
+

Template representing a derived coordinate reference system.

+
+

Public Types

+
+
+typedef util::nn<std::shared_ptr<DerivedCRSTemplate>> NNPtr
+

Non-null shared pointer of DerivedCRSTemplate

+
+ +
+
+typedef util::nn<std::shared_ptr<BaseType>> BaseNNPtr
+

Non-null shared pointer of BaseType

+
+ +
+
+typedef util::nn<std::shared_ptr<CSType>> CSNNPtr
+

Non-null shared pointer of CSType

+
+ +
+
+

Public Functions

+
+
+const BaseNNPtr baseCRS() const
+

Return the base CRS of a DerivedCRSTemplate.

+
+
Returns
+

the base CRS.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static NNPtr create(const util::PropertyMap &properties, const BaseNNPtr &baseCRSIn, const operation::ConversionNNPtr &derivingConversionIn, const CSNNPtr &csIn)
+

Instantiate a DerivedCRSTemplate from a base CRS, a deriving conversion and a cs::CoordinateSystem.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • baseCRSIn – base CRS.

  • +
  • derivingConversionIn – the deriving conversion from the base CRS to this CRS.

  • +
  • csIn – the coordinate system.

  • +
+
+
Returns
+

new DerivedCRSTemplate.

+
+
+
+ +
+
+ +
+
+class DerivedEngineeringCRS : public osgeo::proj::crs::DerivedCRSTemplate<DerivedEngineeringCRSTraits>
+
+#include <crs.hpp>
+

A derived coordinate reference system which has an engineering coordinate reference system as its base CRS, thereby inheriting an engineering datum, and is associated with one of the coordinate system types for an EngineeringCRS.

+

+

Remark

+

Implements DerivedEngineeringCRS from ISO 19111:2019

+
+

+
+ +
+
+class DerivedGeodeticCRS : public osgeo::proj::crs::GeodeticCRS, public osgeo::proj::crs::DerivedCRS
+
+#include <crs.hpp>
+

A derived coordinate reference system which has either a geodetic or a geographic coordinate reference system as its base CRS, thereby inheriting a geodetic reference frame, and associated with a 3D Cartesian or spherical coordinate system.

+

+

Remark

+

Implements DerivedGeodeticCRS from ISO 19111:2019

+
+

+
+

Public Functions

+
+
+const GeodeticCRSNNPtr baseCRS() const
+

Return the base CRS (a GeodeticCRS) of a DerivedGeodeticCRS.

+
+
Returns
+

the base CRS.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static DerivedGeodeticCRSNNPtr create(const util::PropertyMap &properties, const GeodeticCRSNNPtr &baseCRSIn, const operation::ConversionNNPtr &derivingConversionIn, const cs::CartesianCSNNPtr &csIn)
+

Instantiate a DerivedGeodeticCRS from a base CRS, a deriving conversion and a cs::CartesianCS.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • baseCRSIn – base CRS.

  • +
  • derivingConversionIn – the deriving conversion from the base CRS to this CRS.

  • +
  • csIn – the coordinate system.

  • +
+
+
Returns
+

new DerivedGeodeticCRS.

+
+
+
+ +
+
+static DerivedGeodeticCRSNNPtr create(const util::PropertyMap &properties, const GeodeticCRSNNPtr &baseCRSIn, const operation::ConversionNNPtr &derivingConversionIn, const cs::SphericalCSNNPtr &csIn)
+

Instantiate a DerivedGeodeticCRS from a base CRS, a deriving conversion and a cs::SphericalCS.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • baseCRSIn – base CRS.

  • +
  • derivingConversionIn – the deriving conversion from the base CRS to this CRS.

  • +
  • csIn – the coordinate system.

  • +
+
+
Returns
+

new DerivedGeodeticCRS.

+
+
+
+ +
+
+ +
+
+class DerivedGeographicCRS : public osgeo::proj::crs::GeographicCRS, public osgeo::proj::crs::DerivedCRS
+
+#include <crs.hpp>
+

A derived coordinate reference system which has either a geodetic or a geographic coordinate reference system as its base CRS, thereby inheriting a geodetic reference frame, and an ellipsoidal coordinate system.

+

A derived geographic CRS can be based on a geodetic CRS only if that geodetic CRS definition includes an ellipsoid.

+

+

Remark

+

Implements DerivedGeographicCRS from ISO 19111:2019

+
+

+
+

Public Functions

+
+
+const GeodeticCRSNNPtr baseCRS() const
+

Return the base CRS (a GeodeticCRS) of a DerivedGeographicCRS.

+
+
Returns
+

the base CRS.

+
+
+
+ +
+
+DerivedGeographicCRSNNPtr demoteTo2D(const std::string &newName, const io::DatabaseContextPtr &dbContext) const
+

Return a variant of this CRS “demoted” to a 2D one, if not already the case.

+

+
Since

8.1.1

+
+
+

+
+
Parameters
+
    +
  • newName – Name of the new CRS. If empty, nameStr() will be used.

  • +
  • dbContext – Database context to look for potentially already registered 2D CRS. May be nullptr.

  • +
+
+
Returns
+

a new CRS demoted to 2D, or the current one if already 2D or not applicable.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static DerivedGeographicCRSNNPtr create(const util::PropertyMap &properties, const GeodeticCRSNNPtr &baseCRSIn, const operation::ConversionNNPtr &derivingConversionIn, const cs::EllipsoidalCSNNPtr &csIn)
+

Instantiate a DerivedGeographicCRS from a base CRS, a deriving conversion and a cs::EllipsoidalCS.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • baseCRSIn – base CRS.

  • +
  • derivingConversionIn – the deriving conversion from the base CRS to this CRS.

  • +
  • csIn – the coordinate system.

  • +
+
+
Returns
+

new DerivedGeographicCRS.

+
+
+
+ +
+
+ +
+
+class DerivedParametricCRS : public osgeo::proj::crs::DerivedCRSTemplate<DerivedParametricCRSTraits>
+
+#include <crs.hpp>
+

A derived coordinate reference system which has a parametric coordinate reference system as its base CRS, thereby inheriting a parametric datum, and a parametric coordinate system.

+

+

Remark

+

Implements DerivedParametricCRS from ISO 19111:2019

+
+

+
+ +
+
+class DerivedProjectedCRS : public osgeo::proj::crs::DerivedCRS
+
+#include <crs.hpp>
+

A derived coordinate reference system which has a projected coordinate reference system as its base CRS, thereby inheriting a geodetic reference frame, but also inheriting the distortion characteristics of the base projected CRS.

+

A DerivedProjectedCRS is not a ProjectedCRS.

+

+

Remark

+

Implements DerivedProjectedCRS from ISO 19111:2019

+
+

+
+

Public Functions

+
+
+const ProjectedCRSNNPtr baseCRS() const
+

Return the base CRS (a ProjectedCRS) of a DerivedProjectedCRS.

+
+
Returns
+

the base CRS.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static DerivedProjectedCRSNNPtr create(const util::PropertyMap &properties, const ProjectedCRSNNPtr &baseCRSIn, const operation::ConversionNNPtr &derivingConversionIn, const cs::CoordinateSystemNNPtr &csIn)
+

Instantiate a DerivedProjectedCRS from a base CRS, a deriving conversion and a cs::CS.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • baseCRSIn – base CRS.

  • +
  • derivingConversionIn – the deriving conversion from the base CRS to this CRS.

  • +
  • csIn – the coordinate system.

  • +
+
+
Returns
+

new DerivedProjectedCRS.

+
+
+
+ +
+
+ +
+
+class DerivedTemporalCRS : public osgeo::proj::crs::DerivedCRSTemplate<DerivedTemporalCRSTraits>
+
+#include <crs.hpp>
+

A derived coordinate reference system which has a temporal coordinate reference system as its base CRS, thereby inheriting a temporal datum, and a temporal coordinate system.

+

+

Remark

+

Implements DerivedTemporalCRS from ISO 19111:2019

+
+

+
+ +
+
+class DerivedVerticalCRS : public osgeo::proj::crs::VerticalCRS, public osgeo::proj::crs::DerivedCRS
+
+#include <crs.hpp>
+

A derived coordinate reference system which has a vertical coordinate reference system as its base CRS, thereby inheriting a vertical reference frame, and a vertical coordinate system.

+

+

Remark

+

Implements DerivedVerticalCRS from ISO 19111:2019

+
+

+
+

Public Functions

+
+
+const VerticalCRSNNPtr baseCRS() const
+

Return the base CRS (a VerticalCRS) of a DerivedVerticalCRS.

+
+
Returns
+

the base CRS.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static DerivedVerticalCRSNNPtr create(const util::PropertyMap &properties, const VerticalCRSNNPtr &baseCRSIn, const operation::ConversionNNPtr &derivingConversionIn, const cs::VerticalCSNNPtr &csIn)
+

Instantiate a DerivedVerticalCRS from a base CRS, a deriving conversion and a cs::VerticalCS.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • baseCRSIn – base CRS.

  • +
  • derivingConversionIn – the deriving conversion from the base CRS to this CRS.

  • +
  • csIn – the coordinate system.

  • +
+
+
Returns
+

new DerivedVerticalCRS.

+
+
+
+ +
+
+ +
+
+class EngineeringCRS : public virtual osgeo::proj::crs::SingleCRS
+
+#include <crs.hpp>
+

Contextually local coordinate reference system associated with an engineering datum.

+

It is applied either to activities on or near the surface of the Earth without geodetic corrections, or on moving platforms such as road vehicles, vessels, aircraft or spacecraft, or as the internal CRS of an image.

+

In WKT2 standard, it maps to a ENGINEERINGCRS / ENGCRS keyword. In WKT1 specification, it maps to a LOCAL_CS keyword.

+

+

Remark

+

Implements EngineeringCRS from ISO 19111:2019

+
+

+
+

Public Functions

+
+
+const datum::EngineeringDatumNNPtr datum() const
+

Return the datum::EngineeringDatum associated with the CRS.

+
+
Returns
+

a EngineeringDatum

+
+
+
+ +
+
+

Public Static Functions

+
+
+static EngineeringCRSNNPtr create(const util::PropertyMap &properties, const datum::EngineeringDatumNNPtr &datumIn, const cs::CoordinateSystemNNPtr &csIn)
+

Instantiate a EngineeringCRS from a datum and a coordinate system.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • datumIn – the datum.

  • +
  • csIn – the coordinate system.

  • +
+
+
Returns
+

new EngineeringCRS.

+
+
+
+ +
+
+ +
+
+class GeodeticCRS : public virtual osgeo::proj::crs::SingleCRS, public osgeo::proj::io::IPROJStringExportable
+
+#include <crs.hpp>
+

A coordinate reference system associated with a geodetic reference frame and a three-dimensional Cartesian or spherical coordinate system.

+

If the geodetic reference frame is dynamic or if the geodetic CRS has an association to a velocity model then the geodetic CRS is dynamic, else it is static.

+

+

Remark

+

Implements GeodeticCRS from ISO 19111:2019

+
+

+

Subclassed by osgeo::proj::crs::DerivedGeodeticCRS, osgeo::proj::crs::GeographicCRS

+
+

Public Functions

+
+
+const datum::GeodeticReferenceFramePtr &datum()
+

Return the datum::GeodeticReferenceFrame associated with the CRS.

+
+
Returns
+

a GeodeticReferenceFrame or null (in which case datumEnsemble() should return a non-null pointer.)

+
+
+
+ +
+
+const datum::PrimeMeridianNNPtr &primeMeridian()
+

Return the PrimeMeridian associated with the GeodeticReferenceFrame or with one of the GeodeticReferenceFrame of the datumEnsemble().

+
+
Returns
+

the PrimeMeridian.

+
+
+
+ +
+
+const datum::EllipsoidNNPtr &ellipsoid()
+

Return the ellipsoid associated with the GeodeticReferenceFrame or with one of the GeodeticReferenceFrame of the datumEnsemble().

+
+
Returns
+

the PrimeMeridian.

+
+
+
+ +
+
+const std::vector<operation::PointMotionOperationNNPtr> &velocityModel()
+

Return the velocity model associated with the CRS.

+
+
Returns
+

a velocity model. might be null.

+
+
+
+ +
+
+bool isGeocentric()
+

Return whether the CRS is a Cartesian geocentric one.

+

A geocentric CRS is a geodetic CRS that has a Cartesian coordinate system with three axis, whose direction is respectively cs::AxisDirection::GEOCENTRIC_X, cs::AxisDirection::GEOCENTRIC_Y and cs::AxisDirection::GEOCENTRIC_Z.

+
+
Returns
+

true if the CRS is a geocentric CRS.

+
+
+
+ +
+
+bool isSphericalPlanetocentric()
+

Return whether the CRS is a Spherical planetocentric one.

+

A Spherical planetocentric CRS is a geodetic CRS that has a spherical (angular) coordinate system with 2 axis, which represent geocentric latitude/ longitude or longitude/geocentric latitude.

+

Such CRS are typically used in use case that apply to non-Earth bodies.

+

+
Since

8.2

+
+
+

+
+
Returns
+

true if the CRS is a Spherical planetocentric CRS.

+
+
+
+ +
+
+std::list<std::pair<GeodeticCRSNNPtr, int>> identify(const io::AuthorityFactoryPtr &authorityFactory) const
+

Identify the CRS with reference CRSs.

+

The candidate CRSs are either hard-coded, or looked in the database when authorityFactory is not null.

+

Note that the implementation uses a set of heuristics to have a good compromise of successful identifications over execution time. It might miss legitimate matches in some circumstances.

+

The method returns a list of matching reference CRS, and the percentage (0-100) of confidence in the match:

    +
  • 100% means that the name of the reference entry perfectly matches the CRS name, and both are equivalent. In which case a single result is returned. Note: in the case of a GeographicCRS whose axis order is implicit in the input definition (for example ESRI WKT), then axis order is ignored for the purpose of identification. That is the CRS

    built from GEOGCS[“GCS_WGS_1984”,DATUM[“D_WGS_1984”,SPHEROID[“WGS_1984”,6378137.0,298.257223563]], PRIMEM[“Greenwich”,0.0],UNIT[“Degree”,0.0174532925199433]] will be identified to EPSG:4326, but will not pass a isEquivalentTo(EPSG_4326, util::IComparable::Criterion::EQUIVALENT) test, but rather isEquivalentTo(EPSG_4326,

    +

    util::IComparable::Criterion::EQUIVALENT_EXCEPT_AXIS_ORDER_GEOGCRS)

    +

  • +
  • 90% means that CRS are equivalent, but the names are not exactly the same.

  • +
  • 70% means that CRS are equivalent (equivalent datum and coordinate system), but the names are not equivalent.

  • +
  • 60% means that ellipsoid, prime meridian and coordinate systems are equivalent, but the CRS and datum names do not match.

  • +
  • 25% means that the CRS are not equivalent, but there is some similarity in the names.

  • +
+

+
+
Parameters
+

authorityFactory – Authority factory (or null, but degraded functionality)

+
+
Returns
+

a list of matching reference CRS, and the percentage (0-100) of confidence in the match.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static GeodeticCRSNNPtr create(const util::PropertyMap &properties, const datum::GeodeticReferenceFrameNNPtr &datum, const cs::SphericalCSNNPtr &cs)
+

Instantiate a GeodeticCRS from a datum::GeodeticReferenceFrame and a cs::SphericalCS.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • datum – The datum of the CRS.

  • +
  • cs – a SphericalCS.

  • +
+
+
Returns
+

new GeodeticCRS.

+
+
+
+ +
+
+static GeodeticCRSNNPtr create(const util::PropertyMap &properties, const datum::GeodeticReferenceFrameNNPtr &datum, const cs::CartesianCSNNPtr &cs)
+

Instantiate a GeodeticCRS from a datum::GeodeticReferenceFrame and a cs::CartesianCS.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • datum – The datum of the CRS.

  • +
  • cs – a CartesianCS.

  • +
+
+
Returns
+

new GeodeticCRS.

+
+
+
+ +
+
+static GeodeticCRSNNPtr create(const util::PropertyMap &properties, const datum::GeodeticReferenceFramePtr &datum, const datum::DatumEnsemblePtr &datumEnsemble, const cs::SphericalCSNNPtr &cs)
+

Instantiate a GeodeticCRS from a datum::GeodeticReferenceFrame or datum::DatumEnsemble and a cs::SphericalCS.

+

One and only one of datum or datumEnsemble should be set to a non-null value.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • datum – The datum of the CRS, or nullptr

  • +
  • datumEnsemble – The datum ensemble of the CRS, or nullptr.

  • +
  • cs – a SphericalCS.

  • +
+
+
Returns
+

new GeodeticCRS.

+
+
+
+ +
+
+static GeodeticCRSNNPtr create(const util::PropertyMap &properties, const datum::GeodeticReferenceFramePtr &datum, const datum::DatumEnsemblePtr &datumEnsemble, const cs::CartesianCSNNPtr &cs)
+

Instantiate a GeodeticCRS from a datum::GeodeticReferenceFrame or datum::DatumEnsemble and a cs::CartesianCS.

+

One and only one of datum or datumEnsemble should be set to a non-null value.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • datum – The datum of the CRS, or nullptr

  • +
  • datumEnsemble – The datum ensemble of the CRS, or nullptr.

  • +
  • cs – a CartesianCS

  • +
+
+
Returns
+

new GeodeticCRS.

+
+
+
+ +
+
+

Public Static Attributes

+
+
+static const GeodeticCRSNNPtr EPSG_4978
+

EPSG:4978 / “WGS 84” Geocentric.

+
+ +
+
+ +
+
+class GeographicCRS : public osgeo::proj::crs::GeodeticCRS
+
+#include <crs.hpp>
+

A coordinate reference system associated with a geodetic reference frame and a two- or three-dimensional ellipsoidal coordinate system.

+

If the geodetic reference frame is dynamic or if the geographic CRS has an association to a velocity model then the geodetic CRS is dynamic, else it is static.

+

+

Remark

+

Implements GeographicCRS from ISO 19111:2019

+
+

+

Subclassed by osgeo::proj::crs::DerivedGeographicCRS

+
+

Public Functions

+
+
+const cs::EllipsoidalCSNNPtr &coordinateSystem()
+

Return the cs::EllipsoidalCS associated with the CRS.

+
+
Returns
+

a EllipsoidalCS.

+
+
+
+ +
+
+GeographicCRSNNPtr demoteTo2D(const std::string &newName, const io::DatabaseContextPtr &dbContext) const
+

Return a variant of this CRS “demoted” to a 2D one, if not already the case.

+

+
Since

6.3

+
+
+

+
+
Parameters
+
    +
  • newName – Name of the new CRS. If empty, nameStr() will be used.

  • +
  • dbContext – Database context to look for potentially already registered 2D CRS. May be nullptr.

  • +
+
+
Returns
+

a new CRS demoted to 2D, or the current one if already 2D or not applicable.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static GeographicCRSNNPtr create(const util::PropertyMap &properties, const datum::GeodeticReferenceFrameNNPtr &datum, const cs::EllipsoidalCSNNPtr &cs)
+

Instantiate a GeographicCRS from a datum::GeodeticReferenceFrameNNPtr and a cs::EllipsoidalCS.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • datum – The datum of the CRS.

  • +
  • cs – a EllipsoidalCS.

  • +
+
+
Returns
+

new GeographicCRS.

+
+
+
+ +
+
+static GeographicCRSNNPtr create(const util::PropertyMap &properties, const datum::GeodeticReferenceFramePtr &datum, const datum::DatumEnsemblePtr &datumEnsemble, const cs::EllipsoidalCSNNPtr &cs)
+

Instantiate a GeographicCRS from a datum::GeodeticReferenceFramePtr or datum::DatumEnsemble and a cs::EllipsoidalCS.

+

One and only one of datum or datumEnsemble should be set to a non-null value.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • datum – The datum of the CRS, or nullptr

  • +
  • datumEnsemble – The datum ensemble of the CRS, or nullptr.

  • +
  • cs – a EllipsoidalCS.

  • +
+
+
Returns
+

new GeographicCRS.

+
+
+
+ +
+
+

Public Static Attributes

+
+
+static const GeographicCRSNNPtr EPSG_4267
+

EPSG:4267 / “NAD27” 2D GeographicCRS.

+
+ +
+
+static const GeographicCRSNNPtr EPSG_4269
+

EPSG:4269 / “NAD83” 2D GeographicCRS.

+
+ +
+
+static const GeographicCRSNNPtr EPSG_4326
+

EPSG:4326 / “WGS 84” 2D GeographicCRS.

+
+ +
+
+static const GeographicCRSNNPtr OGC_CRS84
+

OGC:CRS84 / “CRS 84” 2D GeographicCRS (long, lat)

+
+ +
+
+static const GeographicCRSNNPtr EPSG_4807
+

EPSG:4807 / “NTF (Paris)” 2D GeographicCRS.

+
+ +
+
+static const GeographicCRSNNPtr EPSG_4979
+

EPSG:4979 / “WGS 84” 3D GeographicCRS.

+
+ +
+
+ +
+
+class InvalidCompoundCRSException : public osgeo::proj::util::Exception
+
+#include <crs.hpp>
+

Exception thrown when attempting to create an invalid compound CRS.

+
+ +
+
+class ParametricCRS : public virtual osgeo::proj::crs::SingleCRS
+
+#include <crs.hpp>
+

Contextually local coordinate reference system associated with an engineering datum.

+

This is applied either to activities on or near the surface of the Earth without geodetic corrections, or on moving platforms such as road vehicles vessels, aircraft or spacecraft, or as the internal CRS of an image.

+

+

Remark

+

Implements ParametricCRS from ISO 19111:2019

+
+

+
+

Public Functions

+
+
+const datum::ParametricDatumNNPtr datum() const
+

Return the datum::ParametricDatum associated with the CRS.

+
+
Returns
+

a ParametricDatum

+
+
+
+ +
+
+const cs::ParametricCSNNPtr coordinateSystem() const
+

Return the cs::TemporalCS associated with the CRS.

+
+
Returns
+

a TemporalCS

+
+
+
+ +
+
+

Public Static Functions

+
+
+static ParametricCRSNNPtr create(const util::PropertyMap &properties, const datum::ParametricDatumNNPtr &datumIn, const cs::ParametricCSNNPtr &csIn)
+

Instantiate a ParametricCRS from a datum and a coordinate system.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • datumIn – the datum.

  • +
  • csIn – the coordinate system.

  • +
+
+
Returns
+

new ParametricCRS.

+
+
+
+ +
+
+ +
+
+class ProjectedCRS : public osgeo::proj::crs::DerivedCRS, public osgeo::proj::io::IPROJStringExportable
+
+#include <crs.hpp>
+

A derived coordinate reference system which has a geodetic (usually geographic) coordinate reference system as its base CRS, thereby inheriting a geodetic reference frame, and is converted using a map projection.

+

It has a Cartesian coordinate system, usually two-dimensional but may be three-dimensional; in the 3D case the base geographic CRSs ellipsoidal height is passed through unchanged and forms the vertical axis of the projected CRS’s Cartesian coordinate system.

+

+

Remark

+

Implements ProjectedCRS from ISO 19111:2019

+
+

+
+

Public Functions

+
+
+const GeodeticCRSNNPtr &baseCRS()
+

Return the base CRS (a GeodeticCRS, which is generally a GeographicCRS) of the ProjectedCRS.

+
+
Returns
+

the base CRS.

+
+
+
+ +
+
+const cs::CartesianCSNNPtr &coordinateSystem()
+

Return the cs::CartesianCS associated with the CRS.

+
+
Returns
+

a CartesianCS

+
+
+
+ +
+
+std::list<std::pair<ProjectedCRSNNPtr, int>> identify(const io::AuthorityFactoryPtr &authorityFactory) const
+

Identify the CRS with reference CRSs.

+

The candidate CRSs are either hard-coded, or looked in the database when authorityFactory is not null.

+

Note that the implementation uses a set of heuristics to have a good compromise of successful identifications over execution time. It might miss legitimate matches in some circumstances.

+

The method returns a list of matching reference CRS, and the percentage (0-100) of confidence in the match. The list is sorted by decreasing confidence.

+

100% means that the name of the reference entry perfectly matches the CRS name, and both are equivalent. In which case a single result is returned. 90% means that CRS are equivalent, but the names are not exactly the same. 70% means that CRS are equivalent (equivalent base CRS, conversion and coordinate system), but the names are not equivalent. 60% means that CRS have strong similarity (equivalent base datum, conversion and coordinate system), but the names are not equivalent. 50% means that CRS have similarity (equivalent base ellipsoid and conversion), but the coordinate system do not match (e.g. different axis ordering or axis unit). 25% means that the CRS are not equivalent, but there is some similarity in the names.

+

For the purpose of this function, equivalence is tested with the util::IComparable::Criterion::EQUIVALENT_EXCEPT_AXIS_ORDER_GEOGCRS, that is to say that the axis order of the base GeographicCRS is ignored.

+
+
Parameters
+

authorityFactory – Authority factory (or null, but degraded functionality)

+
+
Returns
+

a list of matching reference CRS, and the percentage (0-100) of confidence in the match.

+
+
+
+ +
+
+ProjectedCRSNNPtr demoteTo2D(const std::string &newName, const io::DatabaseContextPtr &dbContext) const
+

Return a variant of this CRS “demoted” to a 2D one, if not already the case.

+

+
Since

6.3

+
+
+

+
+
Parameters
+
    +
  • newName – Name of the new CRS. If empty, nameStr() will be used.

  • +
  • dbContext – Database context to look for potentially already registered 2D CRS. May be nullptr.

  • +
+
+
Returns
+

a new CRS demoted to 2D, or the current one if already 2D or not applicable.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static ProjectedCRSNNPtr create(const util::PropertyMap &properties, const GeodeticCRSNNPtr &baseCRSIn, const operation::ConversionNNPtr &derivingConversionIn, const cs::CartesianCSNNPtr &csIn)
+

Instantiate a ProjectedCRS from a base CRS, a deriving operation::Conversion and a coordinate system.

+
+
Parameters
+
+
+
Returns
+

new ProjectedCRS.

+
+
+
+ +
+
+ +
+
+class SingleCRS : public osgeo::proj::crs::CRS
+
+#include <crs.hpp>
+

Abstract class modelling a coordinate reference system consisting of one Coordinate System and either one datum::Datum or one datum::DatumEnsemble.

+

+

Remark

+

Implements SingleCRS from ISO 19111:2019

+
+

+

Subclassed by osgeo::proj::crs::DerivedCRS, osgeo::proj::crs::EngineeringCRS, osgeo::proj::crs::GeodeticCRS, osgeo::proj::crs::ParametricCRS, osgeo::proj::crs::TemporalCRS, osgeo::proj::crs::VerticalCRS

+
+

Public Functions

+
+
+const datum::DatumPtr &datum()
+

Return the datum::Datum associated with the CRS.

+

This might be null, in which case datumEnsemble() return will not be null.

+
+
Returns
+

a Datum that might be null.

+
+
+
+ +
+
+const datum::DatumEnsemblePtr &datumEnsemble()
+

Return the datum::DatumEnsemble associated with the CRS.

+

This might be null, in which case datum() return will not be null.

+
+
Returns
+

a DatumEnsemble that might be null.

+
+
+
+ +
+
+const cs::CoordinateSystemNNPtr &coordinateSystem()
+

Return the cs::CoordinateSystem associated with the CRS.

+
+
Returns
+

a CoordinateSystem.

+
+
+
+ +
+
+ +
+
+class TemporalCRS : public virtual osgeo::proj::crs::SingleCRS
+
+#include <crs.hpp>
+

A coordinate reference system associated with a temporal datum and a one-dimensional temporal coordinate system.

+

+

Remark

+

Implements TemporalCRS from ISO 19111:2019

+
+

+
+

Public Functions

+
+
+const datum::TemporalDatumNNPtr datum() const
+

Return the datum::TemporalDatum associated with the CRS.

+
+
Returns
+

a TemporalDatum

+
+
+
+ +
+
+const cs::TemporalCSNNPtr coordinateSystem() const
+

Return the cs::TemporalCS associated with the CRS.

+
+
Returns
+

a TemporalCS

+
+
+
+ +
+
+

Public Static Functions

+
+
+static TemporalCRSNNPtr create(const util::PropertyMap &properties, const datum::TemporalDatumNNPtr &datumIn, const cs::TemporalCSNNPtr &csIn)
+

Instantiate a TemporalCRS from a datum and a coordinate system.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • datumIn – the datum.

  • +
  • csIn – the coordinate system.

  • +
+
+
Returns
+

new TemporalCRS.

+
+
+
+ +
+
+ +
+
+class VerticalCRS : public virtual osgeo::proj::crs::SingleCRS, public osgeo::proj::io::IPROJStringExportable
+
+#include <crs.hpp>
+

A coordinate reference system having a vertical reference frame and a one-dimensional vertical coordinate system used for recording gravity-related heights or depths.

+

Vertical CRSs make use of the direction of gravity to define the concept of height or depth, but the relationship with gravity may not be straightforward. If the vertical reference frame is dynamic or if the vertical CRS has an association to a velocity model then the CRS is dynamic, else it is static.

+

+

Remark

+

Implements VerticalCRS from ISO 19111:2019

+
+

+
+

Note

+

Ellipsoidal heights cannot be captured in a vertical coordinate reference system. They exist only as an inseparable part of a 3D coordinate tuple defined in a geographic 3D coordinate reference system.

+
+

Subclassed by osgeo::proj::crs::DerivedVerticalCRS

+
+

Public Functions

+
+
+const datum::VerticalReferenceFramePtr datum() const
+

Return the datum::VerticalReferenceFrame associated with the CRS.

+
+
Returns
+

a VerticalReferenceFrame.

+
+
+
+ +
+
+const cs::VerticalCSNNPtr coordinateSystem() const
+

Return the cs::VerticalCS associated with the CRS.

+
+
Returns
+

a VerticalCS.

+
+
+
+ +
+
+const std::vector<operation::TransformationNNPtr> &geoidModel()
+

Return the geoid model associated with the CRS.

+

Geoid height model or height correction model linked to a geoid-based vertical CRS.

+
+
Returns
+

a geoid model. might be null

+
+
+
+ +
+
+const std::vector<operation::PointMotionOperationNNPtr> &velocityModel()
+

Return the velocity model associated with the CRS.

+
+
Returns
+

a velocity model. might be null.

+
+
+
+ +
+
+std::list<std::pair<VerticalCRSNNPtr, int>> identify(const io::AuthorityFactoryPtr &authorityFactory) const
+

Identify the CRS with reference CRSs.

+

The candidate CRSs are looked in the database when authorityFactory is not null.

+

Note that the implementation uses a set of heuristics to have a good compromise of successful identifications over execution time. It might miss legitimate matches in some circumstances.

+

The method returns a list of matching reference CRS, and the percentage (0-100) of confidence in the match. 100% means that the name of the reference entry perfectly matches the CRS name, and both are equivalent. In which case a single result is returned. 90% means that CRS are equivalent, but the names are not exactly the same. 70% means that CRS are equivalent (equivalent datum and coordinate system), but the names are not equivalent. 25% means that the CRS are not equivalent, but there is some similarity in the names.

+
+
Parameters
+

authorityFactory – Authority factory (if null, will return an empty list)

+
+
Returns
+

a list of matching reference CRS, and the percentage (0-100) of confidence in the match.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static VerticalCRSNNPtr create(const util::PropertyMap &properties, const datum::VerticalReferenceFrameNNPtr &datumIn, const cs::VerticalCSNNPtr &csIn)
+

Instantiate a VerticalCRS from a datum::VerticalReferenceFrame and a cs::VerticalCS.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined. The GEOID_MODEL property can be set to a TransformationNNPtr object.

  • +
  • datumIn – The datum of the CRS.

  • +
  • csIn – a VerticalCS.

  • +
+
+
Returns
+

new VerticalCRS.

+
+
+
+ +
+
+static VerticalCRSNNPtr create(const util::PropertyMap &properties, const datum::VerticalReferenceFramePtr &datumIn, const datum::DatumEnsemblePtr &datumEnsembleIn, const cs::VerticalCSNNPtr &csIn)
+

Instantiate a VerticalCRS from a datum::VerticalReferenceFrame or datum::DatumEnsemble and a cs::VerticalCS.

+

One and only one of datum or datumEnsemble should be set to a non-null value.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined. The GEOID_MODEL property can be set to a TransformationNNPtr object.

  • +
  • datumIn – The datum of the CRS, or nullptr

  • +
  • datumEnsembleIn – The datum ensemble of the CRS, or nullptr.

  • +
  • csIn – a VerticalCS.

  • +
+
+
Returns
+

new VerticalCRS.

+
+
+
+ +
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/development/reference/cpp/cs.html b/development/reference/cpp/cs.html new file mode 100644 index 00000000..688b5800 --- /dev/null +++ b/development/reference/cpp/cs.html @@ -0,0 +1,1312 @@ + + + + + + + cs namespace — PROJ 9.0.0 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

cs namespace

+
+
+namespace osgeo::proj::cs
+

Coordinate systems and their axis.

+

osgeo.proj.cs namespace

+
+

Typedefs

+
+
+using MeridianPtr = std::shared_ptr<Meridian>
+

Shared pointer of Meridian.

+
+ +
+
+using MeridianNNPtr = util::nn<MeridianPtr>
+

Non-null shared pointer of Meridian.

+
+ +
+
+using CoordinateSystemAxisPtr = std::shared_ptr<CoordinateSystemAxis>
+

Shared pointer of CoordinateSystemAxis.

+
+ +
+
+using CoordinateSystemAxisNNPtr = util::nn<CoordinateSystemAxisPtr>
+

Non-null shared pointer of CoordinateSystemAxis.

+
+ +
+
+typedef std::shared_ptr<CoordinateSystem> CoordinateSystemPtr
+

Shared pointer of CoordinateSystem.

+
+ +
+
+typedef util::nn<CoordinateSystemPtr> CoordinateSystemNNPtr
+

Non-null shared pointer of CoordinateSystem.

+
+ +
+
+using SphericalCSPtr = std::shared_ptr<SphericalCS>
+

Shared pointer of SphericalCS.

+
+ +
+
+using SphericalCSNNPtr = util::nn<SphericalCSPtr>
+

Non-null shared pointer of SphericalCS.

+
+ +
+
+using EllipsoidalCSPtr = std::shared_ptr<EllipsoidalCS>
+

Shared pointer of EllipsoidalCS.

+
+ +
+
+using EllipsoidalCSNNPtr = util::nn<EllipsoidalCSPtr>
+

Non-null shared pointer of EllipsoidalCS.

+
+ +
+
+using VerticalCSPtr = std::shared_ptr<VerticalCS>
+

Shared pointer of VerticalCS.

+
+ +
+
+using VerticalCSNNPtr = util::nn<VerticalCSPtr>
+

Non-null shared pointer of VerticalCS.

+
+ +
+
+using CartesianCSPtr = std::shared_ptr<CartesianCS>
+

Shared pointer of CartesianCS.

+
+ +
+
+using CartesianCSNNPtr = util::nn<CartesianCSPtr>
+

Non-null shared pointer of CartesianCS.

+
+ +
+
+using OrdinalCSPtr = std::shared_ptr<OrdinalCS>
+

Shared pointer of OrdinalCS.

+
+ +
+
+using OrdinalCSNNPtr = util::nn<OrdinalCSPtr>
+

Non-null shared pointer of OrdinalCS.

+
+ +
+
+using ParametricCSPtr = std::shared_ptr<ParametricCS>
+

Shared pointer of ParametricCS.

+
+ +
+
+using ParametricCSNNPtr = util::nn<ParametricCSPtr>
+

Non-null shared pointer of ParametricCS.

+
+ +
+
+using TemporalCSPtr = std::shared_ptr<TemporalCS>
+

Shared pointer of TemporalCS.

+
+ +
+
+using TemporalCSNNPtr = util::nn<TemporalCSPtr>
+

Non-null shared pointer of TemporalCS.

+
+ +
+
+using DateTimeTemporalCSPtr = std::shared_ptr<DateTimeTemporalCS>
+

Shared pointer of DateTimeTemporalCS.

+
+ +
+
+using DateTimeTemporalCSNNPtr = util::nn<DateTimeTemporalCSPtr>
+

Non-null shared pointer of DateTimeTemporalCS.

+
+ +
+
+using TemporalCountCSPtr = std::shared_ptr<TemporalCountCS>
+

Shared pointer of TemporalCountCS.

+
+ +
+
+using TemporalCountCSNNPtr = util::nn<TemporalCountCSPtr>
+

Non-null shared pointer of TemporalCountCS.

+
+ +
+
+using TemporalMeasureCSPtr = std::shared_ptr<TemporalMeasureCS>
+

Shared pointer of TemporalMeasureCS.

+
+ +
+
+using TemporalMeasureCSNNPtr = util::nn<TemporalMeasureCSPtr>
+

Non-null shared pointer of TemporalMeasureCS.

+
+ +
+
+
+class AxisDirection : public osgeo::proj::util::CodeList
+
+#include <coordinatesystem.hpp>
+

The direction of positive increase in the coordinate value for a coordinate system axis.

+

+

Remark

+

Implements AxisDirection from ISO 19111:2019

+
+

+
+

Public Static Attributes

+
+
+static const AxisDirection NORTH
+

Axis positive direction is north. In a geodetic or projected CRS, north is defined through the geodetic reference frame. In an engineering CRS, north may be defined with respect to an engineering object rather than a geographical direction.

+
+ +
+
+static const AxisDirection NORTH_NORTH_EAST
+

Axis positive direction is approximately north-north-east.

+
+ +
+
+static const AxisDirection NORTH_EAST
+

Axis positive direction is approximately north-east.

+
+ +
+
+static const AxisDirection EAST_NORTH_EAST
+

Axis positive direction is approximately east-north-east.

+
+ +
+
+static const AxisDirection EAST
+

Axis positive direction is 90deg clockwise from north.

+
+ +
+
+static const AxisDirection EAST_SOUTH_EAST
+

Axis positive direction is approximately east-south-east.

+
+ +
+
+static const AxisDirection SOUTH_EAST
+

Axis positive direction is approximately south-east.

+
+ +
+
+static const AxisDirection SOUTH_SOUTH_EAST
+

Axis positive direction is approximately south-south-east.

+
+ +
+
+static const AxisDirection SOUTH
+

Axis positive direction is 180deg clockwise from north.

+
+ +
+
+static const AxisDirection SOUTH_SOUTH_WEST
+

Axis positive direction is approximately south-south-west.

+
+ +
+
+static const AxisDirection SOUTH_WEST
+

Axis positive direction is approximately south-west.

+
+ +
+
+static const AxisDirection WEST_SOUTH_WEST
+

Axis positive direction is approximately west-south-west.

+
+ +
+
+static const AxisDirection WEST
+

Axis positive direction is 270deg clockwise from north.

+
+ +
+
+static const AxisDirection WEST_NORTH_WEST
+

Axis positive direction is approximately west-north-west.

+
+ +
+
+static const AxisDirection NORTH_WEST
+

Axis positive direction is approximately north-west.

+
+ +
+
+static const AxisDirection NORTH_NORTH_WEST
+

Axis positive direction is approximately north-north-west.

+
+ +
+
+static const AxisDirection UP
+

Axis positive direction is up relative to gravity.

+
+ +
+
+static const AxisDirection DOWN
+

Axis positive direction is down relative to gravity.

+
+ +
+
+static const AxisDirection GEOCENTRIC_X
+

Axis positive direction is in the equatorial plane from the centre of the modelled Earth towards the intersection of the equator with the prime meridian.

+
+ +
+
+static const AxisDirection GEOCENTRIC_Y
+

Axis positive direction is in the equatorial plane from the centre of the modelled Earth towards the intersection of the equator and the meridian 90deg eastwards from the prime meridian.

+
+ +
+
+static const AxisDirection GEOCENTRIC_Z
+

Axis positive direction is from the centre of the modelled Earth parallel to its rotation axis and towards its north pole.

+
+ +
+
+static const AxisDirection COLUMN_POSITIVE
+

Axis positive direction is towards higher pixel column.

+
+ +
+
+static const AxisDirection COLUMN_NEGATIVE
+

Axis positive direction is towards lower pixel column.

+
+ +
+
+static const AxisDirection ROW_POSITIVE
+

Axis positive direction is towards higher pixel row.

+
+ +
+
+static const AxisDirection ROW_NEGATIVE
+

Axis positive direction is towards lower pixel row.

+
+ +
+
+static const AxisDirection DISPLAY_RIGHT
+

Axis positive direction is right in display.

+
+ +
+
+static const AxisDirection DISPLAY_LEFT
+

Axis positive direction is left in display.

+
+ +
+
+static const AxisDirection DISPLAY_UP
+

Axis positive direction is towards top of approximately vertical display surface.

+
+ +
+
+static const AxisDirection DISPLAY_DOWN
+

Axis positive direction is towards bottom of approximately vertical display surface.

+
+ +
+
+static const AxisDirection FORWARD
+

Axis positive direction is forward; for an observer at the centre of the object this is will be towards its front, bow or nose.

+
+ +
+
+static const AxisDirection AFT
+

Axis positive direction is aft; for an observer at the centre of the object this will be towards its back, stern or tail.

+
+ +
+
+static const AxisDirection PORT
+

Axis positive direction is port; for an observer at the centre of the object this will be towards its left.

+
+ +
+
+static const AxisDirection STARBOARD
+

Axis positive direction is starboard; for an observer at the centre of the object this will be towards its right.

+
+ +
+
+static const AxisDirection CLOCKWISE
+

Axis positive direction is clockwise from a specified direction.

+
+ +
+
+static const AxisDirection COUNTER_CLOCKWISE
+

Axis positive direction is counter clockwise from a specified direction.

+
+ +
+
+static const AxisDirection TOWARDS
+

Axis positive direction is towards the object.

+
+ +
+
+static const AxisDirection AWAY_FROM
+

Axis positive direction is away from the object.

+
+ +
+
+static const AxisDirection FUTURE
+

Temporal axis positive direction is towards the future.

+
+ +
+
+static const AxisDirection PAST
+

Temporal axis positive direction is towards the past.

+
+ +
+
+static const AxisDirection UNSPECIFIED
+

Axis positive direction is unspecified.

+
+ +
+
+ +
+
+class CartesianCS : public osgeo::proj::cs::CoordinateSystem
+
+#include <coordinatesystem.hpp>
+

A two- or three-dimensional coordinate system in Euclidean space with orthogonal straight axes.

+

All axes shall have the same length unit. A CartesianCS shall have two or three axis associations; the number of associations shall equal the dimension of the CS.

+

+

Remark

+

Implements CartesianCS from ISO 19111:2019

+
+

+
+

Public Static Functions

+
+
+static CartesianCSNNPtr create(const util::PropertyMap &properties, const CoordinateSystemAxisNNPtr &axis1, const CoordinateSystemAxisNNPtr &axis2)
+

Instantiate a CartesianCS.

+
+
Parameters
+
    +
  • properties – See General properties.

  • +
  • axis1 – The first axis.

  • +
  • axis2 – The second axis.

  • +
+
+
Returns
+

a new CartesianCS.

+
+
+
+ +
+
+static CartesianCSNNPtr create(const util::PropertyMap &properties, const CoordinateSystemAxisNNPtr &axis1, const CoordinateSystemAxisNNPtr &axis2, const CoordinateSystemAxisNNPtr &axis3)
+

Instantiate a CartesianCS.

+
+
Parameters
+
    +
  • properties – See General properties.

  • +
  • axis1 – The first axis.

  • +
  • axis2 – The second axis.

  • +
  • axis3 – The third axis.

  • +
+
+
Returns
+

a new CartesianCS.

+
+
+
+ +
+
+static CartesianCSNNPtr createEastingNorthing(const common::UnitOfMeasure &unit)
+

Instantiate a CartesianCS with a Easting (first) and Northing (second) axis.

+
+
Parameters
+

unit – Linear unit of the axes.

+
+
Returns
+

a new CartesianCS.

+
+
+
+ +
+
+static CartesianCSNNPtr createNorthingEasting(const common::UnitOfMeasure &unit)
+

Instantiate a CartesianCS with a Northing (first) and Easting (second) axis.

+
+
Parameters
+

unit – Linear unit of the axes.

+
+
Returns
+

a new CartesianCS.

+
+
+
+ +
+
+static CartesianCSNNPtr createNorthPoleEastingSouthNorthingSouth(const common::UnitOfMeasure &unit)
+

Instantiate a CartesianCS, north-pole centered, with a Easting (first) South-Oriented and Northing (second) South-Oriented axis.

+
+
Parameters
+

unit – Linear unit of the axes.

+
+
Returns
+

a new CartesianCS.

+
+
+
+ +
+
+static CartesianCSNNPtr createSouthPoleEastingNorthNorthingNorth(const common::UnitOfMeasure &unit)
+

Instantiate a CartesianCS, south-pole centered, with a Easting (first) North-Oriented and Northing (second) North-Oriented axis.

+
+
Parameters
+

unit – Linear unit of the axes.

+
+
Returns
+

a new CartesianCS.

+
+
+
+ +
+
+static CartesianCSNNPtr createWestingSouthing(const common::UnitOfMeasure &unit)
+

Instantiate a CartesianCS with a Westing (first) and Southing (second) axis.

+
+
Parameters
+

unit – Linear unit of the axes.

+
+
Returns
+

a new CartesianCS.

+
+
+
+ +
+
+static CartesianCSNNPtr createGeocentric(const common::UnitOfMeasure &unit)
+

Instantiate a CartesianCS with the three geocentric axes.

+
+
Parameters
+

unit – Linear unit of the axes.

+
+
Returns
+

a new CartesianCS.

+
+
+
+ +
+
+ +
+
+class CoordinateSystem : public osgeo::proj::common::IdentifiedObject, public osgeo::proj::io::IJSONExportable
+
+#include <coordinatesystem.hpp>
+

Abstract class modelling a coordinate system (CS)

+

A CS is the non-repeating sequence of coordinate system axes that spans a given coordinate space. A CS is derived from a set of mathematical rules for specifying how coordinates in a given space are to be assigned to points. The coordinate values in a coordinate tuple shall be recorded in the order in which the coordinate system axes associations are recorded.

+

+

Remark

+

Implements CoordinateSystem from ISO 19111:2019

+
+

+

Subclassed by osgeo::proj::cs::CartesianCS, osgeo::proj::cs::EllipsoidalCS, osgeo::proj::cs::OrdinalCS, osgeo::proj::cs::ParametricCS, osgeo::proj::cs::SphericalCS, osgeo::proj::cs::TemporalCS, osgeo::proj::cs::VerticalCS

+
+

Public Functions

+
+
+const std::vector<CoordinateSystemAxisNNPtr> &axisList()
+

Return the list of axes of this coordinate system.

+
+
Returns
+

the axes.

+
+
+
+ +
+
+ +
+
+class CoordinateSystemAxis : public osgeo::proj::common::IdentifiedObject, public osgeo::proj::io::IJSONExportable
+
+#include <coordinatesystem.hpp>
+

The definition of a coordinate system axis.

+

+

Remark

+

Implements CoordinateSystemAxis from ISO 19111:2019

+
+

+
+

Public Functions

+
+
+const std::string &abbreviation()
+

Return the axis abbreviation.

+

The abbreviation used for this coordinate system axis; this abbreviation is also used to identify the coordinates in the coordinate tuple. Examples are X and Y.

+
+
Returns
+

the abbreviation.

+
+
+
+ +
+
+const AxisDirection &direction()
+

Return the axis direction.

+

The direction of this coordinate system axis (or in the case of Cartesian projected coordinates, the direction of this coordinate system axis locally) Examples: north or south, east or west, up or down. Within any set of coordinate system axes, only one of each pair of terms can be used. For Earth-fixed CRSs, this direction is often approximate and intended to provide a human interpretable meaning to the axis. When a geodetic reference frame is used, the precise directions of the axes may therefore vary slightly from this approximate direction. Note that an EngineeringCRS often requires specific descriptions of the directions of its coordinate system axes.

+
+
Returns
+

the direction.

+
+
+
+ +
+
+const common::UnitOfMeasure &unit()
+

Return the axis unit.

+

This is the spatial unit or temporal quantity used for this coordinate system axis. The value of a coordinate in a coordinate tuple shall be recorded using this unit.

+
+
Returns
+

the axis unit.

+
+
+
+ +
+
+const util::optional<double> &minimumValue()
+

Return the minimum value normally allowed for this axis, in the unit for the axis.

+
+
Returns
+

the minimum value, or empty.

+
+
+
+ +
+
+const util::optional<double> &maximumValue()
+

Return the maximum value normally allowed for this axis, in the unit for the axis.

+
+
Returns
+

the maximum value, or empty.

+
+
+
+ +
+
+const MeridianPtr &meridian()
+

Return the meridian that the axis follows from the pole, for a coordinate reference system centered on a pole.

+
+
Returns
+

the meridian, or null.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static CoordinateSystemAxisNNPtr create(const util::PropertyMap &properties, const std::string &abbreviationIn, const AxisDirection &directionIn, const common::UnitOfMeasure &unitIn, const MeridianPtr &meridianIn = nullptr)
+

Instantiate a CoordinateSystemAxis.

+
+
Parameters
+
    +
  • properties – See General properties. The name should generally be defined.

  • +
  • abbreviationIn – Axis abbreviation (might be empty)

  • +
  • directionIn – Axis direction

  • +
  • unitIn – Axis unit

  • +
  • meridianIn – The meridian that the axis follows from the pole, for a coordinate reference system centered on a pole, or nullptr

  • +
+
+
Returns
+

a new CoordinateSystemAxis.

+
+
+
+ +
+
+ +
+
+class DateTimeTemporalCS : public osgeo::proj::cs::TemporalCS
+
+#include <coordinatesystem.hpp>
+

A one-dimensional coordinate system used to record time in dateTime representation as defined in ISO 8601.

+

A DateTimeTemporalCS shall have one axis association. It does not use axisUnitID; the temporal quantities are defined through the ISO 8601 representation.

+

+

Remark

+

Implements DateTimeTemporalCS from ISO 19111:2019

+
+

+
+

Public Static Functions

+
+
+static DateTimeTemporalCSNNPtr create(const util::PropertyMap &properties, const CoordinateSystemAxisNNPtr &axis)
+

Instantiate a DateTimeTemporalCS.

+
+
Parameters
+
+
+
Returns
+

a new DateTimeTemporalCS.

+
+
+
+ +
+
+ +
+
+class EllipsoidalCS : public osgeo::proj::cs::CoordinateSystem
+
+#include <coordinatesystem.hpp>
+

A two- or three-dimensional coordinate system in which position is specified by geodetic latitude, geodetic longitude, and (in the three-dimensional case) ellipsoidal height.

+

An EllipsoidalCS shall have two or three associations.

+

+

Remark

+

Implements EllipsoidalCS from ISO 19111:2019

+
+

+
+

Public Static Functions

+
+
+static EllipsoidalCSNNPtr create(const util::PropertyMap &properties, const CoordinateSystemAxisNNPtr &axis1, const CoordinateSystemAxisNNPtr &axis2)
+

Instantiate a EllipsoidalCS.

+
+
Parameters
+
    +
  • properties – See General properties.

  • +
  • axis1 – The first axis.

  • +
  • axis2 – The second axis.

  • +
+
+
Returns
+

a new EllipsoidalCS.

+
+
+
+ +
+
+static EllipsoidalCSNNPtr create(const util::PropertyMap &properties, const CoordinateSystemAxisNNPtr &axis1, const CoordinateSystemAxisNNPtr &axis2, const CoordinateSystemAxisNNPtr &axis3)
+

Instantiate a EllipsoidalCS.

+
+
Parameters
+
    +
  • properties – See General properties.

  • +
  • axis1 – The first axis.

  • +
  • axis2 – The second axis.

  • +
  • axis3 – The third axis.

  • +
+
+
Returns
+

a new EllipsoidalCS.

+
+
+
+ +
+
+static EllipsoidalCSNNPtr createLatitudeLongitude(const common::UnitOfMeasure &unit)
+

Instantiate a EllipsoidalCS with a Latitude (first) and Longitude (second) axis.

+
+
Parameters
+

unit – Angular unit of the axes.

+
+
Returns
+

a new EllipsoidalCS.

+
+
+
+ +
+
+static EllipsoidalCSNNPtr createLatitudeLongitudeEllipsoidalHeight(const common::UnitOfMeasure &angularUnit, const common::UnitOfMeasure &linearUnit)
+

Instantiate a EllipsoidalCS with a Latitude (first), Longitude (second) axis and ellipsoidal height (third) axis.

+
+
Parameters
+
    +
  • angularUnit – Angular unit of the latitude and longitude axes.

  • +
  • linearUnit – Linear unit of the ellipsoidal height axis.

  • +
+
+
Returns
+

a new EllipsoidalCS.

+
+
+
+ +
+
+static EllipsoidalCSNNPtr createLongitudeLatitude(const common::UnitOfMeasure &unit)
+

Instantiate a EllipsoidalCS with a Longitude (first) and Latitude (second) axis.

+
+
Parameters
+

unit – Angular unit of the axes.

+
+
Returns
+

a new EllipsoidalCS.

+
+
+
+ +
+
+static EllipsoidalCSNNPtr createLongitudeLatitudeEllipsoidalHeight(const common::UnitOfMeasure &angularUnit, const common::UnitOfMeasure &linearUnit)
+

Instantiate a EllipsoidalCS with a Longitude (first), Latitude (second) axis and ellipsoidal height (third) axis.

+

+
Since

7.0

+
+
+

+
+
Parameters
+
    +
  • angularUnit – Angular unit of the latitude and longitude axes.

  • +
  • linearUnit – Linear unit of the ellipsoidal height axis.

  • +
+
+
Returns
+

a new EllipsoidalCS.

+
+
+
+ +
+
+ +
+
+class Meridian : public osgeo::proj::common::IdentifiedObject
+
+#include <coordinatesystem.hpp>
+

The meridian that the axis follows from the pole, for a coordinate reference system centered on a pole.

+

+

Remark

+

Implements MERIDIAN from WKT2 standard

+
+

+
+

Note

+

There is no modelling for this concept in ISO 19111:2019

+
+
+

Public Functions

+
+
+const common::Angle &longitude()
+

Return the longitude of the meridian that the axis follows from the pole.

+
+
Returns
+

the longitude.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static MeridianNNPtr create(const common::Angle &longitudeIn)
+

Instantiate a Meridian.

+
+
Parameters
+

longitudeIn – longitude of the meridian that the axis follows from the pole.

+
+
Returns
+

new Meridian.

+
+
+
+ +
+
+ +
+
+class OrdinalCS : public osgeo::proj::cs::CoordinateSystem
+
+#include <coordinatesystem.hpp>
+

n-dimensional coordinate system in which every axis uses integers.

+

The number of associations shall equal the dimension of the CS.

+

+

Remark

+

Implements OrdinalCS from ISO 19111:2019

+
+

+
+

Public Static Functions

+
+
+static OrdinalCSNNPtr create(const util::PropertyMap &properties, const std::vector<CoordinateSystemAxisNNPtr> &axisIn)
+

Instantiate a OrdinalCS.

+
+
Parameters
+
+
+
Returns
+

a new OrdinalCS.

+
+
+
+ +
+
+ +
+
+class ParametricCS : public osgeo::proj::cs::CoordinateSystem
+
+#include <coordinatesystem.hpp>
+

one-dimensional coordinate reference system which uses parameter values or functions that may vary monotonically with height.

+

+

Remark

+

Implements ParametricCS from ISO 19111:2019

+
+

+
+

Public Static Functions

+
+
+static ParametricCSNNPtr create(const util::PropertyMap &properties, const CoordinateSystemAxisNNPtr &axisIn)
+

Instantiate a ParametricCS.

+
+
Parameters
+
+
+
Returns
+

a new ParametricCS.

+
+
+
+ +
+
+ +
+
+class SphericalCS : public osgeo::proj::cs::CoordinateSystem
+
+#include <coordinatesystem.hpp>
+

A three-dimensional coordinate system in Euclidean space with one distance measured from the origin and two angular coordinates.

+

Not to be confused with an ellipsoidal coordinate system based on an ellipsoid “degenerated” into a sphere. A SphericalCS shall have three axis associations.

+

+

Remark

+

Implements SphericalCS from ISO 19111:2019

+
+

+
+

Public Static Functions

+
+
+static SphericalCSNNPtr create(const util::PropertyMap &properties, const CoordinateSystemAxisNNPtr &axis1, const CoordinateSystemAxisNNPtr &axis2, const CoordinateSystemAxisNNPtr &axis3)
+

Instantiate a SphericalCS.

+
+
Parameters
+
    +
  • properties – See General properties.

  • +
  • axis1 – The first axis.

  • +
  • axis2 – The second axis.

  • +
  • axis3 – The third axis.

  • +
+
+
Returns
+

a new SphericalCS.

+
+
+
+ +
+
+static SphericalCSNNPtr create(const util::PropertyMap &properties, const CoordinateSystemAxisNNPtr &axis1, const CoordinateSystemAxisNNPtr &axis2)
+

Instantiate a SphericalCS with 2 axis.

+

This is an extension to ISO19111 to support (planet)-ocentric CS with geocentric latitude.

+
+
Parameters
+
    +
  • properties – See General properties.

  • +
  • axis1 – The first axis.

  • +
  • axis2 – The second axis.

  • +
+
+
Returns
+

a new SphericalCS.

+
+
+
+ +
+
+ +
+
+class TemporalCountCS : public osgeo::proj::cs::TemporalCS
+
+#include <coordinatesystem.hpp>
+

A one-dimensional coordinate system used to record time as an integer count.

+

A TemporalCountCS shall have one axis association.

+

+

Remark

+

Implements TemporalCountCS from ISO 19111:2019

+
+

+
+

Public Static Functions

+
+
+static TemporalCountCSNNPtr create(const util::PropertyMap &properties, const CoordinateSystemAxisNNPtr &axis)
+

Instantiate a TemporalCountCS.

+
+
Parameters
+
+
+
Returns
+

a new TemporalCountCS.

+
+
+
+ +
+
+ +
+
+class TemporalCS : public osgeo::proj::cs::CoordinateSystem
+
+#include <coordinatesystem.hpp>
+

(Abstract class) A one-dimensional coordinate system used to record time.

+

A TemporalCS shall have one axis association.

+

+

Remark

+

Implements TemporalCS from ISO 19111:2019

+
+

+

Subclassed by osgeo::proj::cs::DateTimeTemporalCS, osgeo::proj::cs::TemporalCountCS, osgeo::proj::cs::TemporalMeasureCS

+
+ +
+
+class TemporalMeasureCS : public osgeo::proj::cs::TemporalCS
+
+#include <coordinatesystem.hpp>
+

A one-dimensional coordinate system used to record a time as a real number.

+

A TemporalMeasureCS shall have one axis association.

+

+

Remark

+

Implements TemporalMeasureCS from ISO 19111:2019

+
+

+
+

Public Static Functions

+
+
+static TemporalMeasureCSNNPtr create(const util::PropertyMap &properties, const CoordinateSystemAxisNNPtr &axis)
+

Instantiate a TemporalMeasureCS.

+
+
Parameters
+
+
+
Returns
+

a new TemporalMeasureCS.

+
+
+
+ +
+
+ +
+
+class VerticalCS : public osgeo::proj::cs::CoordinateSystem
+
+#include <coordinatesystem.hpp>
+

A one-dimensional coordinate system used to record the heights or depths of points.

+

Such a coordinate system is usually dependent on the Earth’s gravity field. A VerticalCS shall have one axis association.

+

+

Remark

+

Implements VerticalCS from ISO 19111:2019

+
+

+
+

Public Static Functions

+
+
+static VerticalCSNNPtr create(const util::PropertyMap &properties, const CoordinateSystemAxisNNPtr &axis)
+

Instantiate a VerticalCS.

+
+
Parameters
+
+
+
Returns
+

a new VerticalCS.

+
+
+
+ +
+
+static VerticalCSNNPtr createGravityRelatedHeight(const common::UnitOfMeasure &unit)
+

Instantiate a VerticalCS with a Gravity-related height axis.

+
+
Parameters
+

unit – linear unit.

+
+
Returns
+

a new VerticalCS.

+
+
+
+ +
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/development/reference/cpp/datum.html b/development/reference/cpp/datum.html new file mode 100644 index 00000000..ef77b4e6 --- /dev/null +++ b/development/reference/cpp/datum.html @@ -0,0 +1,1180 @@ + + + + + + + datum namespace — PROJ 9.0.0 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

datum namespace

+
+
+namespace osgeo::proj::datum
+

Datum (the relationship of a coordinate system to the body).

+

osgeo.proj.datum namespace

+
+

Typedefs

+
+
+typedef std::shared_ptr<Datum> DatumPtr
+

Shared pointer of Datum

+
+ +
+
+typedef util::nn<DatumPtr> DatumNNPtr
+

Non-null shared pointer of Datum

+
+ +
+
+typedef std::shared_ptr<DatumEnsemble> DatumEnsemblePtr
+

Shared pointer of DatumEnsemble

+
+ +
+
+typedef util::nn<DatumEnsemblePtr> DatumEnsembleNNPtr
+

Non-null shared pointer of DatumEnsemble

+
+ +
+
+typedef std::shared_ptr<PrimeMeridian> PrimeMeridianPtr
+

Shared pointer of PrimeMeridian

+
+ +
+
+typedef util::nn<PrimeMeridianPtr> PrimeMeridianNNPtr
+

Non-null shared pointer of PrimeMeridian

+
+ +
+
+typedef std::shared_ptr<Ellipsoid> EllipsoidPtr
+

Shared pointer of Ellipsoid

+
+ +
+
+typedef util::nn<EllipsoidPtr> EllipsoidNNPtr
+

Non-null shared pointer of Ellipsoid

+
+ +
+
+typedef std::shared_ptr<GeodeticReferenceFrame> GeodeticReferenceFramePtr
+

Shared pointer of GeodeticReferenceFrame

+
+ +
+
+typedef util::nn<GeodeticReferenceFramePtr> GeodeticReferenceFrameNNPtr
+

Non-null shared pointer of GeodeticReferenceFrame

+
+ +
+
+using DynamicGeodeticReferenceFramePtr = std::shared_ptr<DynamicGeodeticReferenceFrame>
+

Shared pointer of DynamicGeodeticReferenceFrame

+
+ +
+
+using DynamicGeodeticReferenceFrameNNPtr = util::nn<DynamicGeodeticReferenceFramePtr>
+

Non-null shared pointer of DynamicGeodeticReferenceFrame

+
+ +
+
+typedef std::shared_ptr<VerticalReferenceFrame> VerticalReferenceFramePtr
+

Shared pointer of VerticalReferenceFrame

+
+ +
+
+typedef util::nn<VerticalReferenceFramePtr> VerticalReferenceFrameNNPtr
+

Non-null shared pointer of VerticalReferenceFrame

+
+ +
+
+using DynamicVerticalReferenceFramePtr = std::shared_ptr<DynamicVerticalReferenceFrame>
+

Shared pointer of DynamicVerticalReferenceFrame

+
+ +
+
+using DynamicVerticalReferenceFrameNNPtr = util::nn<DynamicVerticalReferenceFramePtr>
+

Non-null shared pointer of DynamicVerticalReferenceFrame

+
+ +
+
+using TemporalDatumPtr = std::shared_ptr<TemporalDatum>
+

Shared pointer of TemporalDatum

+
+ +
+
+using TemporalDatumNNPtr = util::nn<TemporalDatumPtr>
+

Non-null shared pointer of TemporalDatum

+
+ +
+
+using EngineeringDatumPtr = std::shared_ptr<EngineeringDatum>
+

Shared pointer of EngineeringDatum

+
+ +
+
+using EngineeringDatumNNPtr = util::nn<EngineeringDatumPtr>
+

Non-null shared pointer of EngineeringDatum

+
+ +
+
+using ParametricDatumPtr = std::shared_ptr<ParametricDatum>
+

Shared pointer of ParametricDatum

+
+ +
+
+using ParametricDatumNNPtr = util::nn<ParametricDatumPtr>
+

Non-null shared pointer of ParametricDatum

+
+ +
+
+
+class Datum : public osgeo::proj::common::ObjectUsage, public osgeo::proj::io::IJSONExportable
+
+#include <datum.hpp>
+

Abstract class of the relationship of a coordinate system to an object, thus creating a coordinate reference system.

+

For geodetic and vertical coordinate reference systems, it relates a coordinate system to the Earth (or the celestial body considered). With other types of coordinate reference systems, the datum may relate the coordinate system to another physical or virtual object. A datum uses a parameter or set of parameters that determine the location of the origin of the coordinate reference system. Each datum subtype can be associated with only specific types of coordinate reference systems.

+

+

Remark

+

Implements Datum from ISO 19111:2019

+
+

+

Subclassed by osgeo::proj::datum::EngineeringDatum, osgeo::proj::datum::GeodeticReferenceFrame, osgeo::proj::datum::ParametricDatum, osgeo::proj::datum::TemporalDatum, osgeo::proj::datum::VerticalReferenceFrame

+
+

Public Functions

+
+
+const util::optional<std::string> &anchorDefinition() const
+

Return the anchor definition.

+

A description - possibly including coordinates of an identified point or points - of the relationship used to anchor a coordinate system to the Earth or alternate object.

    +
  • For modern geodetic reference frames the anchor may be a set of station coordinates; if the reference frame is dynamic it will also include coordinate velocities. For a traditional geodetic datum, this anchor may be a point known as the fundamental point, which is traditionally the point where the relationship between geoid and ellipsoid is defined, together with a direction from that point.

  • +
  • For a vertical reference frame the anchor may be the zero level at one or more defined locations or a conventionally defined surface.

  • +
  • For an engineering datum, the anchor may be an identified physical point with the orientation defined relative to the object.

  • +
+

+
+
Returns
+

the anchor definition, or empty.

+
+
+
+ +
+
+const util::optional<common::DateTime> &publicationDate() const
+

Return the date on which the datum definition was published.

+
+

Note

+

Departure from ISO 19111:2019 : we return a DateTime instead of a Citation::Date.

+
+
+
Returns
+

the publication date, or empty.

+
+
+
+ +
+
+const common::IdentifiedObjectPtr &conventionalRS() const
+

Return the conventional reference system.

+

This is the name, identifier, alias and remarks for the terrestrial reference system or vertical reference system realized by this reference frame, for example “ITRS” for ITRF88 through ITRF2008 and ITRF2014, or “EVRS” for EVRF2000 and EVRF2007.

+
+
Returns
+

the conventional reference system, or nullptr.

+
+
+
+ +
+
+ +
+
+class DatumEnsemble : public osgeo::proj::common::ObjectUsage, public osgeo::proj::io::IJSONExportable
+
+#include <datum.hpp>
+

A collection of two or more geodetic or vertical reference frames (or if not geodetic or vertical reference frame, a collection of two or more datums) which for all but the highest accuracy requirements may be considered to be insignificantly different from each other.

+

Every frame within the datum ensemble must be a realizations of the same Terrestrial Reference System or Vertical Reference System.

+

+

Remark

+

Implements DatumEnsemble from ISO 19111:2019

+
+

+
+

Public Functions

+
+
+const std::vector<DatumNNPtr> &datums() const
+

Return the set of datums which may be considered to be insignificantly different from each other.

+
+
Returns
+

the set of datums of the DatumEnsemble.

+
+
+
+ +
+
+const metadata::PositionalAccuracyNNPtr &positionalAccuracy() const
+

Return the inaccuracy introduced through use of this collection of datums.

+

It is an indication of the differences in coordinate values at all points between the various realizations that have been grouped into this datum ensemble.

+
+
Returns
+

the accuracy.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static DatumEnsembleNNPtr create(const util::PropertyMap &properties, const std::vector<DatumNNPtr> &datumsIn, const metadata::PositionalAccuracyNNPtr &accuracy)
+

Instantiate a DatumEnsemble.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • datumsIn – Array of at least 2 datums.

  • +
  • accuracy – Accuracy of the datum ensemble

  • +
+
+
Throws
+

util::Exception

+
+
Returns
+

new DatumEnsemble.

+
+
+
+ +
+
+ +
+
+class DynamicGeodeticReferenceFrame : public osgeo::proj::datum::GeodeticReferenceFrame
+
+#include <datum.hpp>
+

A geodetic reference frame in which some of the parameters describe time evolution of defining station coordinates.

+

For example defining station coordinates having linear velocities to account for crustal motion.

+

+

Remark

+

Implements DynamicGeodeticReferenceFrame from ISO 19111:2019

+
+

+
+

Public Functions

+
+
+const common::Measure &frameReferenceEpoch() const
+

Return the epoch to which the coordinates of stations defining the dynamic geodetic reference frame are referenced.

+

Usually given as a decimal year e.g. 2016.47.

+
+
Returns
+

the frame reference epoch.

+
+
+
+ +
+
+const util::optional<std::string> &deformationModelName() const
+

Return the name of the deformation model.

+
+

Note

+

This is an extension to the ISO 19111:2019 modeling, to hold the content of the DYNAMIC.MODEL WKT2 node.

+
+
+
Returns
+

the name of the deformation model.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static DynamicGeodeticReferenceFrameNNPtr create(const util::PropertyMap &properties, const EllipsoidNNPtr &ellipsoid, const util::optional<std::string> &anchor, const PrimeMeridianNNPtr &primeMeridian, const common::Measure &frameReferenceEpochIn, const util::optional<std::string> &deformationModelNameIn)
+

Instantiate a DynamicGeodeticReferenceFrame.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • ellipsoid – the Ellipsoid.

  • +
  • anchor – the anchor definition, or empty.

  • +
  • primeMeridian – the PrimeMeridian.

  • +
  • frameReferenceEpochIn – the frame reference epoch.

  • +
  • deformationModelNameIn – deformation model name, or empty

  • +
+
+
Returns
+

new DynamicGeodeticReferenceFrame.

+
+
+
+ +
+
+ +
+
+class DynamicVerticalReferenceFrame : public osgeo::proj::datum::VerticalReferenceFrame
+
+#include <datum.hpp>
+

A vertical reference frame in which some of the defining parameters have time dependency.

+

For example defining station heights have velocity to account for post-glacial isostatic rebound motion.

+

+

Remark

+

Implements DynamicVerticalReferenceFrame from ISO 19111:2019

+
+

+
+

Public Functions

+
+
+const common::Measure &frameReferenceEpoch() const
+

Return the epoch to which the coordinates of stations defining the dynamic geodetic reference frame are referenced.

+

Usually given as a decimal year e.g. 2016.47.

+
+
Returns
+

the frame reference epoch.

+
+
+
+ +
+
+const util::optional<std::string> &deformationModelName() const
+

Return the name of the deformation model.

+
+

Note

+

This is an extension to the ISO 19111:2019 modeling, to hold the content of the DYNAMIC.MODEL WKT2 node.

+
+
+
Returns
+

the name of the deformation model.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static DynamicVerticalReferenceFrameNNPtr create(const util::PropertyMap &properties, const util::optional<std::string> &anchor, const util::optional<RealizationMethod> &realizationMethodIn, const common::Measure &frameReferenceEpochIn, const util::optional<std::string> &deformationModelNameIn)
+

Instantiate a DynamicVerticalReferenceFrame.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • anchor – the anchor definition, or empty.

  • +
  • realizationMethodIn – the realization method, or empty.

  • +
  • frameReferenceEpochIn – the frame reference epoch.

  • +
  • deformationModelNameIn – deformation model name, or empty

  • +
+
+
Returns
+

new DynamicVerticalReferenceFrame.

+
+
+
+ +
+
+ +
+
+class Ellipsoid : public osgeo::proj::common::IdentifiedObject, public osgeo::proj::io::IPROJStringExportable, public osgeo::proj::io::IJSONExportable
+
+#include <datum.hpp>
+

A geometric figure that can be used to describe the approximate shape of an object.

+

For the Earth an oblate biaxial ellipsoid is used: in mathematical terms, it is a surface formed by the rotation of an ellipse about its minor axis.

+

+

Remark

+

Implements Ellipsoid from ISO 19111:2019

+
+

+
+

Public Functions

+
+
+const common::Length &semiMajorAxis()
+

Return the length of the semi-major axis of the ellipsoid.

+
+
Returns
+

the semi-major axis.

+
+
+
+ +
+
+const util::optional<common::Scale> &inverseFlattening()
+

Return the inverse flattening value of the ellipsoid, if the ellipsoid has been defined with this value.

+

+

See also

+

computeInverseFlattening() that will always return a valid value of the inverse flattening, whether the ellipsoid has been defined through inverse flattening or semi-minor axis.

+
+

+
+
Returns
+

the inverse flattening value of the ellipsoid, or empty.

+
+
+
+ +
+
+const util::optional<common::Length> &semiMinorAxis()
+

Return the length of the semi-minor axis of the ellipsoid, if the ellipsoid has been defined with this value.

+

+

See also

+

computeSemiMinorAxis() that will always return a valid value of the semi-minor axis, whether the ellipsoid has been defined through inverse flattening or semi-minor axis.

+
+

+
+
Returns
+

the semi-minor axis of the ellipsoid, or empty.

+
+
+
+ +
+
+bool isSphere()
+

Return whether the ellipsoid is spherical.

+

That is to say is semiMajorAxis() == computeSemiMinorAxis().

+

A sphere is completely defined by the semi-major axis, which is the radius of the sphere.

+
+
Returns
+

true if the ellipsoid is spherical.

+
+
+
+ +
+
+const util::optional<common::Length> &semiMedianAxis()
+

Return the length of the semi-median axis of a triaxial ellipsoid.

+

This parameter is not required for a biaxial ellipsoid.

+
+
Returns
+

the semi-median axis of the ellipsoid, or empty.

+
+
+
+ +
+
+double computedInverseFlattening()
+

Return or compute the inverse flattening value of the ellipsoid.

+

If computed, the inverse flattening is the result of a / (a - b), where a is the semi-major axis and b the semi-minor axis.

+
+
Returns
+

the inverse flattening value of the ellipsoid, or 0 for a sphere.

+
+
+
+ +
+
+double squaredEccentricity()
+

Return the squared eccentricity of the ellipsoid.

+
+
Returns
+

the squared eccentricity, or a negative value if invalid.

+
+
+
+ +
+
+common::Length computeSemiMinorAxis() const
+

Return or compute the length of the semi-minor axis of the ellipsoid.

+

If computed, the semi-minor axis is the result of a * (1 - 1 / rf) where a is the semi-major axis and rf the reverse/inverse flattening.

+
+
Returns
+

the semi-minor axis of the ellipsoid.

+
+
+
+ +
+
+const std::string &celestialBody()
+

Return the name of the celestial body on which the ellipsoid refers to.

+
+ +
+
+EllipsoidNNPtr identify() const
+

Return a Ellipsoid object where some parameters are better identified.

+
+
Returns
+

a new Ellipsoid.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static EllipsoidNNPtr createSphere(const util::PropertyMap &properties, const common::Length &radius, const std::string &celestialBody = EARTH)
+

Instantiate a Ellipsoid as a sphere.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • radius – the sphere radius (semi-major axis).

  • +
  • celestialBody – Name of the celestial body on which the ellipsoid refers to.

  • +
+
+
Returns
+

new Ellipsoid.

+
+
+
+ +
+
+static EllipsoidNNPtr createFlattenedSphere(const util::PropertyMap &properties, const common::Length &semiMajorAxisIn, const common::Scale &invFlattening, const std::string &celestialBody = EARTH)
+

Instantiate a Ellipsoid from its inverse/reverse flattening.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • semiMajorAxisIn – the semi-major axis.

  • +
  • invFlattening – the inverse/reverse flattening. If set to 0, this will be considered as a sphere.

  • +
  • celestialBody – Name of the celestial body on which the ellipsoid refers to.

  • +
+
+
Returns
+

new Ellipsoid.

+
+
+
+ +
+
+static EllipsoidNNPtr createTwoAxis(const util::PropertyMap &properties, const common::Length &semiMajorAxisIn, const common::Length &semiMinorAxisIn, const std::string &celestialBody = EARTH)
+

Instantiate a Ellipsoid from the value of its two semi axis.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • semiMajorAxisIn – the semi-major axis.

  • +
  • semiMinorAxisIn – the semi-minor axis.

  • +
  • celestialBody – Name of the celestial body on which the ellipsoid refers to.

  • +
+
+
Returns
+

new Ellipsoid.

+
+
+
+ +
+
+

Public Static Attributes

+
+
+static const std::string EARTH
+

Earth celestial body.

+
+ +
+
+static const EllipsoidNNPtr CLARKE_1866
+

The EPSG:7008 / “Clarke 1866” Ellipsoid.

+
+ +
+
+static const EllipsoidNNPtr WGS84
+

The EPSG:7030 / “WGS 84” Ellipsoid.

+
+ +
+
+static const EllipsoidNNPtr GRS1980
+

The EPSG:7019 / “GRS 1980” Ellipsoid.

+
+ +
+
+ +
+
+class EngineeringDatum : public osgeo::proj::datum::Datum
+
+#include <datum.hpp>
+

The definition of the origin and orientation of an engineering coordinate reference system.

+

+

Remark

+

Implements EngineeringDatum from ISO 19111:2019

+
+

+
+

Note

+

The origin can be fixed with respect to the Earth (such as a defined point at a construction site), or be a defined point on a moving vehicle (such as on a ship or satellite), or a defined point of an image.

+
+
+

Public Static Functions

+
+
+static EngineeringDatumNNPtr create(const util::PropertyMap &properties, const util::optional<std::string> &anchor = util::optional<std::string>())
+

Instantiate a EngineeringDatum.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • anchor – the anchor definition, or empty.

  • +
+
+
Returns
+

new EngineeringDatum.

+
+
+
+ +
+
+ +
+
+class GeodeticReferenceFrame : public osgeo::proj::datum::Datum
+
+#include <datum.hpp>
+

The definition of the position, scale and orientation of a geocentric Cartesian 3D coordinate system relative to the Earth.

+

It may also identify a defined ellipsoid (or sphere) that approximates the shape of the Earth and which is centred on and aligned to this geocentric coordinate system. Older geodetic datums define the location and orientation of a defined ellipsoid (or sphere) that approximates the shape of the earth.

+

+

Remark

+

Implements GeodeticReferenceFrame from ISO 19111:2019

+
+

+
+

Note

+

The terminology “Datum” is often used to mean a GeodeticReferenceFrame.

+
+
+

Note

+

In ISO 19111:2007, this class was called GeodeticDatum.

+
+

Subclassed by osgeo::proj::datum::DynamicGeodeticReferenceFrame

+
+

Public Functions

+
+
+const PrimeMeridianNNPtr &primeMeridian()
+

Return the PrimeMeridian associated with a GeodeticReferenceFrame.

+
+
Returns
+

the PrimeMeridian.

+
+
+
+ +
+
+const EllipsoidNNPtr &ellipsoid()
+

Return the Ellipsoid associated with a GeodeticReferenceFrame.

+
+

Note

+

The ISO 19111:2019 modelling allows (but discourages) a GeodeticReferenceFrame to not be associated with a Ellipsoid in the case where it is used by a geocentric crs::GeodeticCRS. We have made the choice of making the ellipsoid specification compulsory.

+
+
+
Returns
+

the Ellipsoid.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static GeodeticReferenceFrameNNPtr create(const util::PropertyMap &properties, const EllipsoidNNPtr &ellipsoid, const util::optional<std::string> &anchor, const PrimeMeridianNNPtr &primeMeridian)
+

Instantiate a GeodeticReferenceFrame.

+
+
Parameters
+
+
+
Returns
+

new GeodeticReferenceFrame.

+
+
+
+ +
+
+

Public Static Attributes

+
+
+static const GeodeticReferenceFrameNNPtr EPSG_6267
+

The EPSG:6267 / “North_American_Datum_1927” GeodeticReferenceFrame.

+
+ +
+
+static const GeodeticReferenceFrameNNPtr EPSG_6269
+

The EPSG:6269 / “North_American_Datum_1983” GeodeticReferenceFrame.

+
+ +
+
+static const GeodeticReferenceFrameNNPtr EPSG_6326
+

The EPSG:6326 / “WGS_1984” GeodeticReferenceFrame.

+
+ +
+
+ +
+
+class ParametricDatum : public osgeo::proj::datum::Datum
+
+#include <datum.hpp>
+

Textual description and/or a set of parameters identifying a particular reference surface used as the origin of a parametric coordinate system, including its position with respect to the Earth.

+

+

Remark

+

Implements ParametricDatum from ISO 19111:2019

+
+

+
+

Public Static Functions

+
+
+static ParametricDatumNNPtr create(const util::PropertyMap &properties, const util::optional<std::string> &anchor = util::optional<std::string>())
+

Instantiate a ParametricDatum.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • anchor – the anchor definition, or empty.

  • +
+
+
Returns
+

new ParametricDatum.

+
+
+
+ +
+
+ +
+
+class PrimeMeridian : public osgeo::proj::common::IdentifiedObject, public osgeo::proj::io::IPROJStringExportable, public osgeo::proj::io::IJSONExportable
+
+#include <datum.hpp>
+

The origin meridian from which longitude values are determined.

+

+

Remark

+

Implements PrimeMeridian from ISO 19111:2019

+
+

+
+

Note

+

The default value for prime meridian name is “Greenwich”. When the default applies, the value for the longitude shall be 0 (degrees).

+
+
+

Public Functions

+
+
+const common::Angle &longitude()
+

Return the longitude of the prime meridian.

+

It is measured from the internationally-recognised reference meridian (‘Greenwich meridian’), positive eastward. The default value is 0 degrees.

+
+
Returns
+

the longitude of the prime meridian.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static PrimeMeridianNNPtr create(const util::PropertyMap &properties, const common::Angle &longitudeIn)
+

Instantiate a PrimeMeridian.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • longitudeIn – the longitude of the prime meridian.

  • +
+
+
Returns
+

new PrimeMeridian.

+
+
+
+ +
+
+

Public Static Attributes

+
+
+static const PrimeMeridianNNPtr GREENWICH
+

The Greenwich PrimeMeridian.

+
+ +
+
+static const PrimeMeridianNNPtr REFERENCE_MERIDIAN
+

The “Reference Meridian” PrimeMeridian.

+

This is a meridian of longitude 0 to be used with non-Earth bodies.

+
+ +
+
+static const PrimeMeridianNNPtr PARIS
+

The Paris PrimeMeridian.

+
+ +
+
+ +
+
+class RealizationMethod : public osgeo::proj::util::CodeList
+
+#include <datum.hpp>
+

The specification of the method by which the vertical reference frame is realized.

+

+

Remark

+

Implements RealizationMethod from ISO 19111:2019

+
+

+
+

Public Static Attributes

+
+
+static const RealizationMethod LEVELLING
+

The realization is by adjustment of a levelling network fixed to one or more tide gauges.

+
+ +
+
+static const RealizationMethod GEOID
+

The realization is through a geoid height model or a height correction model. This is applied to a specified geodetic CRS.

+
+ +
+
+static const RealizationMethod TIDAL
+

The realization is through a tidal model or by tidal predictions.

+
+ +
+
+ +
+
+class TemporalDatum : public osgeo::proj::datum::Datum
+
+#include <datum.hpp>
+

The definition of the relationship of a temporal coordinate system to an object. The object is normally time on the Earth.

+

+

Remark

+

Implements TemporalDatum from ISO 19111:2019

+
+

+
+

Public Functions

+
+
+const common::DateTime &temporalOrigin() const
+

Return the date and time to which temporal coordinates are referenced, expressed in conformance with ISO 8601.

+
+
Returns
+

the temporal origin.

+
+
+
+ +
+
+const std::string &calendar() const
+

Return the calendar to which the temporal origin is referenced.

+

Default value: TemporalDatum::CALENDAR_PROLEPTIC_GREGORIAN.

+
+
Returns
+

the calendar.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static TemporalDatumNNPtr create(const util::PropertyMap &properties, const common::DateTime &temporalOriginIn, const std::string &calendarIn)
+

Instantiate a TemporalDatum.

+
+
Parameters
+
+
+
Returns
+

new TemporalDatum.

+
+
+
+ +
+
+

Public Static Attributes

+
+
+static const std::string CALENDAR_PROLEPTIC_GREGORIAN
+

The proleptic Gregorian calendar.

+
+ +
+
+ +
+
+class VerticalReferenceFrame : public osgeo::proj::datum::Datum
+
+#include <datum.hpp>
+

A textual description and/or a set of parameters identifying a particular reference level surface used as a zero-height or zero-depth surface, including its position with respect to the Earth.

+

+

Remark

+

Implements VerticalReferenceFrame from ISO 19111:2019

+
+

+
+

Note

+

In ISO 19111:2007, this class was called VerticalDatum.

+
+

Subclassed by osgeo::proj::datum::DynamicVerticalReferenceFrame

+
+

Public Functions

+
+
+const util::optional<RealizationMethod> &realizationMethod() const
+

Return the method through which this vertical reference frame is realized.

+
+
Returns
+

the realization method.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static VerticalReferenceFrameNNPtr create(const util::PropertyMap &properties, const util::optional<std::string> &anchor = util::optional<std::string>(), const util::optional<RealizationMethod> &realizationMethodIn = util::optional<RealizationMethod>())
+

Instantiate a VerticalReferenceFrame.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • anchor – the anchor definition, or empty.

  • +
  • realizationMethodIn – the realization method, or empty.

  • +
+
+
Returns
+

new VerticalReferenceFrame.

+
+
+
+ +
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/development/reference/cpp/index.html b/development/reference/cpp/index.html new file mode 100644 index 00000000..fe374bd5 --- /dev/null +++ b/development/reference/cpp/index.html @@ -0,0 +1,171 @@ + + + + + + + C++ API — PROJ 9.0.0 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/development/reference/cpp/io.html b/development/reference/cpp/io.html new file mode 100644 index 00000000..2dd16030 --- /dev/null +++ b/development/reference/cpp/io.html @@ -0,0 +1,2208 @@ + + + + + + + io namespace — PROJ 9.0.0 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

io namespace

+
+
+namespace osgeo::proj::io
+

I/O classes.

+

osgeo.proj.io namespace.

+
+

Typedefs

+
+
+using DatabaseContextPtr = std::shared_ptr<DatabaseContext>
+

Shared pointer of DatabaseContext.

+
+ +
+
+using DatabaseContextNNPtr = util::nn<DatabaseContextPtr>
+

Non-null shared pointer of DatabaseContext.

+
+ +
+
+using WKTNodePtr = std::unique_ptr<WKTNode>
+

Unique pointer of WKTNode.

+
+ +
+
+using WKTNodeNNPtr = util::nn<WKTNodePtr>
+

Non-null unique pointer of WKTNode.

+
+ +
+
+using WKTFormatterPtr = std::unique_ptr<WKTFormatter>
+

WKTFormatter unique pointer.

+
+ +
+
+using WKTFormatterNNPtr = util::nn<WKTFormatterPtr>
+

Non-null WKTFormatter unique pointer.

+
+ +
+
+using PROJStringFormatterPtr = std::unique_ptr<PROJStringFormatter>
+

PROJStringFormatter unique pointer.

+
+ +
+
+using PROJStringFormatterNNPtr = util::nn<PROJStringFormatterPtr>
+

Non-null PROJStringFormatter unique pointer.

+
+ +
+
+using JSONFormatterPtr = std::unique_ptr<JSONFormatter>
+

JSONFormatter unique pointer.

+
+ +
+
+using JSONFormatterNNPtr = util::nn<JSONFormatterPtr>
+

Non-null JSONFormatter unique pointer.

+
+ +
+
+using IPROJStringExportablePtr = std::shared_ptr<IPROJStringExportable>
+

Shared pointer of IPROJStringExportable.

+
+ +
+
+using IPROJStringExportableNNPtr = util::nn<IPROJStringExportablePtr>
+

Non-null shared pointer of IPROJStringExportable.

+
+ +
+
+using AuthorityFactoryPtr = std::shared_ptr<AuthorityFactory>
+

Shared pointer of AuthorityFactory.

+
+ +
+
+using AuthorityFactoryNNPtr = util::nn<AuthorityFactoryPtr>
+

Non-null shared pointer of AuthorityFactory.

+
+ +
+
+

Functions

+
+
+static crs::GeodeticCRSNNPtr cloneWithProps(const crs::GeodeticCRSNNPtr &geodCRS, const util::PropertyMap &props)
+
+ +
+
+BaseObjectNNPtr createFromUserInput(const std::string &text, const DatabaseContextPtr &dbContext, bool usePROJ4InitRules)
+

Instantiate a sub-class of BaseObject from a user specified text.

+

The text can be a:

    +
  • WKT string

  • +
  • PROJ string

  • +
  • database code, prefixed by its authority. e.g. “EPSG:4326”

  • +
  • OGC URN. e.g. “urn:ogc:def:crs:EPSG::4326”, “urn:ogc:def:coordinateOperation:EPSG::1671”, “urn:ogc:def:ellipsoid:EPSG::7001” or “urn:ogc:def:datum:EPSG::6326”

  • +
  • OGC URN combining references for compound coordinate reference systems e.g. “urn:ogc:def:crs,crs:EPSG::2393,crs:EPSG::5717” We also accept a custom abbreviated syntax EPSG:2393+5717 or ESRI:103668+EPSG:5703

  • +
  • OGC URN combining references for references for projected or derived CRSs e.g. for Projected 3D CRS “UTM zone 31N / WGS 84 (3D)” “urn:ogc:def:crs,crs:EPSG::4979,cs:PROJ::ENh,coordinateOperation:EPSG::16031”

  • +
  • OGC URN combining references for concatenated operations e.g. “urn:ogc:def:coordinateOperation,coordinateOperation:EPSG::3895,coordinateOperation:EPSG::1618”

  • +
  • OGC URL for a single CRS. e.g. “http://www.opengis.net/def/crs/EPSG/0/4326</li> <li>OGC URL for a compound

    +

    CRS. e.g

    +

    +http://www.opengis.net/def/crs-compound?1=http://www.opengis.net/def/crs/EPSG/0/4326&2=http://www.opengis.net/def/crs/EPSG/0/3855

    ”</li>

    +

    <li>an Object name. e.g “WGS 84”, “WGS 84 / UTM zone 31N”. In that case as

    +

    uniqueness is not guaranteed, the function may apply heuristics to

    +

    determine the appropriate best match.</li>

    +

    <li>a compound CRS made from two object names separated with ” + “.

    +

    e.g. “WGS 84 + EGM96 height”

    +

  • +
  • PROJJSON string

  • +
+

+
+
Parameters
+
    +
  • text – One of the above mentioned text format

  • +
  • dbContext – Database context, or nullptr (in which case database lookups will not work)

  • +
  • usePROJ4InitRules – When set to true, init=epsg:XXXX syntax will be allowed and will be interpreted according to PROJ.4 and PROJ.5 rules, that is geodeticCRS will have longitude, latitude order and will expect/output coordinates in radians. ProjectedCRS will have easting, northing axis order (except the ones with Transverse Mercator South Orientated projection). In that mode, the epsg:XXXX syntax will be also interpreted the same way.

  • +
+
+
Throws
+

ParsingException

+
+
+
+ +
+
+BaseObjectNNPtr createFromUserInput(const std::string &text, PJ_CONTEXT *ctx)
+

Instantiate a sub-class of BaseObject from a user specified text.

+

The text can be a:

    +
  • WKT string

  • +
  • PROJ string

  • +
  • database code, prefixed by its authority. e.g. “EPSG:4326”

  • +
  • OGC URN. e.g. “urn:ogc:def:crs:EPSG::4326”, “urn:ogc:def:coordinateOperation:EPSG::1671”, “urn:ogc:def:ellipsoid:EPSG::7001” or “urn:ogc:def:datum:EPSG::6326”

  • +
  • OGC URN combining references for compound coordinate reference systems e.g. “urn:ogc:def:crs,crs:EPSG::2393,crs:EPSG::5717” We also accept a custom abbreviated syntax EPSG:2393+5717

  • +
  • OGC URN combining references for references for projected or derived CRSs e.g. for Projected 3D CRS “UTM zone 31N / WGS 84 (3D)” “urn:ogc:def:crs,crs:EPSG::4979,cs:PROJ::ENh,coordinateOperation:EPSG::16031”

  • +
  • OGC URN combining references for concatenated operations e.g. “urn:ogc:def:coordinateOperation,coordinateOperation:EPSG::3895,coordinateOperation:EPSG::1618”

  • +
  • an Object name. e.g “WGS 84”, “WGS 84 / UTM zone 31N”. In that case as uniqueness is not guaranteed, the function may apply heuristics to determine the appropriate best match.

  • +
  • a compound CRS made from two object names separated with ” + “. e.g. “WGS 84 + EGM96 height”

  • +
  • PROJJSON string

  • +
+

+
+
Parameters
+
    +
  • text – One of the above mentioned text format

  • +
  • ctx – PROJ context

  • +
+
+
Throws
+

ParsingException

+
+
+
+ +
+
+
+class AuthorityFactory
+
+#include <io.hpp>
+

Builds object from an authority database.

+

A AuthorityFactory should be used only by one thread at a time.

+

+

+
+

Public Types

+
+
+enum class ObjectType
+

Object type.

+

Values:

+
+
+enumerator PRIME_MERIDIAN
+

Object of type datum::PrimeMeridian

+
+ +
+
+enumerator ELLIPSOID
+

Object of type datum::Ellipsoid

+
+ +
+
+enumerator DATUM
+

Object of type datum::Datum (and derived classes)

+
+ +
+
+enumerator GEODETIC_REFERENCE_FRAME
+

Object of type datum::GeodeticReferenceFrame (and derived classes)

+
+ +
+
+enumerator VERTICAL_REFERENCE_FRAME
+

Object of type datum::VerticalReferenceFrame (and derived classes)

+
+ +
+
+enumerator CRS
+

Object of type crs::CRS (and derived classes)

+
+ +
+
+enumerator GEODETIC_CRS
+

Object of type crs::GeodeticCRS (and derived classes)

+
+ +
+
+enumerator GEOCENTRIC_CRS
+

GEODETIC_CRS of type geocentric

+
+ +
+
+enumerator GEOGRAPHIC_CRS
+

Object of type crs::GeographicCRS (and derived classes)

+
+ +
+
+enumerator GEOGRAPHIC_2D_CRS
+

GEOGRAPHIC_CRS of type Geographic 2D

+
+ +
+
+enumerator GEOGRAPHIC_3D_CRS
+

GEOGRAPHIC_CRS of type Geographic 3D

+
+ +
+
+enumerator PROJECTED_CRS
+

Object of type crs::ProjectedCRS (and derived classes)

+
+ +
+
+enumerator VERTICAL_CRS
+

Object of type crs::VerticalCRS (and derived classes)

+
+ +
+
+enumerator COMPOUND_CRS
+

Object of type crs::CompoundCRS (and derived classes)

+
+ +
+
+enumerator COORDINATE_OPERATION
+

Object of type operation::CoordinateOperation (and derived classes)

+
+ +
+
+enumerator CONVERSION
+

Object of type operation::Conversion (and derived classes)

+
+ +
+
+enumerator TRANSFORMATION
+

Object of type operation::Transformation (and derived classes)

+
+ +
+
+enumerator CONCATENATED_OPERATION
+

Object of type operation::ConcatenatedOperation (and derived classes)

+
+ +
+
+enumerator DYNAMIC_GEODETIC_REFERENCE_FRAME
+

Object of type datum::DynamicGeodeticReferenceFrame

+
+ +
+
+enumerator DYNAMIC_VERTICAL_REFERENCE_FRAME
+

Object of type datum::DynamicVerticalReferenceFrame

+
+ +
+
+enumerator DATUM_ENSEMBLE
+

Object of type datum::DatumEnsemble

+
+ +
+ +
+
+

Public Functions

+
+
+util::BaseObjectNNPtr createObject(const std::string &code) const
+

Returns an arbitrary object from a code.

+

The returned object will typically be an instance of Datum, CoordinateSystem, ReferenceSystem or CoordinateOperation. If the type of the object is know at compile time, it is recommended to invoke the most precise method instead of this one (for example createCoordinateReferenceSystem(code) instead of createObject(code) if the caller know he is asking for a coordinate reference system).

+

If there are several objects with the same code, a FactoryException is thrown.

+
+
Parameters
+

code – Object code allocated by authority. (e.g. “4326”)

+
+
Throws
+
+
+
Returns
+

object.

+
+
+
+ +
+
+common::UnitOfMeasureNNPtr createUnitOfMeasure(const std::string &code) const
+

Returns a common::UnitOfMeasure from the specified code.

+
+
Parameters
+

code – Object code allocated by authority.

+
+
Throws
+
+
+
Returns
+

object.

+
+
+
+ +
+
+metadata::ExtentNNPtr createExtent(const std::string &code) const
+

Returns a metadata::Extent from the specified code.

+
+
Parameters
+

code – Object code allocated by authority.

+
+
Throws
+
+
+
Returns
+

object.

+
+
+
+ +
+
+datum::PrimeMeridianNNPtr createPrimeMeridian(const std::string &code) const
+

Returns a datum::PrimeMeridian from the specified code.

+
+
Parameters
+

code – Object code allocated by authority.

+
+
Throws
+
+
+
Returns
+

object.

+
+
+
+ +
+
+std::string identifyBodyFromSemiMajorAxis(double a, double tolerance) const
+

Identify a celestial body from an approximate radius.

+
+
Parameters
+
    +
  • semi_major_axis – Approximate semi-major axis.

  • +
  • tolerance – Relative error allowed.

  • +
+
+
Throws
+

FactoryException

+
+
Returns
+

celestial body name if one single match found.

+
+
+
+ +
+
+datum::EllipsoidNNPtr createEllipsoid(const std::string &code) const
+

Returns a datum::Ellipsoid from the specified code.

+
+
Parameters
+

code – Object code allocated by authority.

+
+
Throws
+
+
+
Returns
+

object.

+
+
+
+ +
+
+datum::DatumNNPtr createDatum(const std::string &code) const
+

Returns a datum::Datum from the specified code.

+
+
Parameters
+

code – Object code allocated by authority.

+
+
Throws
+
+
+
Returns
+

object.

+
+
+
+ +
+
+datum::DatumEnsembleNNPtr createDatumEnsemble(const std::string &code, const std::string &type = std::string()) const
+

Returns a datum::DatumEnsemble from the specified code.

+
+
Parameters
+
    +
  • code – Object code allocated by authority.

  • +
  • type – “geodetic_datum”, “vertical_datum” or empty string if unknown

  • +
+
+
Throws
+
+
+
Returns
+

object.

+
+
+
+ +
+
+datum::GeodeticReferenceFrameNNPtr createGeodeticDatum(const std::string &code) const
+

Returns a datum::GeodeticReferenceFrame from the specified code.

+
+
Parameters
+

code – Object code allocated by authority.

+
+
Throws
+
+
+
Returns
+

object.

+
+
+
+ +
+
+datum::VerticalReferenceFrameNNPtr createVerticalDatum(const std::string &code) const
+

Returns a datum::VerticalReferenceFrame from the specified code.

+
+
Parameters
+

code – Object code allocated by authority.

+
+
Throws
+
+
+
Returns
+

object.

+
+
+
+ +
+
+cs::CoordinateSystemNNPtr createCoordinateSystem(const std::string &code) const
+

Returns a cs::CoordinateSystem from the specified code.

+
+
Parameters
+

code – Object code allocated by authority.

+
+
Throws
+
+
+
Returns
+

object.

+
+
+
+ +
+
+crs::GeodeticCRSNNPtr createGeodeticCRS(const std::string &code) const
+

Returns a crs::GeodeticCRS from the specified code.

+
+
Parameters
+

code – Object code allocated by authority.

+
+
Throws
+
+
+
Returns
+

object.

+
+
+
+ +
+
+crs::GeographicCRSNNPtr createGeographicCRS(const std::string &code) const
+

Returns a crs::GeographicCRS from the specified code.

+
+
Parameters
+

code – Object code allocated by authority.

+
+
Throws
+
+
+
Returns
+

object.

+
+
+
+ +
+
+crs::VerticalCRSNNPtr createVerticalCRS(const std::string &code) const
+

Returns a crs::VerticalCRS from the specified code.

+
+
Parameters
+

code – Object code allocated by authority.

+
+
Throws
+
+
+
Returns
+

object.

+
+
+
+ +
+
+operation::ConversionNNPtr createConversion(const std::string &code) const
+

Returns a operation::Conversion from the specified code.

+
+
Parameters
+

code – Object code allocated by authority.

+
+
Throws
+
+
+
Returns
+

object.

+
+
+
+ +
+
+crs::ProjectedCRSNNPtr createProjectedCRS(const std::string &code) const
+

Returns a crs::ProjectedCRS from the specified code.

+
+
Parameters
+

code – Object code allocated by authority.

+
+
Throws
+
+
+
Returns
+

object.

+
+
+
+ +
+
+crs::CompoundCRSNNPtr createCompoundCRS(const std::string &code) const
+

Returns a crs::CompoundCRS from the specified code.

+
+
Parameters
+

code – Object code allocated by authority.

+
+
Throws
+
+
+
Returns
+

object.

+
+
+
+ +
+
+crs::CRSNNPtr createCoordinateReferenceSystem(const std::string &code) const
+

Returns a crs::CRS from the specified code.

+
+
Parameters
+

code – Object code allocated by authority.

+
+
Throws
+
+
+
Returns
+

object.

+
+
+
+ +
+
+operation::CoordinateOperationNNPtr createCoordinateOperation(const std::string &code, bool usePROJAlternativeGridNames) const
+

Returns a operation::CoordinateOperation from the specified code.

+
+
Parameters
+
    +
  • code – Object code allocated by authority.

  • +
  • usePROJAlternativeGridNames – Whether PROJ alternative grid names should be substituted to the official grid names.

  • +
+
+
Throws
+
+
+
Returns
+

object.

+
+
+
+ +
+
+std::vector<operation::CoordinateOperationNNPtr> createFromCoordinateReferenceSystemCodes(const std::string &sourceCRSCode, const std::string &targetCRSCode) const
+

Returns a list operation::CoordinateOperation between two CRS.

+

The list is ordered with preferred operations first. No attempt is made at inferring operations that are not explicitly in the database.

+

Deprecated operations are rejected.

+
+
Parameters
+
    +
  • sourceCRSCode – Source CRS code allocated by authority.

  • +
  • targetCRSCode – Source CRS code allocated by authority.

  • +
+
+
Throws
+
+
+
Returns
+

list of coordinate operations

+
+
+
+ +
+
+std::list<std::string> getGeoidModels(const std::string &code) const
+

Returns a list of geoid models available for that crs.

+

The list includes the geoid models connected directly with the crs, or via “Height Depth Reversal” or “Change of Vertical Unit” transformations

+
+
Parameters
+

code – crs code allocated by authority.

+
+
Throws
+

FactoryException

+
+
Returns
+

list of geoid model names

+
+
+
+ +
+
+const std::string &getAuthority()
+

Returns the authority name associated to this factory.

+
+
Returns
+

name.

+
+
+
+ +
+
+std::set<std::string> getAuthorityCodes(const ObjectType &type, bool allowDeprecated = true) const
+

Returns the set of authority codes of the given object type.

+
+
Parameters
+
    +
  • type – Object type.

  • +
  • allowDeprecated – whether we should return deprecated objects as well.

  • +
+
+
Throws
+

FactoryException

+
+
Returns
+

the set of authority codes for spatial reference objects of the given type

+
+
+
+ +
+
+std::string getDescriptionText(const std::string &code) const
+

Gets a description of the object corresponding to a code.

+
+

Note

+

In case of several objects of different types with the same code, one of them will be arbitrarily selected. But if a CRS object is found, it will be selected.

+
+
+
Parameters
+

code – Object code allocated by authority. (e.g. “4326”)

+
+
Throws
+
+
+
Returns
+

description.

+
+
+
+ +
+
+std::list<CRSInfo> getCRSInfoList() const
+

Return a list of information on CRS objects.

+

This is functionally equivalent of listing the codes from an authority, instantiating a CRS object for each of them and getting the information from this CRS object, but this implementation has much less overhead.

+
+
Throws
+

FactoryException

+
+
+
+ +
+
+std::list<UnitInfo> getUnitList() const
+

Return the list of units.

+

+
Since

7.1

+
+
+

+
+
Throws
+

FactoryException

+
+
+
+ +
+
+std::list<CelestialBodyInfo> getCelestialBodyList() const
+

Return the list of celestial bodies.

+

+
Since

8.1

+
+
+

+
+
Throws
+

FactoryException

+
+
+
+ +
+
+const DatabaseContextNNPtr &databaseContext() const
+

Returns the database context.

+
+ +
+
+std::vector<operation::CoordinateOperationNNPtr> createFromCoordinateReferenceSystemCodes(const std::string &sourceCRSAuthName, const std::string &sourceCRSCode, const std::string &targetCRSAuthName, const std::string &targetCRSCode, bool usePROJAlternativeGridNames, bool discardIfMissingGrid, bool considerKnownGridsAsAvailable, bool discardSuperseded, bool tryReverseOrder = false, bool reportOnlyIntersectingTransformations = false, const metadata::ExtentPtr &intersectingExtent1 = nullptr, const metadata::ExtentPtr &intersectingExtent2 = nullptr) const
+

Returns a list operation::CoordinateOperation between two CRS.

+

The list is ordered with preferred operations first. No attempt is made at inferring operations that are not explicitly in the database (see createFromCRSCodesWithIntermediates() for that), and only source -> target operations are searched (i.e. if target -> source is present, you need to call this method with the arguments reversed, and apply the reverse transformations).

+

Deprecated operations are rejected.

+

If getAuthority() returns empty, then coordinate operations from all authorities are considered.

+
+
Parameters
+
    +
  • sourceCRSAuthName – Authority name of sourceCRSCode

  • +
  • sourceCRSCode – Source CRS code allocated by authority sourceCRSAuthName.

  • +
  • targetCRSAuthName – Authority name of targetCRSCode

  • +
  • targetCRSCode – Source CRS code allocated by authority targetCRSAuthName.

  • +
  • usePROJAlternativeGridNames – Whether PROJ alternative grid names should be substituted to the official grid names.

  • +
  • discardIfMissingGrid – Whether coordinate operations that reference missing grids should be removed from the result set.

  • +
  • considerKnownGridsAsAvailable – Whether known grids should be considered as available (typically when network is enabled).

  • +
  • discardSuperseded – Whether coordinate operations that are superseded (but not deprecated) should be removed from the result set.

  • +
  • tryReverseOrder – whether to search in the reverse order too (and thus inverse results found that way)

  • +
  • reportOnlyIntersectingTransformations – if intersectingExtent1 and intersectingExtent2 should be honored in a strict way.

  • +
  • intersectingExtent1 – Optional extent that the resulting operations must intersect.

  • +
  • intersectingExtent2 – Optional extent that the resulting operations must intersect.

  • +
+
+
Throws
+
+
+
Returns
+

list of coordinate operations

+
+
+
+ +
+
+std::vector<operation::CoordinateOperationNNPtr> createFromCRSCodesWithIntermediates(const std::string &sourceCRSAuthName, const std::string &sourceCRSCode, const std::string &targetCRSAuthName, const std::string &targetCRSCode, bool usePROJAlternativeGridNames, bool discardIfMissingGrid, bool considerKnownGridsAsAvailable, bool discardSuperseded, const std::vector<std::pair<std::string, std::string>> &intermediateCRSAuthCodes, ObjectType allowedIntermediateObjectType = ObjectType::CRS, const std::vector<std::string> &allowedAuthorities = std::vector<std::string>(), const metadata::ExtentPtr &intersectingExtent1 = nullptr, const metadata::ExtentPtr &intersectingExtent2 = nullptr) const
+

Returns a list operation::CoordinateOperation between two CRS, using intermediate codes.

+

The list is ordered with preferred operations first.

+

Deprecated operations are rejected.

+

The method will take care of considering all potential combinations (i.e. contrary to createFromCoordinateReferenceSystemCodes(), you do not need to call it with sourceCRS and targetCRS switched)

+

If getAuthority() returns empty, then coordinate operations from all authorities are considered.

+
+
Parameters
+
    +
  • sourceCRSAuthName – Authority name of sourceCRSCode

  • +
  • sourceCRSCode – Source CRS code allocated by authority sourceCRSAuthName.

  • +
  • targetCRSAuthName – Authority name of targetCRSCode

  • +
  • targetCRSCode – Source CRS code allocated by authority targetCRSAuthName.

  • +
  • usePROJAlternativeGridNames – Whether PROJ alternative grid names should be substituted to the official grid names.

  • +
  • discardIfMissingGrid – Whether coordinate operations that reference missing grids should be removed from the result set.

  • +
  • considerKnownGridsAsAvailable – Whether known grids should be considered as available (typically when network is enabled).

  • +
  • discardSuperseded – Whether coordinate operations that are superseded (but not deprecated) should be removed from the result set.

  • +
  • intermediateCRSAuthCodes – List of (auth_name, code) of CRS that can be used as potential intermediate CRS. If the list is empty, the database will be used to find common CRS in operations involving both the source and target CRS.

  • +
  • allowedIntermediateObjectType – Restrict the type of the intermediate object considered. Only ObjectType::CRS and ObjectType::GEOGRAPHIC_CRS supported currently

  • +
  • allowedAuthorities – One or several authority name allowed for the two coordinate operations that are going to be searched. When this vector is no empty, it overrides the authority of this object. This is useful for example when the coordinate operations to chain belong to two different allowed authorities.

  • +
  • intersectingExtent1 – Optional extent that the resulting operations must intersect.

  • +
  • intersectingExtent2 – Optional extent that the resulting operations must intersect.

  • +
+
+
Throws
+
+
+
Returns
+

list of coordinate operations

+
+
+
+ +
+
+std::string getOfficialNameFromAlias(const std::string &aliasedName, const std::string &tableName, const std::string &source, bool tryEquivalentNameSpelling, std::string &outTableName, std::string &outAuthName, std::string &outCode) const
+

Gets the official name from a possibly alias name.

+
+
Parameters
+
    +
  • aliasedName – Alias name.

  • +
  • tableName – Table name/category. Can help in case of ambiguities. Or empty otherwise.

  • +
  • source – Source of the alias. Can help in case of ambiguities. Or empty otherwise.

  • +
  • tryEquivalentNameSpelling – whether the comparison of aliasedName with the alt_name column of the alias_name table should be done with using metadata::Identifier::isEquivalentName() rather than strict string comparison;

  • +
  • outTableName – Table name in which the official name has been found.

  • +
  • outAuthName – Authority name of the official name that has been found.

  • +
  • outCode – Code of the official name that has been found.

  • +
+
+
Throws
+

FactoryException

+
+
Returns
+

official name (or empty if not found).

+
+
+
+ +
+
+std::list<common::IdentifiedObjectNNPtr> createObjectsFromName(const std::string &name, const std::vector<ObjectType> &allowedObjectTypes = std::vector<ObjectType>(), bool approximateMatch = true, size_t limitResultCount = 0) const
+

Return a list of objects, identified by their name.

+
+
Parameters
+
    +
  • searchedName – Searched name. Must be at least 2 character long.

  • +
  • allowedObjectTypes – List of object types into which to search. If empty, all object types will be searched.

  • +
  • approximateMatch – Whether approximate name identification is allowed.

  • +
  • limitResultCount – Maximum number of results to return. Or 0 for unlimited.

  • +
+
+
Throws
+

FactoryException

+
+
Returns
+

list of matched objects.

+
+
+
+ +
+
+std::list<std::pair<std::string, std::string>> listAreaOfUseFromName(const std::string &name, bool approximateMatch) const
+

Return a list of area of use from their name.

+
+
Parameters
+
    +
  • name – Searched name.

  • +
  • approximateMatch – Whether approximate name identification is allowed.

  • +
+
+
Throws
+

FactoryException

+
+
Returns
+

list of (auth_name, code) of matched objects.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static AuthorityFactoryNNPtr create(const DatabaseContextNNPtr &context, const std::string &authorityName)
+

Instantiate a AuthorityFactory.

+

The authority name might be set to the empty string in the particular case where createFromCoordinateReferenceSystemCodes(const std::string&,const std::string&,const std::string&,const std::string&) const is called.

+
+
Parameters
+
    +
  • context – Context.

  • +
  • authorityName – Authority name.

  • +
+
+
Returns
+

new AuthorityFactory.

+
+
+
+ +
+
+
+struct CelestialBodyInfo
+
+#include <io.hpp>
+

Celestial Body information

+
+

Public Members

+
+
+std::string authName
+

Authority name

+
+ +
+
+std::string name
+

Name

+
+ +
+
+ +
+
+struct CRSInfo
+
+#include <io.hpp>
+

CRS information

+
+

Public Members

+
+
+std::string authName
+

Authority name

+
+ +
+
+std::string code
+

Code

+
+ +
+
+std::string name
+

Name

+
+ +
+
+ObjectType type
+

Type

+
+ +
+
+bool deprecated
+

Whether the object is deprecated

+
+ +
+
+bool bbox_valid
+

Whereas the west_lon_degree, south_lat_degree, east_lon_degree and north_lat_degree fields are valid.

+
+ +
+
+double west_lon_degree
+

Western-most longitude of the area of use, in degrees.

+
+ +
+
+double south_lat_degree
+

Southern-most latitude of the area of use, in degrees.

+
+ +
+
+double east_lon_degree
+

Eastern-most longitude of the area of use, in degrees.

+
+ +
+
+double north_lat_degree
+

Northern-most latitude of the area of use, in degrees.

+
+ +
+
+std::string areaName
+

Name of the area of use.

+
+ +
+
+std::string projectionMethodName
+

Name of the projection method for a projected CRS. Might be empty even for projected CRS in some cases.

+
+ +
+
+std::string celestialBodyName
+

Name of the celestial body of the CRS (e.g. “Earth”)

+
+ +
+
+ +
+
+struct UnitInfo
+
+#include <io.hpp>
+

Unit information

+
+

Public Members

+
+
+std::string authName
+

Authority name

+
+ +
+
+std::string code
+

Code

+
+ +
+
+std::string name
+

Name

+
+ +
+
+std::string category
+

Category: one of “linear”, “linear_per_time”, “angular”, “angular_per_time”, “scale”, “scale_per_time” or “time”

+
+ +
+
+double convFactor
+

Conversion factor to the SI unit. It might be 0 in some cases to indicate no known conversion factor.

+
+ +
+
+std::string projShortName
+

PROJ short name (may be empty)

+
+ +
+
+bool deprecated
+

Whether the object is deprecated

+
+ +
+
+ +
+ +
+
+class DatabaseContext
+
+#include <io.hpp>
+

Database context.

+

A database context should be used only by one thread at a time.

+
+

Public Functions

+
+
+const std::string &getPath() const
+

Return the path to the database.

+
+ +
+
+const char *getMetadata(const char *key) const
+

Return a metadata item.

+

Value remains valid while this is alive and to the next call to getMetadata

+
+ +
+
+std::set<std::string> getAuthorities() const
+

Return the list of authorities used in the database.

+
+ +
+
+std::vector<std::string> getDatabaseStructure() const
+

Return the list of SQL commands (CREATE TABLE, CREATE TRIGGER, CREATE VIEW) needed to initialize a new database.

+
+ +
+
+void startInsertStatementsSession()
+

Starts a session for getInsertStatementsFor()

+

Starts a new session for one or several calls to getInsertStatementsFor(). An insertion session guarantees that the inserted objects will not create conflicting intermediate objects.

+

The session must be stopped with stopInsertStatementsSession().

+

Only one session may be active at a time for a given database context.

+

+
Since

8.1

+
+
+

+
+
Throws
+

FactoryException

+
+
+
+ +
+
+std::string suggestsCodeFor(const common::IdentifiedObjectNNPtr &object, const std::string &authName, bool numericCode)
+

Suggests a database code for the passed object.

+

Supported type of objects are PrimeMeridian, Ellipsoid, Datum, DatumEnsemble, GeodeticCRS, ProjectedCRS, VerticalCRS, CompoundCRS, BoundCRS, Conversion.

+

+
Since

8.1

+
+
+

+
+
Parameters
+
    +
  • object – Object for which to suggest a code.

  • +
  • authName – Authority name into which the object will be inserted.

  • +
  • numericCode – Whether the code should be numeric, or derived from the object name.

  • +
+
+
Throws
+

FactoryException

+
+
Returns
+

the suggested code, that is guaranteed to not conflict with an existing one.

+
+
+
+ +
+
+std::vector<std::string> getInsertStatementsFor(const common::IdentifiedObjectNNPtr &object, const std::string &authName, const std::string &code, bool numericCode, const std::vector<std::string> &allowedAuthorities = {"EPSG", "PROJ"})
+

Returns SQL statements needed to insert the passed object into the database.

+

startInsertStatementsSession() must have been called previously.

+

+
Since

8.1

+
+
+

+
+
Parameters
+
    +
  • object – The object to insert into the database. Currently only PrimeMeridian, Ellipsoid, Datum, GeodeticCRS, ProjectedCRS, VerticalCRS, CompoundCRS or BoundCRS are supported.

  • +
  • authName – Authority name into which the object will be inserted.

  • +
  • code – Code with which the object will be inserted.

  • +
  • numericCode – Whether intermediate objects that can be created should use numeric codes (true), or may be alphanumeric (false)

  • +
  • allowedAuthorities – Authorities to which intermediate objects are allowed to refer to. authName will be implicitly added to it. Note that unit, coordinate systems, projection methods and parameters will in any case be allowed to refer to EPSG.

  • +
+
+
Throws
+

FactoryException

+
+
+
+ +
+
+void stopInsertStatementsSession()
+

Stops an insertion session started with startInsertStatementsSession()

+

+
Since

8.1

+
+
+

+
+ +
+
+

Public Static Functions

+
+
+static DatabaseContextNNPtr create(const std::string &databasePath = std::string(), const std::vector<std::string> &auxiliaryDatabasePaths = std::vector<std::string>(), PJ_CONTEXT *ctx = nullptr)
+

Instantiate a database context.

+

This database context should be used only by one thread at a time.

+
+
Parameters
+
    +
  • databasePath – Path and filename of the database. Might be empty string for the default rules to locate the default proj.db

  • +
  • auxiliaryDatabasePaths – Path and filename of auxiliary databases. Might be empty. Starting with PROJ 8.1, if this parameter is an empty array, the PROJ_AUX_DB environment variable will be used, if set. It must contain one or several paths. If several paths are provided, they must be separated by the colon (:) character on Unix, and on Windows, by the semi-colon (;) character.

  • +
  • ctx – Context used for file search.

  • +
+
+
Throws
+

FactoryException

+
+
+
+ +
+
+ +
+
+class FactoryException : public osgeo::proj::util::Exception
+
+#include <io.hpp>
+

Exception thrown when a factory can’t create an instance of the requested object.

+

Subclassed by osgeo::proj::io::NoSuchAuthorityCodeException

+
+ +
+
+class FormattingException : public osgeo::proj::util::Exception
+
+#include <io.hpp>
+

Exception possibly thrown by IWKTExportable::exportToWKT() or IPROJStringExportable::exportToPROJString().

+
+ +
+
+class IJSONExportable
+
+#include <io.hpp>
+

Interface for an object that can be exported to JSON.

+

Subclassed by osgeo::proj::crs::CRS, osgeo::proj::cs::CoordinateSystem, osgeo::proj::cs::CoordinateSystemAxis, osgeo::proj::datum::Datum, osgeo::proj::datum::DatumEnsemble, osgeo::proj::datum::Ellipsoid, osgeo::proj::datum::PrimeMeridian, osgeo::proj::metadata::Identifier, osgeo::proj::operation::CoordinateOperation, osgeo::proj::operation::GeneralParameterValue, osgeo::proj::operation::OperationMethod

+
+

Public Functions

+
+
+std::string exportToJSON(JSONFormatter *formatter) const
+

Builds a JSON representation. May throw a FormattingException

+
+ +
+
+ +
+
+class IPROJStringExportable
+
+#include <io.hpp>
+

Interface for an object that can be exported to a PROJ string.

+

Subclassed by osgeo::proj::crs::BoundCRS, osgeo::proj::crs::CompoundCRS, osgeo::proj::crs::GeodeticCRS, osgeo::proj::crs::ProjectedCRS, osgeo::proj::crs::VerticalCRS, osgeo::proj::datum::Ellipsoid, osgeo::proj::datum::PrimeMeridian, osgeo::proj::operation::CoordinateOperation

+
+

Public Functions

+
+
+std::string exportToPROJString(PROJStringFormatter *formatter) const
+

Builds a PROJ string representation.

+

    +
  • For PROJStringFormatter::Convention::PROJ_5 (the default),

      +
    • For a crs::CRS, returns the same as PROJStringFormatter::Convention::PROJ_4. It should be noted that the export of a CRS as a PROJ string may cause loss of many important aspects of a CRS definition. Consequently it is discouraged to use it for interoperability in newer projects. The choice of a WKT representation will be a better option.

    • +
    • For operation::CoordinateOperation, returns a PROJ pipeline.

    • +
    +

    +

    +
  • +
  • For PROJStringFormatter::Convention::PROJ_4, format a string compatible with the OGRSpatialReference::exportToProj4() of GDAL <=2.3. It is only compatible of a few CRS objects. The PROJ string will also contain a +type=crs parameter to disambiguate the nature of the string from a CoordinateOperation.

      +
    • For a crs::GeographicCRS, returns a proj=longlat string, with ellipsoid / datum / prime meridian information, ignoring axis order and unit information.

    • +
    • For a geocentric crs::GeodeticCRS, returns the transformation from geographic coordinates into geocentric coordinates.

    • +
    • For a crs::ProjectedCRS, returns the projection method, ignoring axis order.

    • +
    • For a crs::BoundCRS, returns the PROJ string of its source/base CRS, amended with towgs84 / nadgrids parameter when the deriving conversion can be expressed in that way.

    • +
    +

    +

    +
  • +
+

+
+
Parameters
+

formatter – PROJ string formatter.

+
+
Throws
+

FormattingException

+
+
Returns
+

a PROJ string.

+
+
+
+ +
+
+ +
+
+class IWKTExportable
+
+#include <io.hpp>
+

Interface for an object that can be exported to WKT.

+

Subclassed by osgeo::proj::common::IdentifiedObject, osgeo::proj::metadata::Identifier, osgeo::proj::operation::GeneralParameterValue, osgeo::proj::operation::ParameterValue

+
+

Public Functions

+
+
+std::string exportToWKT(WKTFormatter *formatter) const
+

Builds a WKT representation. May throw a FormattingException

+
+ +
+
+ +
+
+class JSONFormatter
+
+#include <io.hpp>
+

Formatter to JSON strings.

+

An instance of this class can only be used by a single thread at a time.

+
+

Public Functions

+
+
+JSONFormatter &setMultiLine(bool multiLine) noexcept
+

Whether to use multi line output or not.

+
+ +
+
+JSONFormatter &setIndentationWidth(int width) noexcept
+

Set number of spaces for each indentation level (defaults to 4).

+
+ +
+
+JSONFormatter &setSchema(const std::string &schema) noexcept
+

Set the value of the “$schema” key in the top level object.

+

If set to empty string, it will not be written.

+
+ +
+
+const std::string &toString() const
+

Return the serialized JSON.

+
+ +
+
+

Public Static Functions

+
+
+static JSONFormatterNNPtr create(DatabaseContextPtr dbContext = nullptr)
+

Constructs a new formatter.

+

A formatter can be used only once (its internal state is mutated)

+
+
Returns
+

new formatter.

+
+
+
+ +
+
+ +
+
+class NoSuchAuthorityCodeException : public osgeo::proj::io::FactoryException
+
+#include <io.hpp>
+

Exception thrown when an authority factory can’t find the requested authority code.

+
+

Public Functions

+
+
+const std::string &getAuthority() const
+

Returns authority name.

+
+ +
+
+const std::string &getAuthorityCode() const
+

Returns authority code.

+
+ +
+
+ +
+
+class ParsingException : public osgeo::proj::util::Exception
+
+#include <io.hpp>
+

Exception possibly thrown by WKTNode::createFrom() or WKTParser::createFromWKT().

+
+ +
+
+class PROJStringFormatter
+
+#include <io.hpp>
+

Formatter to PROJ strings.

+

An instance of this class can only be used by a single thread at a time.

+
+

Public Types

+
+
+enum class Convention
+

PROJ variant.

+

Values:

+
+
+enumerator PROJ_5
+

PROJ v5 (or later versions) string.

+
+ +
+
+enumerator PROJ_4
+

PROJ v4 string as output by GDAL exportToProj4()

+
+ +
+ +
+
+

Public Functions

+
+
+PROJStringFormatter &setMultiLine(bool multiLine) noexcept
+

Whether to use multi line output or not.

+
+ +
+
+PROJStringFormatter &setIndentationWidth(int width) noexcept
+

Set number of spaces for each indentation level (defaults to 2).

+
+ +
+
+PROJStringFormatter &setMaxLineLength(int maxLineLength) noexcept
+

Set the maximum size of a line (when multiline output is enable). Can be set to 0 for unlimited length.

+
+ +
+
+void setUseApproxTMerc(bool flag)
+

Set whether approximate Transverse Mercator or UTM should be used.

+
+ +
+
+const std::string &toString() const
+

Returns the PROJ string.

+
+ +
+
+

Public Static Functions

+
+
+static PROJStringFormatterNNPtr create(Convention conventionIn = Convention::PROJ_5, DatabaseContextPtr dbContext = nullptr)
+

Constructs a new formatter.

+

A formatter can be used only once (its internal state is mutated)

+

Its default behavior can be adjusted with the different setters.

+
+
Parameters
+
    +
  • conventionIn – PROJ string flavor. Defaults to Convention::PROJ_5

  • +
  • dbContext – Database context (can help to find alternative grid names). May be nullptr

  • +
+
+
Returns
+

new formatter.

+
+
+
+ +
+
+ +
+
+class PROJStringParser
+
+#include <io.hpp>
+

Parse a PROJ string into the appropriate subclass of util::BaseObject.

+
+

Public Functions

+
+
+PROJStringParser &attachDatabaseContext(const DatabaseContextPtr &dbContext)
+

Attach a database context, to allow queries in it if needed.

+
+ +
+
+PROJStringParser &setUsePROJ4InitRules(bool enable)
+

Set how init=epsg:XXXX syntax should be interpreted.

+
+
Parameters
+

enable – When set to true, init=epsg:XXXX syntax will be allowed and will be interpreted according to PROJ.4 and PROJ.5 rules, that is geodeticCRS will have longitude, latitude order and will expect/output coordinates in radians. ProjectedCRS will have easting, northing axis order (except the ones with Transverse Mercator South Orientated projection).

+
+
+
+ +
+
+std::vector<std::string> warningList() const
+

Return the list of warnings found during parsing.

+
+ +
+
+util::BaseObjectNNPtr createFromPROJString(const std::string &projString)
+

Instantiate a sub-class of BaseObject from a PROJ string.

+

The projString must contain +type=crs for the object to be detected as a CRS instead of a CoordinateOperation.

+
+
Throws
+

ParsingException

+
+
+
+ +
+
+ +
+
+class WKTFormatter
+
+#include <io.hpp>
+

Formatter to WKT strings.

+

An instance of this class can only be used by a single thread at a time.

+
+

Public Types

+
+
+enum class Convention
+

WKT variant.

+

Values:

+
+
+enumerator WKT2
+

Full WKT2 string, conforming to ISO 19162:2015(E) / OGC 12-063r5 (WKT2:2015) with all possible nodes and new keyword names.

+
+ +
+
+enumerator WKT2_2015
+
+ +
+
+enumerator WKT2_SIMPLIFIED
+

Same as WKT2 with the following exceptions:

    +
  • UNIT keyword used.

  • +
  • ID node only on top element.

  • +
  • No ORDER element in AXIS element.

  • +
  • PRIMEM node omitted if it is Greenwich.

  • +
  • ELLIPSOID.UNIT node omitted if it is UnitOfMeasure::METRE.

  • +
  • PARAMETER.UNIT / PRIMEM.UNIT omitted if same as AXIS.

  • +
  • AXIS.UNIT omitted and replaced by a common GEODCRS.UNIT if they are all the same on all axis.

  • +
+

+
+ +
+
+enumerator WKT2_2015_SIMPLIFIED
+
+ +
+
+enumerator WKT2_2019
+

Full WKT2 string, conforming to ISO 19162:2019 / OGC 18-010, with (WKT2:2019) all possible nodes and new keyword names. Non-normative list of differences:

    +
  • WKT2_2019 uses GEOGCRS / BASEGEOGCRS keywords for GeographicCRS.

  • +
+

+
+ +
+
+enumerator WKT2_2018
+

Deprecated alias for WKT2_2019

+
+ +
+
+enumerator WKT2_2019_SIMPLIFIED
+

WKT2_2019 with the simplification rule of WKT2_SIMPLIFIED

+
+ +
+
+enumerator WKT2_2018_SIMPLIFIED
+

Deprecated alias for WKT2_2019_SIMPLIFIED

+
+ +
+
+enumerator WKT1_GDAL
+

WKT1 as traditionally output by GDAL, deriving from OGC 01-009. A notable departure from WKT1_GDAL with respect to OGC 01-009 is that in WKT1_GDAL, the unit of the PRIMEM value is always degrees.

+
+ +
+
+enumerator WKT1_ESRI
+

WKT1 as traditionally output by ESRI software, deriving from OGC 99-049.

+
+ +
+ +
+
+enum class OutputAxisRule
+

Rule for output AXIS nodes

+

Values:

+
+
+enumerator YES
+

Always include AXIS nodes

+
+ +
+
+enumerator NO
+

Never include AXIS nodes

+
+ +
+
+enumerator WKT1_GDAL_EPSG_STYLE
+

Includes them only on PROJCS node if it uses Easting/Northing ordering. Typically used for WKT1_GDAL

+
+ +
+ +
+
+

Public Functions

+
+
+WKTFormatter &setMultiLine(bool multiLine) noexcept
+

Whether to use multi line output or not.

+
+ +
+
+WKTFormatter &setIndentationWidth(int width) noexcept
+

Set number of spaces for each indentation level (defaults to 4).

+
+ +
+
+WKTFormatter &setOutputAxis(OutputAxisRule outputAxis) noexcept
+

Set whether AXIS nodes should be output.

+
+ +
+
+WKTFormatter &setStrict(bool strict) noexcept
+

Set whether the formatter should operate on strict more or not.

+

The default is strict mode, in which case a FormattingException can be thrown. In non-strict mode, a Geographic 3D CRS can be for example exported as WKT1_GDAL with 3 axes, whereas this is normally not allowed.

+
+ +
+
+bool isStrict() const noexcept
+

Returns whether the formatter is in strict mode.

+
+ +
+
+WKTFormatter &setAllowEllipsoidalHeightAsVerticalCRS(bool allow) noexcept
+

Set whether the formatter should export, in WKT1, a Geographic or Projected 3D CRS as a compound CRS whose vertical part represents an ellipsoidal height.

+
+ +
+
+bool isAllowedEllipsoidalHeightAsVerticalCRS() const noexcept
+

Return whether the formatter should export, in WKT1, a Geographic or Projected 3D CRS as a compound CRS whose vertical part represents an ellipsoidal height.

+
+ +
+
+const std::string &toString() const
+

Returns the WKT string from the formatter.

+
+ +
+
+

Public Static Functions

+
+
+static WKTFormatterNNPtr create(Convention convention = Convention::WKT2, DatabaseContextPtr dbContext = nullptr)
+

Constructs a new formatter.

+

A formatter can be used only once (its internal state is mutated)

+

Its default behavior can be adjusted with the different setters.

+
+
Parameters
+
    +
  • convention – WKT flavor. Defaults to Convention::WKT2

  • +
  • dbContext – Database context, to allow queries in it if needed. This is used for example for WKT1_ESRI output to do name substitutions.

  • +
+
+
Returns
+

new formatter.

+
+
+
+ +
+
+static WKTFormatterNNPtr create(const WKTFormatterNNPtr &other)
+

Constructs a new formatter from another one.

+

A formatter can be used only once (its internal state is mutated)

+

Its default behavior can be adjusted with the different setters.

+
+
Parameters
+

other – source formatter.

+
+
Returns
+

new formatter.

+
+
+
+ +
+
+ +
+
+class WKTNode
+
+#include <io.hpp>
+

Node in the tree-splitted WKT representation.

+
+

Public Functions

+
+
+explicit WKTNode(const std::string &valueIn)
+

Instantiate a WKTNode.

+
+
Parameters
+

valueIn – the name of the node.

+
+
+
+ +
+
+const std::string &value() const
+

Return the value of a node.

+
+ +
+
+const std::vector<WKTNodeNNPtr> &children() const
+

Return the children of a node.

+
+ +
+
+void addChild(WKTNodeNNPtr &&child)
+

Adds a child to the current node.

+
+
Parameters
+

child – child to add. This should not be a parent of this node.

+
+
+
+ +
+
+const WKTNodePtr &lookForChild(const std::string &childName, int occurrence = 0) const noexcept
+

Return the (occurrence-1)th sub-node of name childName.

+
+
Parameters
+
    +
  • childName – name of the child.

  • +
  • occurrence – occurrence index (starting at 0)

  • +
+
+
Returns
+

the child, or nullptr.

+
+
+
+ +
+
+int countChildrenOfName(const std::string &childName) const noexcept
+

Return the count of children of given name.

+
+
Parameters
+

childName – name of the children to look for.

+
+
Returns
+

count

+
+
+
+ +
+
+std::string toString() const
+

Return a WKT representation of the tree structure.

+
+ +
+
+

Public Static Functions

+
+
+static WKTNodeNNPtr createFrom(const std::string &wkt, size_t indexStart = 0)
+

Instantiate a WKTNode hierarchy from a WKT string.

+
+
Parameters
+
    +
  • wkt – the WKT string to parse.

  • +
  • indexStart – the start index in the wkt string.

  • +
+
+
Throws
+

ParsingException

+
+
+
+ +
+
+ +
+
+class WKTParser
+
+#include <io.hpp>
+

Parse a WKT string into the appropriate subclass of util::BaseObject.

+
+

Public Types

+
+
+enum class WKTGuessedDialect
+

Guessed WKT “dialect”

+

Values:

+
+
+enumerator WKT2_2019
+

WKT2:2019

+
+ +
+
+enumerator WKT2_2018
+

Deprecated alias for WKT2_2019

+
+ +
+
+enumerator WKT2_2015
+

WKT2:2015

+
+ +
+
+enumerator WKT1_GDAL
+

WKT1 specification

+
+ +
+
+enumerator WKT1_ESRI
+

ESRI variant of WKT1

+
+ +
+
+enumerator NOT_WKT
+

Not WKT / unrecognized

+
+ +
+ +
+
+

Public Functions

+
+
+WKTParser &attachDatabaseContext(const DatabaseContextPtr &dbContext)
+

Attach a database context, to allow queries in it if needed.

+
+ +
+
+WKTParser &setStrict(bool strict)
+

Set whether parsing should be done in strict mode.

+
+ +
+
+std::list<std::string> warningList() const
+

Return the list of warnings found during parsing.

+
+

Note

+

The list might be non-empty only is setStrict(false) has been called.

+
+
+ +
+
+util::BaseObjectNNPtr createFromWKT(const std::string &wkt)
+

Instantiate a sub-class of BaseObject from a WKT string.

+

By default, validation is strict (to the extent of the checks that are actually implemented. Currently only WKT1 strict grammar is checked), and any issue detected will cause an exception to be thrown, unless setStrict(false) is called priorly.

+

In non-strict mode, non-fatal issues will be recovered and simply listed in warningList(). This does not prevent more severe errors to cause an exception to be thrown.

+
+
Throws
+

ParsingException

+
+
+
+ +
+
+WKTGuessedDialect guessDialect(const std::string &wkt) noexcept
+

Guess the “dialect” of the WKT string.

+
+ +
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/development/reference/cpp/metadata.html b/development/reference/cpp/metadata.html new file mode 100644 index 00000000..a307f054 --- /dev/null +++ b/development/reference/cpp/metadata.html @@ -0,0 +1,872 @@ + + + + + + + metadata namespace — PROJ 9.0.0 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

metadata namespace

+
+
+namespace osgeo::proj::metadata
+

Common classes from ISO 19115 (Metadata) standard.

+

osgeo.proj.metadata namespace

+
+

Typedefs

+
+
+typedef std::shared_ptr<Extent> ExtentPtr
+

Shared pointer of Extent.

+
+ +
+
+typedef util::nn<ExtentPtr> ExtentNNPtr
+

Non-null shared pointer of Extent.

+
+ +
+
+using GeographicExtentPtr = std::shared_ptr<GeographicExtent>
+

Shared pointer of GeographicExtent.

+
+ +
+
+using GeographicExtentNNPtr = util::nn<GeographicExtentPtr>
+

Non-null shared pointer of GeographicExtent.

+
+ +
+
+using GeographicBoundingBoxPtr = std::shared_ptr<GeographicBoundingBox>
+

Shared pointer of GeographicBoundingBox.

+
+ +
+
+using GeographicBoundingBoxNNPtr = util::nn<GeographicBoundingBoxPtr>
+

Non-null shared pointer of GeographicBoundingBox.

+
+ +
+
+using TemporalExtentPtr = std::shared_ptr<TemporalExtent>
+

Shared pointer of TemporalExtent.

+
+ +
+
+using TemporalExtentNNPtr = util::nn<TemporalExtentPtr>
+

Non-null shared pointer of TemporalExtent.

+
+ +
+
+using VerticalExtentPtr = std::shared_ptr<VerticalExtent>
+

Shared pointer of VerticalExtent.

+
+ +
+
+using VerticalExtentNNPtr = util::nn<VerticalExtentPtr>
+

Non-null shared pointer of VerticalExtent.

+
+ +
+
+using IdentifierPtr = std::shared_ptr<Identifier>
+

Shared pointer of Identifier.

+
+ +
+
+using IdentifierNNPtr = util::nn<IdentifierPtr>
+

Non-null shared pointer of Identifier.

+
+ +
+
+using PositionalAccuracyPtr = std::shared_ptr<PositionalAccuracy>
+

Shared pointer of PositionalAccuracy.

+
+ +
+
+using PositionalAccuracyNNPtr = util::nn<PositionalAccuracyPtr>
+

Non-null shared pointer of PositionalAccuracy.

+
+ +
+
+
+class Citation : public osgeo::proj::util::BaseObject
+
+#include <metadata.hpp>
+

Standardized resource reference.

+

A citation contains a title.

+

+

+
+

Public Functions

+
+
+explicit Citation(const std::string &titleIn)
+

Constructs a citation by its title.

+
+ +
+
+const util::optional<std::string> &title()
+

Returns the name by which the cited resource is known.

+
+ +
+
+ +
+
+class Extent : public osgeo::proj::util::BaseObject, public osgeo::proj::util::IComparable
+
+#include <metadata.hpp>
+

Information about spatial, vertical, and temporal extent.

+

+

+
+

Public Functions

+
+
+const util::optional<std::string> &description()
+

Return a textual description of the extent.

+
+
Returns
+

the description, or empty.

+
+
+
+ +
+
+const std::vector<GeographicExtentNNPtr> &geographicElements()
+

Return the geographic element(s) of the extent

+
+
Returns
+

the geographic element(s), or empty.

+
+
+
+ +
+
+const std::vector<TemporalExtentNNPtr> &temporalElements()
+

Return the temporal element(s) of the extent

+
+
Returns
+

the temporal element(s), or empty.

+
+
+
+ +
+
+const std::vector<VerticalExtentNNPtr> &verticalElements()
+

Return the vertical element(s) of the extent

+
+
Returns
+

the vertical element(s), or empty.

+
+
+
+ +
+
+bool contains(const ExtentNNPtr &other) const
+

Returns whether this extent contains the other one.

+

Behavior only well specified if each sub-extent category as at most one element.

+
+ +
+
+bool intersects(const ExtentNNPtr &other) const
+

Returns whether this extent intersects the other one.

+

Behavior only well specified if each sub-extent category as at most one element.

+
+ +
+
+ExtentPtr intersection(const ExtentNNPtr &other) const
+

Returns the intersection of this extent with another one.

+

Behavior only well specified if there is one single GeographicExtent in each object. Returns nullptr otherwise.

+
+ +
+
+

Public Static Functions

+
+
+static ExtentNNPtr create(const util::optional<std::string> &descriptionIn, const std::vector<GeographicExtentNNPtr> &geographicElementsIn, const std::vector<VerticalExtentNNPtr> &verticalElementsIn, const std::vector<TemporalExtentNNPtr> &temporalElementsIn)
+

Instantiate a Extent.

+
+
Parameters
+
    +
  • descriptionIn – Textual description, or empty.

  • +
  • geographicElementsIn – Geographic element(s), or empty.

  • +
  • verticalElementsIn – Vertical element(s), or empty.

  • +
  • temporalElementsIn – Temporal element(s), or empty.

  • +
+
+
Returns
+

a new Extent.

+
+
+
+ +
+
+static ExtentNNPtr createFromBBOX(double west, double south, double east, double north, const util::optional<std::string> &descriptionIn = util::optional<std::string>())
+

Instantiate a Extent from a bounding box.

+
+
Parameters
+
    +
  • west – Western-most coordinate of the limit of the dataset extent (in degrees).

  • +
  • south – Southern-most coordinate of the limit of the dataset extent (in degrees).

  • +
  • east – Eastern-most coordinate of the limit of the dataset extent (in degrees).

  • +
  • north – Northern-most coordinate of the limit of the dataset extent (in degrees).

  • +
  • descriptionIn – Textual description, or empty.

  • +
+
+
Returns
+

a new Extent.

+
+
+
+ +
+
+

Public Static Attributes

+
+
+static const ExtentNNPtr WORLD
+

World extent.

+
+ +
+
+ +
+
+class GeographicBoundingBox : public osgeo::proj::metadata::GeographicExtent
+
+#include <metadata.hpp>
+

Geographic position of the dataset.

+

This is only an approximate so specifying the coordinate reference system is unnecessary.

+

+

+
+

Public Functions

+
+
+double westBoundLongitude()
+

Returns the western-most coordinate of the limit of the dataset extent.

+

The unit is degrees.

+

If eastBoundLongitude < westBoundLongitude(), then the bounding box crosses the anti-meridian.

+
+ +
+
+double southBoundLatitude()
+

Returns the southern-most coordinate of the limit of the dataset extent.

+

The unit is degrees.

+
+ +
+
+double eastBoundLongitude()
+

Returns the eastern-most coordinate of the limit of the dataset extent.

+

The unit is degrees.

+

If eastBoundLongitude < westBoundLongitude(), then the bounding box crosses the anti-meridian.

+
+ +
+
+double northBoundLatitude()
+

Returns the northern-most coordinate of the limit of the dataset extent.

+

The unit is degrees.

+
+ +
+
+virtual bool contains(const GeographicExtentNNPtr &other) const override
+

Returns whether this extent contains the other one.

+
+ +
+
+virtual bool intersects(const GeographicExtentNNPtr &other) const override
+

Returns whether this extent intersects the other one.

+
+ +
+
+virtual GeographicExtentPtr intersection(const GeographicExtentNNPtr &other) const override
+

Returns the intersection of this extent with another one.

+
+ +
+
+

Public Static Functions

+
+
+static GeographicBoundingBoxNNPtr create(double west, double south, double east, double north)
+

Instantiate a GeographicBoundingBox.

+

If east < west, then the bounding box crosses the anti-meridian.

+
+
Parameters
+
    +
  • west – Western-most coordinate of the limit of the dataset extent (in degrees).

  • +
  • south – Southern-most coordinate of the limit of the dataset extent (in degrees).

  • +
  • east – Eastern-most coordinate of the limit of the dataset extent (in degrees).

  • +
  • north – Northern-most coordinate of the limit of the dataset extent (in degrees).

  • +
+
+
Returns
+

a new GeographicBoundingBox.

+
+
+
+ +
+
+ +
+
+class GeographicExtent : public osgeo::proj::util::BaseObject, public osgeo::proj::util::IComparable
+
+#include <metadata.hpp>
+

Base interface for geographic area of the dataset.

+

+

+

Subclassed by osgeo::proj::metadata::GeographicBoundingBox

+
+

Public Functions

+
+
+virtual bool contains(const GeographicExtentNNPtr &other) const = 0
+

Returns whether this extent contains the other one.

+
+ +
+
+virtual bool intersects(const GeographicExtentNNPtr &other) const = 0
+

Returns whether this extent intersects the other one.

+
+ +
+
+virtual GeographicExtentPtr intersection(const GeographicExtentNNPtr &other) const = 0
+

Returns the intersection of this extent with another one.

+
+ +
+
+ +
+
+class Identifier : public osgeo::proj::util::BaseObject, public osgeo::proj::io::IWKTExportable, public osgeo::proj::io::IJSONExportable
+
+#include <metadata.hpp>
+

Value uniquely identifying an object within a namespace.

+

+

Remark

+

Implements Identifier as described in ISO 19111:2019 but which originates from ISO 19115 (Metadata)

+
+

+
+

Public Functions

+
+
+const util::optional<Citation> &authority()
+

Return a citation for the organization responsible for definition and maintenance of the code.

+
+
Returns
+

the citation for the authority, or empty.

+
+
+
+ +
+
+const std::string &code()
+

Return the alphanumeric value identifying an instance in the codespace.

+

e.g. “4326” (for EPSG:4326 WGS 84 GeographicCRS)

+
+
Returns
+

the code.

+
+
+
+ +
+
+const util::optional<std::string> &codeSpace()
+

Return the organization responsible for definition and maintenance of the code.

+

e.g “EPSG”

+
+
Returns
+

the authority codespace, or empty.

+
+
+
+ +
+
+const util::optional<std::string> &version()
+

Return the version identifier for the namespace.

+

When appropriate, the edition is identified by the effective date, coded using ISO 8601 date format.

+
+
Returns
+

the version or empty.

+
+
+
+ +
+
+const util::optional<std::string> &description()
+

Return the natural language description of the meaning of the code value.

+
+
Returns
+

the description or empty.

+
+
+
+ +
+
+const util::optional<std::string> &uri()
+

Return the URI of the identifier.

+
+
Returns
+

the URI or empty.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static IdentifierNNPtr create(const std::string &codeIn = std::string(), const util::PropertyMap &properties = util::PropertyMap())
+

Instantiate a Identifier.

+
+
Parameters
+
+
+
Returns
+

a new Identifier.

+
+
+
+ +
+
+static bool isEquivalentName(const char *a, const char *b) noexcept
+

Returns whether two names are considered equivalent.

+

Two names are equivalent by removing any space, underscore, dash, slash, { or } character from them, and comparing in a case insensitive way.

+
+ +
+
+

Public Static Attributes

+
+
+static const std::string AUTHORITY_KEY
+

Key to set the authority citation of a metadata::Identifier.

+

The value is to be provided as a string or a metadata::Citation.

+
+ +
+
+static const std::string CODE_KEY
+

Key to set the code of a metadata::Identifier.

+

The value is to be provided as a integer or a string.

+
+ +
+
+static const std::string CODESPACE_KEY
+

Key to set the organization responsible for definition and maintenance of the code of a metadata::Identifier.

+

The value is to be provided as a string.

+
+ +
+
+static const std::string VERSION_KEY
+

Key to set the version identifier for the namespace of a metadata::Identifier.

+

The value is to be provided as a string.

+
+ +
+
+static const std::string DESCRIPTION_KEY
+

Key to set the natural language description of the meaning of the code value of a metadata::Identifier.

+

The value is to be provided as a string.

+
+ +
+
+static const std::string URI_KEY
+

Key to set the URI of a metadata::Identifier.

+

The value is to be provided as a string.

+
+ +
+
+static const std::string EPSG
+

EPSG codespace.

+
+ +
+
+static const std::string OGC
+

OGC codespace.

+
+ +
+
+ +
+
+class PositionalAccuracy : public osgeo::proj::util::BaseObject
+
+#include <metadata.hpp>
+

Accuracy of the position of features.

+

+

+
+

Public Functions

+
+
+const std::string &value()
+

Return the value of the positional accuracy.

+
+ +
+
+

Public Static Functions

+
+
+static PositionalAccuracyNNPtr create(const std::string &valueIn)
+

Instantiate a PositionalAccuracy.

+
+
Parameters
+

valueIn – positional accuracy value.

+
+
Returns
+

a new PositionalAccuracy.

+
+
+
+ +
+
+ +
+
+class TemporalExtent : public osgeo::proj::util::BaseObject, public osgeo::proj::util::IComparable
+
+#include <metadata.hpp>
+

Time period covered by the content of the dataset.

+

+

+
+

Public Functions

+
+
+const std::string &start()
+

Returns the start of the temporal extent.

+
+ +
+
+const std::string &stop()
+

Returns the end of the temporal extent.

+
+ +
+
+bool contains(const TemporalExtentNNPtr &other) const
+

Returns whether this extent contains the other one.

+
+ +
+
+bool intersects(const TemporalExtentNNPtr &other) const
+

Returns whether this extent intersects the other one.

+
+ +
+
+

Public Static Functions

+
+
+static TemporalExtentNNPtr create(const std::string &start, const std::string &stop)
+

Instantiate a TemporalExtent.

+
+
Parameters
+
    +
  • start – start.

  • +
  • stop – stop.

  • +
+
+
Returns
+

a new TemporalExtent.

+
+
+
+ +
+
+ +
+
+class VerticalExtent : public osgeo::proj::util::BaseObject, public osgeo::proj::util::IComparable
+
+#include <metadata.hpp>
+

Vertical domain of dataset.

+

+

+
+

Public Functions

+
+
+double minimumValue()
+

Returns the minimum of the vertical extent.

+
+ +
+
+double maximumValue()
+

Returns the maximum of the vertical extent.

+
+ +
+
+common::UnitOfMeasureNNPtr &unit()
+

Returns the unit of the vertical extent.

+
+ +
+
+bool contains(const VerticalExtentNNPtr &other) const
+

Returns whether this extent contains the other one.

+
+ +
+
+bool intersects(const VerticalExtentNNPtr &other) const
+

Returns whether this extent intersects the other one.

+
+ +
+
+

Public Static Functions

+
+
+static VerticalExtentNNPtr create(double minimumValue, double maximumValue, const common::UnitOfMeasureNNPtr &unitIn)
+

Instantiate a VerticalExtent.

+
+
Parameters
+
    +
  • minimumIn – minimum.

  • +
  • maximumIn – maximum.

  • +
  • unitIn – unit.

  • +
+
+
Returns
+

a new VerticalExtent.

+
+
+
+ +
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/development/reference/cpp/operation.html b/development/reference/cpp/operation.html new file mode 100644 index 00000000..cb5ba8cb --- /dev/null +++ b/development/reference/cpp/operation.html @@ -0,0 +1,4030 @@ + + + + + + + operation namespace — PROJ 9.0.0 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

operation namespace

+
+
+namespace osgeo::proj::operation
+

Coordinate operations (relationship between any two coordinate reference systems).

+

osgeo.proj.operation namespace

+

This covers Conversion, Transformation, PointMotionOperation or ConcatenatedOperation.

+
+

Typedefs

+
+
+typedef std::shared_ptr<CoordinateOperation> CoordinateOperationPtr
+

Shared pointer of CoordinateOperation

+
+ +
+
+typedef util::nn<CoordinateOperationPtr> CoordinateOperationNNPtr
+

Non-null shared pointer of CoordinateOperation

+
+ +
+
+using GeneralOperationParameterPtr = std::shared_ptr<GeneralOperationParameter>
+

Shared pointer of GeneralOperationParameter

+
+ +
+
+using GeneralOperationParameterNNPtr = util::nn<GeneralOperationParameterPtr>
+

Non-null shared pointer of GeneralOperationParameter

+
+ +
+
+using OperationParameterPtr = std::shared_ptr<OperationParameter>
+

Shared pointer of OperationParameter

+
+ +
+
+using OperationParameterNNPtr = util::nn<OperationParameterPtr>
+

Non-null shared pointer of OperationParameter

+
+ +
+
+using GeneralParameterValuePtr = std::shared_ptr<GeneralParameterValue>
+

Shared pointer of GeneralParameterValue

+
+ +
+
+using GeneralParameterValueNNPtr = util::nn<GeneralParameterValuePtr>
+

Non-null shared pointer of GeneralParameterValue

+
+ +
+
+using ParameterValuePtr = std::shared_ptr<ParameterValue>
+

Shared pointer of ParameterValue

+
+ +
+
+using ParameterValueNNPtr = util::nn<ParameterValuePtr>
+

Non-null shared pointer of ParameterValue

+
+ +
+
+using OperationParameterValuePtr = std::shared_ptr<OperationParameterValue>
+

Shared pointer of OperationParameterValue

+
+ +
+
+using OperationParameterValueNNPtr = util::nn<OperationParameterValuePtr>
+

Non-null shared pointer of OperationParameterValue

+
+ +
+
+using OperationMethodPtr = std::shared_ptr<OperationMethod>
+

Shared pointer of OperationMethod

+
+ +
+
+using OperationMethodNNPtr = util::nn<OperationMethodPtr>
+

Non-null shared pointer of OperationMethod

+
+ +
+
+using SingleOperationPtr = std::shared_ptr<SingleOperation>
+

Shared pointer of SingleOperation

+
+ +
+
+using SingleOperationNNPtr = util::nn<SingleOperationPtr>
+

Non-null shared pointer of SingleOperation

+
+ +
+
+typedef std::shared_ptr<Conversion> ConversionPtr
+

Shared pointer of Conversion

+
+ +
+
+typedef util::nn<ConversionPtr> ConversionNNPtr
+

Non-null shared pointer of Conversion

+
+ +
+
+using TransformationPtr = std::shared_ptr<Transformation>
+

Shared pointer of Transformation

+
+ +
+
+using TransformationNNPtr = util::nn<TransformationPtr>
+

Non-null shared pointer of Transformation

+
+ +
+
+using PointMotionOperationPtr = std::shared_ptr<PointMotionOperation>
+

Shared pointer of PointMotionOperation

+
+ +
+
+using PointMotionOperationNNPtr = util::nn<PointMotionOperationPtr>
+

Non-null shared pointer of PointMotionOperation

+
+ +
+
+using ConcatenatedOperationPtr = std::shared_ptr<ConcatenatedOperation>
+

Shared pointer of ConcatenatedOperation

+
+ +
+
+using ConcatenatedOperationNNPtr = util::nn<ConcatenatedOperationPtr>
+

Non-null shared pointer of ConcatenatedOperation

+
+ +
+
+using CoordinateOperationContextPtr = std::unique_ptr<CoordinateOperationContext>
+

Unique pointer of CoordinateOperationContext

+
+ +
+
+using CoordinateOperationContextNNPtr = util::nn<CoordinateOperationContextPtr>
+

Non-null unique pointer of CoordinateOperationContext

+
+ +
+
+using CoordinateOperationFactoryPtr = std::unique_ptr<CoordinateOperationFactory>
+

Unique pointer of CoordinateOperationFactory

+
+ +
+
+using CoordinateOperationFactoryNNPtr = util::nn<CoordinateOperationFactoryPtr>
+

Non-null unique pointer of CoordinateOperationFactory

+
+ +
+
+

Functions

+
+
+static double negate(double val)
+
+ +
+
+static CoordinateOperationPtr createApproximateInverseIfPossible(const Transformation *op)
+
+ +
+
+
+class ConcatenatedOperation : public osgeo::proj::operation::CoordinateOperation
+
+#include <coordinateoperation.hpp>
+

An ordered sequence of two or more single coordinate operations (SingleOperation).

+

The sequence of coordinate operations is constrained by the requirement that the source coordinate reference system of step n+1 shall be the same as the target coordinate reference system of step n.

+

+

Remark

+

Implements ConcatenatedOperation from ISO 19111:2019

+
+

+
+

Public Functions

+
+
+const std::vector<CoordinateOperationNNPtr> &operations() const
+

Return the operation steps of the concatenated operation.

+
+
Returns
+

the operation steps.

+
+
+
+ +
+
+virtual CoordinateOperationNNPtr inverse() const override
+

Return the inverse of the coordinate operation.

+
+
Throws
+

util::UnsupportedOperationException

+
+
+
+ +
+
+virtual std::set<GridDescription> gridsNeeded(const io::DatabaseContextPtr &databaseContext, bool considerKnownGridsAsAvailable) const override
+

Return grids needed by an operation.

+
+ +
+
+

Public Static Functions

+
+
+static ConcatenatedOperationNNPtr create(const util::PropertyMap &properties, const std::vector<CoordinateOperationNNPtr> &operationsIn, const std::vector<metadata::PositionalAccuracyNNPtr> &accuracies)
+

Instantiate a ConcatenatedOperation.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • operationsIn – Vector of the CoordinateOperation steps.

  • +
  • accuracies – Vector of positional accuracy (might be empty).

  • +
+
+
Throws
+

InvalidOperation

+
+
Returns
+

new Transformation.

+
+
+
+ +
+
+static CoordinateOperationNNPtr createComputeMetadata(const std::vector<CoordinateOperationNNPtr> &operationsIn, bool checkExtent)
+

Instantiate a ConcatenatedOperation, or return a single coordinate operation.

+

This computes its accuracy from the sum of its member operations, its extent

+
+
Parameters
+
    +
  • operationsIn – Vector of the CoordinateOperation steps.

  • +
  • checkExtent – Whether we should check the non-emptiness of the intersection of the extents of the operations

  • +
+
+
Throws
+

InvalidOperation

+
+
+
+ +
+
+ +
+
+class Conversion : public osgeo::proj::operation::SingleOperation
+
+#include <coordinateoperation.hpp>
+

A mathematical operation on coordinates in which the parameter values are defined rather than empirically derived.

+

Application of the coordinate conversion introduces no error into output coordinates. The best-known example of a coordinate conversion is a map projection. For coordinate conversions the output coordinates are referenced to the same datum as are the input coordinates.

+

Coordinate conversions forming a component of a derived CRS have a source crs::CRS and a target crs::CRS that are NOT specified through the source and target associations, but through associations from crs::DerivedCRS to crs::SingleCRS.

+

+

Remark

+

Implements Conversion from ISO 19111:2019

+
+

+
+

Projection parameters

+
+

Co-latitude of cone axis

+

The rotation applied to spherical coordinates for the oblique projection, measured on the conformal sphere in the plane of the meridian of origin.

+

EPSG:1036

+
+
+

Latitude of natural origin/Center Latitude

+

The latitude of the point from which the values of both the geographical coordinates on the ellipsoid and the grid coordinates on the projection are deemed to increment or decrement for computational purposes. Alternatively it may be considered as the latitude of the point which in the absence of application of false coordinates has grid coordinates of (0,0).

+

EPSG:8801

+
+
+

Longitude of natural origin/Central Meridian

+

The longitude of the point from which the values of both the geographical coordinates on the ellipsoid and the grid coordinates on the projection are deemed to increment or decrement for computational purposes. Alternatively it may be considered as the longitude of the point which in the absence of application of false coordinates has grid coordinates of (0,0). Sometimes known as “central meridian (CM)”.

+

EPSG:8802

+
+
+

Scale Factor

+

The factor by which the map grid is reduced or enlarged during the projection process, defined by its value at the natural origin.

+

EPSG:8805

+
+
+

False Easting

+

Since the natural origin may be at or near the centre of the projection and under normal coordinate circumstances would thus give rise to negative coordinates over parts of the mapped area, this origin is usually given false coordinates which are large enough to avoid this inconvenience. The False Easting, FE, is the value assigned to the abscissa (east or west) axis of the projection grid at the natural origin.

+

EPSG:8806

+
+
+

False Northing

+

Since the natural origin may be at or near the centre of the projection and under normal coordinate circumstances would thus give rise to negative coordinates over parts of the mapped area, this origin is usually given false coordinates which are large enough to avoid this inconvenience. The False Northing, FN, is the value assigned to the ordinate (north or south) axis of the projection grid at the natural origin.

+

EPSG:8807

+
+
+

Latitude of projection centre

+

For an oblique projection, this is the latitude of the point at which the azimuth of the central line is defined.

+

EPSG:8811

+
+
+

Longitude of projection centre

+

For an oblique projection, this is the longitude of the point at which the azimuth of the central line is defined.

+

EPSG:8812

+
+
+

Azimuth of initial line

+

The azimuthal direction (north zero, east of north being positive) of the great circle which is the centre line of an oblique projection. The azimuth is given at the projection centre.

+

EPSG:8813

+
+
+

Angle from Rectified to Skew Grid

+

The angle at the natural origin of an oblique projection through which the natural coordinate reference system is rotated to make the projection north axis parallel with true north.

+

EPSG:8814

+
+
+

Scale factor on initial line

+

The factor by which the map grid is reduced or enlarged during the projection process, defined by its value at the projection center.

+

EPSG:8815

+
+
+

Easting at projection centre

+

The easting value assigned to the projection centre.

+

EPSG:8816

+
+
+

Northing at projection centre

+

The northing value assigned to the projection centre.

+

EPSG:8817

+
+
+

Latitude of pseudo standard

+

parallel

+

Latitude of the parallel on which the conic or cylindrical projection is based. This latitude is not geographic, but is defined on the conformal sphere AFTER its rotation to obtain the oblique aspect of the projection.

+

EPSG:8818

+
+
+

Scale factor on pseudo

+

standard parallel

+

The factor by which the map grid is reduced or enlarged during the projection process, defined by its value at the pseudo-standard parallel. EPSG:8819

+
+
+

Latitude of false origin

+

The latitude of the point which is not the natural origin and at which grid coordinate values false easting and false northing are defined.

+

EPSG:8821

+
+
+

Longitude of false origin

+

The longitude of the point which is not the natural origin and at which grid coordinate values false easting and false northing are defined.

+

EPSG:8822

+
+
+

Latitude of 1st standard parallel

+

For a conic projection with two standard parallels, this is the latitude of one of the parallels of intersection of the cone with the ellipsoid. It is normally but not necessarily that nearest to the pole. Scale is true along this parallel.

+

EPSG:8823

+
+
+

Latitude of 2nd standard parallel

+

For a conic projection with two standard parallels, this is the latitude of one of the parallels at which the cone intersects with the ellipsoid. It is normally but not necessarily that nearest to the equator. Scale is true along this parallel.

+

EPSG:8824

+
+
+

Easting of false origin

+

The easting value assigned to the false origin.

+

EPSG:8826

+
+
+

Northing of false origin

+

The northing value assigned to the false origin.

+

EPSG:8827

+
+
+

Latitude of standard parallel

+

For polar aspect azimuthal projections, the parallel on which the scale factor is defined to be unity.

+

EPSG:8832

+
+
+

Longitude of origin

+

For polar aspect azimuthal projections, the meridian along which the northing axis increments and also across which parallels of latitude increment towards the north pole.

+

EPSG:8833

+
+
+
+

Public Functions

+
+
+virtual CoordinateOperationNNPtr inverse() const override
+

Return the inverse of the coordinate operation.

+
+
Throws
+

util::UnsupportedOperationException

+
+
+
+ +
+
+bool isUTM(int &zone, bool &north) const
+

Return whether a conversion is a [Universal Transverse Mercator] (https://proj.org/operations/projections/utm.html) conversion.

+
+
Parameters
+
    +
  • zone[out] UTM zone number between 1 and 60.

  • +
  • north[out] true for UTM northern hemisphere, false for UTM southern hemisphere.

  • +
+
+
Returns
+

true if it is a UTM conversion.

+
+
+
+ +
+
+ConversionNNPtr identify() const
+

Return a Conversion object where some parameters are better identified.

+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+ConversionPtr convertToOtherMethod(int targetEPSGCode) const
+

Return an equivalent projection.

+

Currently implemented:

    +
  • EPSG_CODE_METHOD_MERCATOR_VARIANT_A (1SP) to EPSG_CODE_METHOD_MERCATOR_VARIANT_B (2SP)

  • +
  • EPSG_CODE_METHOD_MERCATOR_VARIANT_B (2SP) to EPSG_CODE_METHOD_MERCATOR_VARIANT_A (1SP)

  • +
  • EPSG_CODE_METHOD_LAMBERT_CONIC_CONFORMAL_1SP to EPSG_CODE_METHOD_LAMBERT_CONIC_CONFORMAL_2SP

  • +
  • EPSG_CODE_METHOD_LAMBERT_CONIC_CONFORMAL_2SP to EPSG_CODE_METHOD_LAMBERT_CONIC_CONFORMAL_1SP

  • +
+

+
+
Parameters
+

targetEPSGCode – EPSG code of the target method.

+
+
Returns
+

new conversion, or nullptr

+
+
+
+ +
+
+

Public Static Functions

+
+
+static ConversionNNPtr create(const util::PropertyMap &properties, const OperationMethodNNPtr &methodIn, const std::vector<GeneralParameterValueNNPtr> &values)
+

Instantiate a Conversion from a vector of GeneralParameterValue.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • methodIn – the operation method.

  • +
  • values – the values.

  • +
+
+
Throws
+

InvalidOperation

+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr create(const util::PropertyMap &propertiesConversion, const util::PropertyMap &propertiesOperationMethod, const std::vector<OperationParameterNNPtr> &parameters, const std::vector<ParameterValueNNPtr> &values)
+

Instantiate a Conversion and its OperationMethod.

+
+
Parameters
+
    +
  • propertiesConversion – See General properties of the conversion. At minimum the name should be defined.

  • +
  • propertiesOperationMethod – See General properties of the operation method. At minimum the name should be defined.

  • +
  • parameters – the operation parameters.

  • +
  • values – the operation values. Constraint: values.size() == parameters.size()

  • +
+
+
Throws
+

InvalidOperation

+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createUTM(const util::PropertyMap &properties, int zone, bool north)
+

Instantiate a [Universal Transverse Mercator] (https://proj.org/operations/projections/utm.html) conversion.

+

UTM is a family of conversions, of EPSG codes from 16001 to 16060 for the northern hemisphere, and 17001 to 17060 for the southern hemisphere, based on the Transverse Mercator projection method.

+
+
Parameters
+
    +
  • properties – See General properties of the conversion. If the name is not provided, it is automatically set.

  • +
  • zone – UTM zone number between 1 and 60.

  • +
  • north – true for UTM northern hemisphere, false for UTM southern hemisphere.

  • +
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createTransverseMercator(const util::PropertyMap &properties, const common::Angle &centerLat, const common::Angle &centerLong, const common::Scale &scale, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Transverse Mercator] (https://proj.org/operations/projections/tmerc.html) projection method.

+

This method is defined as [EPSG:9807] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9807)

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createGaussSchreiberTransverseMercator(const util::PropertyMap &properties, const common::Angle &centerLat, const common::Angle &centerLong, const common::Scale &scale, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Gauss Schreiber Transverse Mercator] (https://proj.org/operations/projections/gstmerc.html) projection method.

+

This method is also known as Gauss-Laborde Reunion.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createTransverseMercatorSouthOriented(const util::PropertyMap &properties, const common::Angle &centerLat, const common::Angle &centerLong, const common::Scale &scale, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Transverse Mercator South Orientated] (https://proj.org/operations/projections/tmerc.html) projection method.

+

This method is defined as [EPSG:9808] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9808)

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createTwoPointEquidistant(const util::PropertyMap &properties, const common::Angle &latitudeFirstPoint, const common::Angle &longitudeFirstPoint, const common::Angle &latitudeSecondPoint, const common::Angle &longitudeSeconPoint, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Two Point Equidistant] (https://proj.org/operations/projections/tpeqd.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
    +
  • properties – See General properties of the conversion. If the name is not provided, it is automatically set.

  • +
  • latitudeFirstPoint – Latitude of first point.

  • +
  • longitudeFirstPoint – Longitude of first point.

  • +
  • latitudeSecondPoint – Latitude of second point.

  • +
  • longitudeSeconPoint – Longitude of second point.

  • +
  • falseEasting – See False Easting

  • +
  • falseNorthing – See False Northing

  • +
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createTunisiaMappingGrid(const util::PropertyMap &properties, const common::Angle &centerLat, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the Tunisia Mapping Grid projection method.

+

This method is defined as [EPSG:9816] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9816)

+
+

Note

+

There is currently no implementation of the method formulas in PROJ.

+
+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createAlbersEqualArea(const util::PropertyMap &properties, const common::Angle &latitudeFalseOrigin, const common::Angle &longitudeFalseOrigin, const common::Angle &latitudeFirstParallel, const common::Angle &latitudeSecondParallel, const common::Length &eastingFalseOrigin, const common::Length &northingFalseOrigin)
+

Instantiate a conversion based on the [Albers Conic Equal Area] (https://proj.org/operations/projections/aea.html) projection method.

+

This method is defined as [EPSG:9822] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9822)

+
+

Note

+

the order of arguments is conformant with the corresponding EPSG mode and different than OGRSpatialReference::setACEA() of GDAL <= 2.3

+
+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createLambertConicConformal_1SP(const util::PropertyMap &properties, const common::Angle &centerLat, const common::Angle &centerLong, const common::Scale &scale, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Lambert Conic Conformal 1SP] (https://proj.org/operations/projections/lcc.html) projection method.

+

This method is defined as [EPSG:9801] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9801)

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createLambertConicConformal_2SP(const util::PropertyMap &properties, const common::Angle &latitudeFalseOrigin, const common::Angle &longitudeFalseOrigin, const common::Angle &latitudeFirstParallel, const common::Angle &latitudeSecondParallel, const common::Length &eastingFalseOrigin, const common::Length &northingFalseOrigin)
+

Instantiate a conversion based on the [Lambert Conic Conformal (2SP)] (https://proj.org/operations/projections/lcc.html) projection method.

+

This method is defined as [EPSG:9802] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9802)

+
+

Note

+

the order of arguments is conformant with the corresponding EPSG mode and different than OGRSpatialReference::setLCC() of GDAL <= 2.3

+
+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createLambertConicConformal_2SP_Michigan(const util::PropertyMap &properties, const common::Angle &latitudeFalseOrigin, const common::Angle &longitudeFalseOrigin, const common::Angle &latitudeFirstParallel, const common::Angle &latitudeSecondParallel, const common::Length &eastingFalseOrigin, const common::Length &northingFalseOrigin, const common::Scale &ellipsoidScalingFactor)
+

Instantiate a conversion based on the [Lambert Conic Conformal (2SP Michigan)] (https://proj.org/operations/projections/lcc.html) projection method.

+

This method is defined as [EPSG:1051] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::1051)

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createLambertConicConformal_2SP_Belgium(const util::PropertyMap &properties, const common::Angle &latitudeFalseOrigin, const common::Angle &longitudeFalseOrigin, const common::Angle &latitudeFirstParallel, const common::Angle &latitudeSecondParallel, const common::Length &eastingFalseOrigin, const common::Length &northingFalseOrigin)
+

Instantiate a conversion based on the [Lambert Conic Conformal (2SP Belgium)] (https://proj.org/operations/projections/lcc.html) projection method.

+

This method is defined as [EPSG:9803] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9803)

+
+

Note

+

the order of arguments is conformant with the corresponding EPSG mode and different than OGRSpatialReference::setLCCB() of GDAL <= 2.3

+
+
+

Warning

+

The formulas used currently in PROJ are, incorrectly, the ones of the regular LCC_2SP method.

+
+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createAzimuthalEquidistant(const util::PropertyMap &properties, const common::Angle &latitudeNatOrigin, const common::Angle &longitudeNatOrigin, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Modified Azimuthal Equidistant] (https://proj.org/operations/projections/aeqd.html) projection method.

+

This method is defined as [EPSG:9832] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9832)

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createGuamProjection(const util::PropertyMap &properties, const common::Angle &latitudeNatOrigin, const common::Angle &longitudeNatOrigin, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Guam Projection] (https://proj.org/operations/projections/aeqd.html) projection method.

+

This method is defined as [EPSG:9831] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9831)

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createBonne(const util::PropertyMap &properties, const common::Angle &latitudeNatOrigin, const common::Angle &longitudeNatOrigin, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Bonne] (https://proj.org/operations/projections/bonne.html) projection method.

+

This method is defined as [EPSG:9827] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9827)

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createLambertCylindricalEqualAreaSpherical(const util::PropertyMap &properties, const common::Angle &latitudeFirstParallel, const common::Angle &longitudeNatOrigin, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Lambert Cylindrical Equal Area (Spherical)] (https://proj.org/operations/projections/cea.html) projection method.

+

This method is defined as [EPSG:9834] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9834)

+
+

Warning

+

The PROJ cea computation code would select the ellipsoidal form if a non-spherical ellipsoid is used for the base GeographicCRS.

+
+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createLambertCylindricalEqualArea(const util::PropertyMap &properties, const common::Angle &latitudeFirstParallel, const common::Angle &longitudeNatOrigin, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Lambert Cylindrical Equal Area (ellipsoidal form)] (https://proj.org/operations/projections/cea.html) projection method.

+

This method is defined as [EPSG:9835] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9835)

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createCassiniSoldner(const util::PropertyMap &properties, const common::Angle &centerLat, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Cassini-Soldner] (https://proj.org/operations/projections/cass.html) projection method.

+

This method is defined as [EPSG:9806] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9806)

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createEquidistantConic(const util::PropertyMap &properties, const common::Angle &centerLat, const common::Angle &centerLong, const common::Angle &latitudeFirstParallel, const common::Angle &latitudeSecondParallel, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Equidistant Conic] (https://proj.org/operations/projections/eqdc.html) projection method.

+

There is no equivalent in EPSG.

+
+

Note

+

Although not found in EPSG, the order of arguments is conformant with the “spirit” of EPSG and different than OGRSpatialReference::setEC() of GDAL <= 2.3 *

+
+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createEckertI(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Eckert I] (https://proj.org/operations/projections/eck1.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createEckertII(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Eckert II] (https://proj.org/operations/projections/eck2.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createEckertIII(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Eckert III] (https://proj.org/operations/projections/eck3.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createEckertIV(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Eckert IV] (https://proj.org/operations/projections/eck4.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createEckertV(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Eckert V] (https://proj.org/operations/projections/eck5.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createEckertVI(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Eckert VI] (https://proj.org/operations/projections/eck6.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createEquidistantCylindrical(const util::PropertyMap &properties, const common::Angle &latitudeFirstParallel, const common::Angle &longitudeNatOrigin, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Equidistant Cylindrical] (https://proj.org/operations/projections/eqc.html) projection method.

+

This is also known as the Equirectangular method, and in the particular case where the latitude of first parallel is 0.

+

This method is defined as [EPSG:1028] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::1028)

+
+

Note

+

This is the equivalent OGRSpatialReference::SetEquirectangular2( 0.0, latitudeFirstParallel, falseEasting, falseNorthing ) of GDAL <= 2.3, where the lat_0 / center_latitude parameter is forced to 0.

+
+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createEquidistantCylindricalSpherical(const util::PropertyMap &properties, const common::Angle &latitudeFirstParallel, const common::Angle &longitudeNatOrigin, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Equidistant Cylindrical (Spherical)] (https://proj.org/operations/projections/eqc.html) projection method.

+

This is also known as the Equirectangular method, and in the particular case where the latitude of first parallel is 0.

+

This method is defined as [EPSG:1029] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::1029)

+
+

Note

+

This is the equivalent OGRSpatialReference::SetEquirectangular2( 0.0, latitudeFirstParallel, falseEasting, falseNorthing ) of GDAL <= 2.3, where the lat_0 / center_latitude parameter is forced to 0.

+
+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createGall(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Gall (Stereographic)] (https://proj.org/operations/projections/gall.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createGoodeHomolosine(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Goode Homolosine] (https://proj.org/operations/projections/goode.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createInterruptedGoodeHomolosine(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Interrupted Goode Homolosine] (https://proj.org/operations/projections/igh.html) projection method.

+

There is no equivalent in EPSG.

+
+

Note

+

OGRSpatialReference::SetIGH() of GDAL <= 2.3 assumes the 3 projection parameters to be zero and this is the nominal case.

+
+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createGeostationarySatelliteSweepX(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Length &height, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Geostationary Satellite View] (https://proj.org/operations/projections/geos.html) projection method, with the sweep angle axis of the viewing instrument being x.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createGeostationarySatelliteSweepY(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Length &height, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Geostationary Satellite View] (https://proj.org/operations/projections/geos.html) projection method, with the sweep angle axis of the viewing instrument being y.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createGnomonic(const util::PropertyMap &properties, const common::Angle &centerLat, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Gnomonic] (https://proj.org/operations/projections/gnom.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createHotineObliqueMercatorVariantA(const util::PropertyMap &properties, const common::Angle &latitudeProjectionCentre, const common::Angle &longitudeProjectionCentre, const common::Angle &azimuthInitialLine, const common::Angle &angleFromRectifiedToSkrewGrid, const common::Scale &scale, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Hotine Oblique Mercator (Variant A)] (https://proj.org/operations/projections/omerc.html) projection method.

+

This is the variant with the no_uoff parameter, which corresponds to GDAL >=2.3 Hotine_Oblique_Mercator projection. In this variant, the false grid coordinates are defined at the intersection of the initial line and the aposphere (the equator on one of the intermediate surfaces inherent in the method), that is at the natural origin of the coordinate system).

+

This method is defined as [EPSG:9812] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9812)

+
+

Note

+

In the case where azimuthInitialLine = angleFromRectifiedToSkrewGrid = 90deg, this maps to the [Swiss Oblique Mercator] (https://proj.org/operations/projections/somerc.html) formulas.

+
+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createHotineObliqueMercatorVariantB(const util::PropertyMap &properties, const common::Angle &latitudeProjectionCentre, const common::Angle &longitudeProjectionCentre, const common::Angle &azimuthInitialLine, const common::Angle &angleFromRectifiedToSkrewGrid, const common::Scale &scale, const common::Length &eastingProjectionCentre, const common::Length &northingProjectionCentre)
+

Instantiate a conversion based on the [Hotine Oblique Mercator (Variant B)] (https://proj.org/operations/projections/omerc.html) projection method.

+

This is the variant without the no_uoff parameter, which corresponds to GDAL >=2.3 Hotine_Oblique_Mercator_Azimuth_Center projection. In this variant, the false grid coordinates are defined at the projection centre.

+

This method is defined as [EPSG:9815] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9815)

+
+

Note

+

In the case where azimuthInitialLine = angleFromRectifiedToSkrewGrid = 90deg, this maps to the [Swiss Oblique Mercator] (https://proj.org/operations/projections/somerc.html) formulas.

+
+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createHotineObliqueMercatorTwoPointNaturalOrigin(const util::PropertyMap &properties, const common::Angle &latitudeProjectionCentre, const common::Angle &latitudePoint1, const common::Angle &longitudePoint1, const common::Angle &latitudePoint2, const common::Angle &longitudePoint2, const common::Scale &scale, const common::Length &eastingProjectionCentre, const common::Length &northingProjectionCentre)
+

Instantiate a conversion based on the [Hotine Oblique Mercator Two Point Natural Origin] (https://proj.org/operations/projections/omerc.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createLabordeObliqueMercator(const util::PropertyMap &properties, const common::Angle &latitudeProjectionCentre, const common::Angle &longitudeProjectionCentre, const common::Angle &azimuthInitialLine, const common::Scale &scale, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Laborde Oblique Mercator] (https://proj.org/operations/projections/labrd.html) projection method.

+

This method is defined as [EPSG:9813] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9813)

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createInternationalMapWorldPolyconic(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Angle &latitudeFirstParallel, const common::Angle &latitudeSecondParallel, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [International Map of the World Polyconic] (https://proj.org/operations/projections/imw_p.html) projection method.

+

There is no equivalent in EPSG.

+
+

Note

+

the order of arguments is conformant with the corresponding EPSG mode and different than OGRSpatialReference::SetIWMPolyconic() of GDAL <= 2.3

+
+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createKrovakNorthOriented(const util::PropertyMap &properties, const common::Angle &latitudeProjectionCentre, const common::Angle &longitudeOfOrigin, const common::Angle &colatitudeConeAxis, const common::Angle &latitudePseudoStandardParallel, const common::Scale &scaleFactorPseudoStandardParallel, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Krovak (north oriented)] (https://proj.org/operations/projections/krovak.html) projection method.

+

This method is defined as [EPSG:1041] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::1041)

+

The coordinates are returned in the “GIS friendly” order: easting, northing. This method is similar to createKrovak(), except that the later returns projected values as southing, westing, where southing(Krovak) = -northing(Krovak_North) and westing(Krovak) = -easting(Krovak_North).

+
+

Note

+

The current PROJ implementation of Krovak hard-codes colatitudeConeAxis = 30deg17’17.30311” and latitudePseudoStandardParallel = 78deg30’N, which are the values used for the ProjectedCRS S-JTSK (Ferro) / Krovak East North (EPSG:5221). It also hard-codes the parameters of the Bessel ellipsoid typically used for Krovak.

+
+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createKrovak(const util::PropertyMap &properties, const common::Angle &latitudeProjectionCentre, const common::Angle &longitudeOfOrigin, const common::Angle &colatitudeConeAxis, const common::Angle &latitudePseudoStandardParallel, const common::Scale &scaleFactorPseudoStandardParallel, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Krovak] (https://proj.org/operations/projections/krovak.html) projection method.

+

This method is defined as [EPSG:9819] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9819)

+

The coordinates are returned in the historical order: southing, westing This method is similar to createKrovakNorthOriented(), except that the later returns projected values as easting, northing, where easting(Krovak_North) = -westing(Krovak) and northing(Krovak_North) = -southing(Krovak).

+
+

Note

+

The current PROJ implementation of Krovak hard-codes colatitudeConeAxis = 30deg17’17.30311” and latitudePseudoStandardParallel = 78deg30’N, which are the values used for the ProjectedCRS S-JTSK (Ferro) / Krovak East North (EPSG:5221). It also hard-codes the parameters of the Bessel ellipsoid typically used for Krovak.

+
+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createLambertAzimuthalEqualArea(const util::PropertyMap &properties, const common::Angle &latitudeNatOrigin, const common::Angle &longitudeNatOrigin, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Lambert Azimuthal Equal Area] (https://proj.org/operations/projections/laea.html) projection method.

+

This method is defined as [EPSG:9820] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9820)

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createMillerCylindrical(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Miller Cylindrical] (https://proj.org/operations/projections/mill.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createMercatorVariantA(const util::PropertyMap &properties, const common::Angle &centerLat, const common::Angle &centerLong, const common::Scale &scale, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Mercator] (https://proj.org/operations/projections/merc.html) projection method.

+

This is the variant, also known as Mercator (1SP), defined with the scale factor. Note that latitude of natural origin (centerLat) is a parameter, but unused in the transformation formulas.

+

This method is defined as [EPSG:9804] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9804)

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createMercatorVariantB(const util::PropertyMap &properties, const common::Angle &latitudeFirstParallel, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Mercator] (https://proj.org/operations/projections/merc.html) projection method.

+

This is the variant, also known as Mercator (2SP), defined with the latitude of the first standard parallel (the second standard parallel is implicitly the opposite value). The latitude of natural origin is fixed to zero.

+

This method is defined as [EPSG:9805] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9805)

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createPopularVisualisationPseudoMercator(const util::PropertyMap &properties, const common::Angle &centerLat, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Popular Visualisation Pseudo Mercator] (https://proj.org/operations/projections/webmerc.html) projection method.

+

Also known as WebMercator. Mostly/only used for Projected CRS EPSG:3857 (WGS 84 / Pseudo-Mercator)

+

This method is defined as [EPSG:1024] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::1024)

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createMollweide(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Mollweide] (https://proj.org/operations/projections/moll.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createNewZealandMappingGrid(const util::PropertyMap &properties, const common::Angle &centerLat, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [New Zealand Map Grid] (https://proj.org/operations/projections/nzmg.html) projection method.

+

This method is defined as [EPSG:9811] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9811)

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createObliqueStereographic(const util::PropertyMap &properties, const common::Angle &centerLat, const common::Angle &centerLong, const common::Scale &scale, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Oblique Stereographic (Alternative)] (https://proj.org/operations/projections/sterea.html) projection method.

+

This method is defined as [EPSG:9809] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9809)

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createOrthographic(const util::PropertyMap &properties, const common::Angle &centerLat, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Orthographic] (https://proj.org/operations/projections/ortho.html) projection method.

+

This method is defined as [EPSG:9840] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9840)

+
+

Note

+

Before PROJ 7.2, only the spherical formulation was implemented.

+
+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createAmericanPolyconic(const util::PropertyMap &properties, const common::Angle &centerLat, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [American Polyconic] (https://proj.org/operations/projections/poly.html) projection method.

+

This method is defined as [EPSG:9818] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9818)

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createPolarStereographicVariantA(const util::PropertyMap &properties, const common::Angle &centerLat, const common::Angle &centerLong, const common::Scale &scale, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Polar Stereographic (Variant A)] (https://proj.org/operations/projections/stere.html) projection method.

+

This method is defined as [EPSG:9810] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9810)

+

This is the variant of polar stereographic defined with a scale factor.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createPolarStereographicVariantB(const util::PropertyMap &properties, const common::Angle &latitudeStandardParallel, const common::Angle &longitudeOfOrigin, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Polar Stereographic (Variant B)] (https://proj.org/operations/projections/stere.html) projection method.

+

This method is defined as [EPSG:9829] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9829)

+

This is the variant of polar stereographic defined with a latitude of standard parallel.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createRobinson(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Robinson] (https://proj.org/operations/projections/robin.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createSinusoidal(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Sinusoidal] (https://proj.org/operations/projections/sinu.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createStereographic(const util::PropertyMap &properties, const common::Angle &centerLat, const common::Angle &centerLong, const common::Scale &scale, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Stereographic] (https://proj.org/operations/projections/stere.html) projection method.

+

There is no equivalent in EPSG. This method implements the original “Oblique

+

Stereographic” method described in “Snyder’s Map Projections - A Working

+

manual”, which is different from the “Oblique Stereographic (alternative”) method implemented in

+createObliqueStereographic().

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createVanDerGrinten(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Van der Grinten] (https://proj.org/operations/projections/vandg.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createWagnerI(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Wagner I] (https://proj.org/operations/projections/wag1.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createWagnerII(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Wagner II] (https://proj.org/operations/projections/wag2.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createWagnerIII(const util::PropertyMap &properties, const common::Angle &latitudeTrueScale, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Wagner III] (https://proj.org/operations/projections/wag3.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createWagnerIV(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Wagner IV] (https://proj.org/operations/projections/wag4.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createWagnerV(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Wagner V] (https://proj.org/operations/projections/wag5.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createWagnerVI(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Wagner VI] (https://proj.org/operations/projections/wag6.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createWagnerVII(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Wagner VII] (https://proj.org/operations/projections/wag7.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createQuadrilateralizedSphericalCube(const util::PropertyMap &properties, const common::Angle &centerLat, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Quadrilateralized Spherical Cube] (https://proj.org/operations/projections/qsc.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createSphericalCrossTrackHeight(const util::PropertyMap &properties, const common::Angle &pegPointLat, const common::Angle &pegPointLong, const common::Angle &pegPointHeading, const common::Length &pegPointHeight)
+

Instantiate a conversion based on the [Spherical Cross-Track Height] (https://proj.org/operations/projections/sch.html) projection method.

+

There is no equivalent in EPSG.

+
+
Parameters
+
    +
  • properties – See General properties of the conversion. If the name is not provided, it is automatically set.

  • +
  • pegPointLat – Peg point latitude.

  • +
  • pegPointLong – Peg point longitude.

  • +
  • pegPointHeading – Peg point heading.

  • +
  • pegPointHeight – Peg point height.

  • +
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createEqualEarth(const util::PropertyMap &properties, const common::Angle &centerLong, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Equal Earth] (https://proj.org/operations/projections/eqearth.html) projection method.

+

This method is defined as [EPSG:1078] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::1078)

+
+
Parameters
+
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createVerticalPerspective(const util::PropertyMap &properties, const common::Angle &topoOriginLat, const common::Angle &topoOriginLong, const common::Length &topoOriginHeight, const common::Length &viewPointHeight, const common::Length &falseEasting, const common::Length &falseNorthing)
+

Instantiate a conversion based on the [Vertical Perspective] (https://proj.org/operations/projections/nsper.html) projection method.

+

This method is defined as [EPSG:9838] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9838)

+

The PROJ implementation of the EPSG Vertical Perspective has the current limitations with respect to the method described in EPSG:

    +
  • it is a 2D-only method, ignoring the ellipsoidal height of the point to project.

  • +
  • it has only a spherical development.

  • +
  • the height of the topocentric origin is ignored, and thus assumed to be 0.

  • +
+

+

For completeness, PROJ adds the falseEasting and falseNorthing parameter, which are not described in EPSG. They should usually be set to 0.

+

+
Since

6.3

+
+
+

+
+
Parameters
+
    +
  • properties – See General properties of the conversion. If the name is not provided, it is automatically set.

  • +
  • topoOriginLat – Latitude of topocentric origin

  • +
  • topoOriginLong – Longitude of topocentric origin

  • +
  • topoOriginHeight – Ellipsoidal height of topocentric origin. Ignored by PROJ (that is assumed to be 0)

  • +
  • viewPointHeight – Viewpoint height with respect to the topocentric/mapping plane. In the case where topoOriginHeight = 0, this is the height above the ellipsoid surface at topoOriginLat, topoOriginLong.

  • +
  • falseEasting – See False Easting . (not in EPSG)

  • +
  • falseNorthing – See False Northing . (not in EPSG)

  • +
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createPoleRotationGRIBConvention(const util::PropertyMap &properties, const common::Angle &southPoleLatInUnrotatedCRS, const common::Angle &southPoleLongInUnrotatedCRS, const common::Angle &axisRotation)
+

Instantiate a conversion based on the Pole Rotation method, using the conventions of the GRIB 1 and GRIB 2 data formats.

+

Those are mentioned in the Note 2 of https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_temp3-1.shtml

+

Several conventions for the pole rotation method exists. The parameters provided in this method are remapped to the PROJ ob_tran operation with:

+

Another implementation of that convention is also in the netcdf-java library: https://github.com/Unidata/netcdf-java/blob/3ce72c0cd167609ed8c69152bb4a004d1daa9273/cdm/core/src/main/java/ucar/unidata/geoloc/projection/RotatedLatLon.java

+

The PROJ implementation of this method assumes a spherical ellipsoid.

+

+
Since

7.0

+
+
+

+
+
Parameters
+
    +
  • properties – See General properties of the conversion. If the name is not provided, it is automatically set.

  • +
  • southPoleLatInUnrotatedCRS – Latitude of the point from the unrotated CRS, expressed in the unrotated CRS, that will become the south pole of the rotated CRS.

  • +
  • southPoleLongInUnrotatedCRS – Longitude of the point from the unrotated CRS, expressed in the unrotated CRS, that will become the south pole of the rotated CRS.

  • +
  • axisRotation – The angle of rotation about the new polar axis (measured clockwise when looking from the southern to the northern pole) of the coordinate system, assuming the new axis to have been obtained by first rotating the sphere through southPoleLongInUnrotatedCRS degrees about the geographic polar axis and then rotating through (90 + southPoleLatInUnrotatedCRS) degrees so that the southern pole moved along the (previously rotated) Greenwich meridian.

  • +
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createPoleRotationNetCDFCFConvention(const util::PropertyMap &properties, const common::Angle &gridNorthPoleLatitude, const common::Angle &gridNorthPoleLongitude, const common::Angle &northPoleGridLongitude)
+

Instantiate a conversion based on the Pole Rotation method, using the conventions of the netCDF CF convention for the netCDF format.

+

Those are mentioned in the Note 2 of https://cfconventions.org/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html#_rotated_pole

+

Several conventions for the pole rotation method exists. The parameters provided in this method are remapped to the PROJ ob_tran operation with:

+

Another implementation of that convention is also in the netcdf-java library: https://github.com/Unidata/netcdf-java/blob/3ce72c0cd167609ed8c69152bb4a004d1daa9273/cdm/core/src/main/java/ucar/unidata/geoloc/projection/RotatedPole.java

+

The PROJ implementation of this method assumes a spherical ellipsoid.

+

+
Since

8.2

+
+
+

+
+
Parameters
+
    +
  • properties – See General properties of the conversion. If the name is not provided, it is automatically set.

  • +
  • gridNorthPoleLatitude – True latitude of the north pole of the rotated grid

  • +
  • gridNorthPoleLongitude – True longitude of the north pole of the rotated grid.

  • +
  • northPoleGridLongitude – Longitude of the true north pole in the rotated grid.

  • +
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createChangeVerticalUnit(const util::PropertyMap &properties, const common::Scale &factor)
+

Instantiate a conversion based on the Change of Vertical Unit method.

+

This method is defined as [EPSG:1069] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::1069)

+
+
Parameters
+
    +
  • properties – See General properties of the conversion. If the name is not provided, it is automatically set.

  • +
  • factorConversion factor

  • +
+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createChangeVerticalUnit(const util::PropertyMap &properties)
+

Instantiate a conversion based on the Change of Vertical Unit method (without explicit conversion factor)

+

This method is defined as [EPSG:1104] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::1104)

+
+
Parameters
+

properties – See General properties of the conversion. If the name is not provided, it is automatically set.

+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createHeightDepthReversal(const util::PropertyMap &properties)
+

Instantiate a conversion based on the Height Depth Reversal method.

+

This method is defined as [EPSG:1068] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::1068)

+

+
Since

6.3

+
+
+

+
+
Parameters
+

properties – See General properties of the conversion. If the name is not provided, it is automatically set.

+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createAxisOrderReversal(bool is3D)
+

Instantiate a conversion based on the Axis order reversal method.

+

This swaps the longitude, latitude axis.

+

This method is defined as [EPSG:9843] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9843), or for 3D as [EPSG:9844] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9844)

+
+
Parameters
+

is3D – Whether this should apply on 3D geographicCRS

+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+static ConversionNNPtr createGeographicGeocentric(const util::PropertyMap &properties)
+

Instantiate a conversion based on the Geographic/Geocentric method.

+

This method is defined as [EPSG:9602] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9602),

+
+
Parameters
+

properties – See General properties of the conversion. If the name is not provided, it is automatically set.

+
+
Returns
+

a new Conversion.

+
+
+
+ +
+
+ +
+
+class CoordinateOperation : public osgeo::proj::common::ObjectUsage, public osgeo::proj::io::IPROJStringExportable, public osgeo::proj::io::IJSONExportable
+
+#include <coordinateoperation.hpp>
+

Abstract class for a mathematical operation on coordinates.

+

A mathematical operation:

    +
  • on coordinates that transforms or converts them from one coordinate reference system to another coordinate reference system

  • +
  • or that describes the change of coordinate values within one coordinate reference system due to the motion of the point between one coordinate epoch and another coordinate epoch.

  • +
+ +Many but not all coordinate operations (from CRS A to CRS B) also uniquely define the inverse coordinate operation (from CRS B to CRS A). In some cases, the coordinate operation method algorithm for the inverse coordinate operation is the same as for the forward algorithm, but the signs of some coordinate operation parameter values have to be reversed. In other cases, different algorithms are required for the forward and inverse coordinate operations, but the same coordinate operation parameter values are used. If (some) entirely different parameter values are needed, a different coordinate operation shall be defined.

+

+

Remark

+

Implements CoordinateOperation from ISO 19111:2019

+
+

+

Subclassed by osgeo::proj::operation::ConcatenatedOperation, osgeo::proj::operation::SingleOperation

+
+

Public Functions

+
+
+const util::optional<std::string> &operationVersion() const
+

Return the version of the coordinate transformation (i.e. instantiation due to the stochastic nature of the parameters).

+

Mandatory when describing a coordinate transformation or point motion operation, and should not be supplied for a coordinate conversion.

+
+
Returns
+

version or empty.

+
+
+
+ +
+
+const std::vector<metadata::PositionalAccuracyNNPtr> &coordinateOperationAccuracies() const
+

Return estimate(s) of the impact of this coordinate operation on point accuracy.

+

Gives position error estimates for target coordinates of this coordinate operation, assuming no errors in source coordinates.

+
+
Returns
+

estimate(s) or empty vector.

+
+
+
+ +
+
+const crs::CRSPtr sourceCRS() const
+

Return the source CRS of this coordinate operation.

+

This should not be null, expect for of a derivingConversion of a DerivedCRS when the owning DerivedCRS has been destroyed.

+
+
Returns
+

source CRS, or null.

+
+
+
+ +
+
+const crs::CRSPtr targetCRS() const
+

Return the target CRS of this coordinate operation.

+

This should not be null, expect for of a derivingConversion of a DerivedCRS when the owning DerivedCRS has been destroyed.

+
+
Returns
+

target CRS, or null.

+
+
+
+ +
+
+const crs::CRSPtr &interpolationCRS() const
+

Return the interpolation CRS of this coordinate operation.

+
+
Returns
+

interpolation CRS, or null.

+
+
+
+ +
+
+const util::optional<common::DataEpoch> &sourceCoordinateEpoch() const
+

Return the source epoch of coordinates.

+
+
Returns
+

source epoch of coordinates, or empty.

+
+
+
+ +
+
+const util::optional<common::DataEpoch> &targetCoordinateEpoch() const
+

Return the target epoch of coordinates.

+
+
Returns
+

target epoch of coordinates, or empty.

+
+
+
+ +
+
+virtual CoordinateOperationNNPtr inverse() const = 0
+

Return the inverse of the coordinate operation.

+
+
Throws
+

util::UnsupportedOperationException

+
+
+
+ +
+
+virtual std::set<GridDescription> gridsNeeded(const io::DatabaseContextPtr &databaseContext, bool considerKnownGridsAsAvailable) const = 0
+

Return grids needed by an operation.

+
+ +
+
+bool isPROJInstantiable(const io::DatabaseContextPtr &databaseContext, bool considerKnownGridsAsAvailable) const
+

Return whether a coordinate operation can be instantiated as a PROJ pipeline, checking in particular that referenced grids are available.

+
+ +
+
+bool hasBallparkTransformation() const
+

Return whether a coordinate operation has a “ballpark” transformation, that is a very approximate one, due to lack of more accurate transformations.

+

Typically a null geographic offset between two horizontal datum, or a null vertical offset (or limited to unit changes) between two vertical datum. Errors of several tens to one hundred meters might be expected, compared to more accurate transformations.

+
+ +
+
+CoordinateOperationNNPtr normalizeForVisualization() const
+

Return a variation of the current coordinate operation whose axis order is the one expected for visualization purposes.

+
+ +
+
+

Public Static Attributes

+
+
+static const std::string OPERATION_VERSION_KEY
+

Key to set the operation version of a operation::CoordinateOperation.

+

The value is to be provided as a string.

+
+ +
+
+ +
+
+class CoordinateOperationContext
+
+#include <coordinateoperation.hpp>
+

Context in which a coordinate operation is to be used.

+

+

+
+

Public Types

+
+
+enum class SourceTargetCRSExtentUse
+

Specify how source and target CRS extent should be used to restrict candidate operations (only taken into account if no explicit area of interest is specified.

+

Values:

+
+
+enumerator NONE
+

Ignore CRS extent

+
+ +
+
+enumerator BOTH
+

Test coordinate operation extent against both CRS extent.

+
+ +
+
+enumerator INTERSECTION
+

Test coordinate operation extent against the intersection of both CRS extent.

+
+ +
+
+enumerator SMALLEST
+

Test coordinate operation against the smallest of both CRS extent.

+
+ +
+ +
+
+enum class SpatialCriterion
+

Spatial criterion to restrict candidate operations.

+

Values:

+
+
+enumerator STRICT_CONTAINMENT
+

The area of validity of transforms should strictly contain the are of interest.

+
+ +
+
+enumerator PARTIAL_INTERSECTION
+

The area of validity of transforms should at least intersect the area of interest.

+
+ +
+ +
+
+enum class GridAvailabilityUse
+

Describe how grid availability is used.

+

Values:

+
+
+enumerator USE_FOR_SORTING
+

Grid availability is only used for sorting results. Operations where some grids are missing will be sorted last.

+
+ +
+
+enumerator DISCARD_OPERATION_IF_MISSING_GRID
+

Completely discard an operation if a required grid is missing.

+
+ +
+
+enumerator IGNORE_GRID_AVAILABILITY
+

Ignore grid availability at all. Results will be presented as if all grids were available.

+
+ +
+
+enumerator KNOWN_AVAILABLE
+

Results will be presented as if grids known to PROJ (that is registered in the grid_alternatives table of its database) were available. Used typically when networking is enabled.

+
+ +
+ +
+
+enum class IntermediateCRSUse
+

Describe if and how intermediate CRS should be used

+

Values:

+
+
+enumerator ALWAYS
+

Always search for intermediate CRS.

+
+ +
+
+enumerator IF_NO_DIRECT_TRANSFORMATION
+

Only attempt looking for intermediate CRS if there is no direct transformation available.

+
+ +
+
+enumerator NEVER
+
+ +
+ +
+
+

Public Functions

+
+
+const io::AuthorityFactoryPtr &getAuthorityFactory() const
+

Return the authority factory, or null.

+
+ +
+
+const metadata::ExtentPtr &getAreaOfInterest() const
+

Return the desired area of interest, or null.

+
+ +
+
+void setAreaOfInterest(const metadata::ExtentPtr &extent)
+

Set the desired area of interest, or null.

+
+ +
+
+double getDesiredAccuracy() const
+

Return the desired accuracy (in metre), or 0.

+
+ +
+
+void setDesiredAccuracy(double accuracy)
+

Set the desired accuracy (in metre), or 0.

+
+ +
+
+void setAllowBallparkTransformations(bool allow)
+

Set whether ballpark transformations are allowed.

+
+ +
+
+bool getAllowBallparkTransformations() const
+

Return whether ballpark transformations are allowed.

+
+ +
+
+void setSourceAndTargetCRSExtentUse(SourceTargetCRSExtentUse use)
+

Set how source and target CRS extent should be used when considering if a transformation can be used (only takes effect if no area of interest is explicitly defined).

+

The default is CoordinateOperationContext::SourceTargetCRSExtentUse::SMALLEST.

+
+ +
+
+SourceTargetCRSExtentUse getSourceAndTargetCRSExtentUse() const
+

Return how source and target CRS extent should be used when considering if a transformation can be used (only takes effect if no area of interest is explicitly defined).

+

The default is CoordinateOperationContext::SourceTargetCRSExtentUse::SMALLEST.

+
+ +
+
+void setSpatialCriterion(SpatialCriterion criterion)
+

Set the spatial criterion to use when comparing the area of validity of coordinate operations with the area of interest / area of validity of source and target CRS.

+

The default is STRICT_CONTAINMENT.

+
+ +
+
+SpatialCriterion getSpatialCriterion() const
+

Return the spatial criterion to use when comparing the area of validity of coordinate operations with the area of interest / area of validity of source and target CRS.

+

The default is STRICT_CONTAINMENT.

+
+ +
+
+void setUsePROJAlternativeGridNames(bool usePROJNames)
+

Set whether PROJ alternative grid names should be substituted to the official authority names.

+

This only has effect is an authority factory with a non-null database context has been attached to this context.

+

If set to false, it is still possible to obtain later the substitution by using io::PROJStringFormatter::create() with a non-null database context.

+

The default is true.

+
+ +
+
+bool getUsePROJAlternativeGridNames() const
+

Return whether PROJ alternative grid names should be substituted to the official authority names.

+

The default is true.

+
+ +
+
+void setDiscardSuperseded(bool discard)
+

Set whether transformations that are superseded (but not deprecated) should be discarded.

+

The default is true.

+
+ +
+
+bool getDiscardSuperseded() const
+

Return whether transformations that are superseded (but not deprecated) should be discarded.

+

The default is true.

+
+ +
+
+void setGridAvailabilityUse(GridAvailabilityUse use)
+

Set how grid availability is used.

+

The default is USE_FOR_SORTING.

+
+ +
+
+GridAvailabilityUse getGridAvailabilityUse() const
+

Return how grid availability is used.

+

The default is USE_FOR_SORTING.

+
+ +
+
+void setAllowUseIntermediateCRS(IntermediateCRSUse use)
+

Set whether an intermediate pivot CRS can be used for researching coordinate operations between a source and target CRS.

+

Concretely if in the database there is an operation from A to C (or C to A), and another one from C to B (or B to C), but no direct operation between A and B, setting this parameter to ALWAYS/IF_NO_DIRECT_TRANSFORMATION, allow chaining both operations.

+

The current implementation is limited to researching one intermediate step.

+

By default, with the IF_NO_DIRECT_TRANSFORMATION strategy, all potential C candidates will be used if there is no direct transformation.

+
+ +
+
+IntermediateCRSUse getAllowUseIntermediateCRS() const
+

Return whether an intermediate pivot CRS can be used for researching coordinate operations between a source and target CRS.

+

Concretely if in the database there is an operation from A to C (or C to A), and another one from C to B (or B to C), but no direct operation between A and B, setting this parameter to ALWAYS/IF_NO_DIRECT_TRANSFORMATION, allow chaining both operations.

+

The default is IF_NO_DIRECT_TRANSFORMATION.

+
+ +
+
+void setIntermediateCRS(const std::vector<std::pair<std::string, std::string>> &intermediateCRSAuthCodes)
+

Restrict the potential pivot CRSs that can be used when trying to build a coordinate operation between two CRS that have no direct operation.

+
+
Parameters
+

intermediateCRSAuthCodes – a vector of (auth_name, code) that can be used as potential pivot RS

+
+
+
+ +
+
+const std::vector<std::pair<std::string, std::string>> &getIntermediateCRS() const
+

Return the potential pivot CRSs that can be used when trying to build a coordinate operation between two CRS that have no direct operation.

+
+ +
+
+

Public Static Functions

+
+
+static CoordinateOperationContextNNPtr create(const io::AuthorityFactoryPtr &authorityFactory, const metadata::ExtentPtr &extent, double accuracy)
+

Creates a context for a coordinate operation.

+

If a non null authorityFactory is provided, the resulting context should not be used simultaneously by more than one thread.

+

If authorityFactory->getAuthority() is the empty string, then coordinate operations from any authority will be searched, with the restrictions set in the authority_to_authority_preference database table. If authorityFactory->getAuthority() is set to “any”, then coordinate operations from any authority will be searched If authorityFactory->getAuthority() is a non-empty string different of “any”, then coordinate operations will be searched only in that authority namespace.

+
+
Parameters
+
    +
  • authorityFactory – Authority factory, or null if no database lookup is allowed. Use io::authorityFactory::create(context, std::string()) to allow all authorities to be used.

  • +
  • extent – Area of interest, or null if none is known.

  • +
  • accuracy – Maximum allowed accuracy in metre, as specified in or 0 to get best accuracy.

  • +
+
+
Returns
+

a new context.

+
+
+
+ +
+
+ +
+
+class CoordinateOperationFactory
+
+#include <coordinateoperation.hpp>
+

Creates coordinate operations. This factory is capable to find coordinate transformations or conversions between two coordinate reference systems.

+

+

Remark

+

Implements (partially) CoordinateOperationFactory from GeoAPI

+
+

+
+

Public Functions

+
+
+CoordinateOperationPtr createOperation(const crs::CRSNNPtr &sourceCRS, const crs::CRSNNPtr &targetCRS) const
+

Find a CoordinateOperation from sourceCRS to targetCRS.

+

This is a helper of createOperations(), using a coordinate operation context with no authority factory (so no catalog searching is done), no desired accuracy and no area of interest. This returns the first operation of the result set of createOperations(), or null if none found.

+
+
Parameters
+
    +
  • sourceCRS – source CRS.

  • +
  • targetCRS – source CRS.

  • +
+
+
Returns
+

a CoordinateOperation or nullptr.

+
+
+
+ +
+
+std::vector<CoordinateOperationNNPtr> createOperations(const crs::CRSNNPtr &sourceCRS, const crs::CRSNNPtr &targetCRS, const CoordinateOperationContextNNPtr &context) const
+

Find a list of CoordinateOperation from sourceCRS to targetCRS.

+

The operations are sorted with the most relevant ones first: by descending area (intersection of the transformation area with the area of interest, or intersection of the transformation with the area of use of the CRS), and by increasing accuracy. Operations with unknown accuracy are sorted last, whatever their area.

+

When one of the source or target CRS has a vertical component but not the other one, the one that has no vertical component is automatically promoted to a 3D version, where its vertical axis is the ellipsoidal height in metres, using the ellipsoid of the base geodetic CRS.

+
+
Parameters
+
    +
  • sourceCRS – source CRS.

  • +
  • targetCRS – target CRS.

  • +
  • context – Search context.

  • +
+
+
Returns
+

a list

+
+
+
+ +
+
+

Public Static Functions

+
+
+static CoordinateOperationFactoryNNPtr create()
+

Instantiate a CoordinateOperationFactory.

+
+ +
+
+ +
+
+class GeneralOperationParameter : public osgeo::proj::common::IdentifiedObject
+
+#include <coordinateoperation.hpp>
+

Abstract class modelling a parameter value (OperationParameter) or group of parameters.

+

+

Remark

+

Implements GeneralOperationParameter from ISO 19111:2019

+
+

+

Subclassed by osgeo::proj::operation::OperationParameter

+
+ +
+
+class GeneralParameterValue : public osgeo::proj::util::BaseObject, public osgeo::proj::io::IWKTExportable, public osgeo::proj::io::IJSONExportable, public osgeo::proj::util::IComparable
+
+#include <coordinateoperation.hpp>
+

Abstract class modelling a parameter value (OperationParameterValue) or group of parameter values.

+

+

Remark

+

Implements GeneralParameterValue from ISO 19111:2019

+
+

+

Subclassed by osgeo::proj::operation::OperationParameterValue

+
+ +
+
+struct GridDescription
+
+#include <coordinateoperation.hpp>
+

Grid description.

+
+

Public Members

+
+
+std::string shortName
+

Grid short filename

+
+ +
+
+std::string fullName
+

Grid full path name (if found)

+
+ +
+
+std::string packageName
+

Package name (or empty)

+
+ +
+
+std::string url
+

Grid URL (if packageName is empty), or package URL (or empty)

+
+ +
+
+bool directDownload
+

Whether url can be fetched directly.

+
+ +
+
+bool openLicense
+

Whether the grid is released with an open license.

+
+ +
+
+bool available
+

Whether GRID is available.

+
+ +
+
+ +
+
+class InvalidOperation : public osgeo::proj::util::Exception
+
+#include <coordinateoperation.hpp>
+

Exception that can be thrown when an invalid operation is attempted to be constructed.

+
+ +
+
+class OperationMethod : public osgeo::proj::common::IdentifiedObject, public osgeo::proj::io::IJSONExportable
+
+#include <coordinateoperation.hpp>
+

The method (algorithm or procedure) used to perform the coordinate operation.

+

For a projection method, this contains the name of the projection method and the name of the projection parameters.

+

+

Remark

+

Implements OperationMethod from ISO 19111:2019

+
+

+
+

Public Functions

+
+
+const util::optional<std::string> &formula()
+

Return the formula(s) or procedure used by this coordinate operation method.

+

This may be a reference to a publication (in which case use formulaCitation()).

+

Note that the operation method may not be analytic, in which case this attribute references or contains the procedure, not an analytic formula.

+
+
Returns
+

the formula, or empty.

+
+
+
+ +
+
+const util::optional<metadata::Citation> &formulaCitation()
+

Return a reference to a publication giving the formula(s) or procedure used by the coordinate operation method.

+
+
Returns
+

the formula citation, or empty.

+
+
+
+ +
+
+const std::vector<GeneralOperationParameterNNPtr> &parameters()
+

Return the parameters of this operation method.

+
+
Returns
+

the parameters.

+
+
+
+ +
+
+int getEPSGCode()
+

Return the EPSG code, either directly, or through the name.

+
+
Returns
+

code, or 0 if not found

+
+
+
+ +
+
+

Public Static Functions

+
+
+static OperationMethodNNPtr create(const util::PropertyMap &properties, const std::vector<GeneralOperationParameterNNPtr> &parameters)
+

Instantiate a operation method from a vector of GeneralOperationParameter.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • parameters – Vector of GeneralOperationParameterNNPtr.

  • +
+
+
Returns
+

a new OperationMethod.

+
+
+
+ +
+
+static OperationMethodNNPtr create(const util::PropertyMap &properties, const std::vector<OperationParameterNNPtr> &parameters)
+

Instantiate a operation method from a vector of OperationParameter.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • parameters – Vector of OperationParameterNNPtr.

  • +
+
+
Returns
+

a new OperationMethod.

+
+
+
+ +
+
+ +
+
+class OperationParameter : public osgeo::proj::operation::GeneralOperationParameter
+
+#include <coordinateoperation.hpp>
+

The definition of a parameter used by a coordinate operation method.

+

Most parameter values are numeric, but other types of parameter values are possible.

+

+

Remark

+

Implements OperationParameter from ISO 19111:2019

+
+

+
+

Public Functions

+
+
+int getEPSGCode()
+

Return the EPSG code, either directly, or through the name.

+
+
Returns
+

code, or 0 if not found

+
+
+
+ +
+
+

Public Static Functions

+
+
+static OperationParameterNNPtr create(const util::PropertyMap &properties)
+

Instantiate a OperationParameter.

+
+
Parameters
+

properties – See General properties. At minimum the name should be defined.

+
+
Returns
+

a new OperationParameter.

+
+
+
+ +
+
+static const char *getNameForEPSGCode(int epsg_code) noexcept
+

Return the name of a parameter designed by its EPSG code.

+
+
Returns
+

name, or nullptr if not found

+
+
+
+ +
+
+ +
+
+class OperationParameterValue : public osgeo::proj::operation::GeneralParameterValue
+
+#include <coordinateoperation.hpp>
+

A parameter value, ordered sequence of values, or reference to a file of parameter values.

+

This combines a OperationParameter with the corresponding ParameterValue.

+

+

Remark

+

Implements OperationParameterValue from ISO 19111:2019

+
+

+
+

Public Functions

+
+
+const OperationParameterNNPtr &parameter()
+

Return the parameter (definition)

+
+
Returns
+

the parameter (definition).

+
+
+
+ +
+
+const ParameterValueNNPtr &parameterValue()
+

Return the parameter value.

+
+
Returns
+

the parameter value.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static OperationParameterValueNNPtr create(const OperationParameterNNPtr &parameterIn, const ParameterValueNNPtr &valueIn)
+

Instantiate a OperationParameterValue.

+
+
Parameters
+
    +
  • parameterIn – Parameter (definition).

  • +
  • valueIn – Parameter value.

  • +
+
+
Returns
+

a new OperationParameterValue.

+
+
+
+ +
+
+ +
+
+class ParameterValue : public osgeo::proj::util::BaseObject, public osgeo::proj::io::IWKTExportable, public osgeo::proj::util::IComparable
+
+#include <coordinateoperation.hpp>
+

The value of the coordinate operation parameter.

+

Most parameter values are numeric, but other types of parameter values are possible.

+

+

Remark

+

Implements ParameterValue from ISO 19111:2019

+
+

+
+

Public Types

+
+
+enum class Type
+

Type of the value.

+

Values:

+
+
+enumerator MEASURE
+

Measure (i.e. value with a unit)

+
+ +
+
+enumerator STRING
+

String

+
+ +
+
+enumerator INTEGER
+

Integer

+
+ +
+
+enumerator BOOLEAN
+

Boolean

+
+ +
+
+enumerator FILENAME
+

Filename

+
+ +
+ +
+
+

Public Functions

+
+
+const Type &type()
+

Returns the type of a parameter value.

+
+
Returns
+

the type.

+
+
+
+ +
+
+const common::Measure &value()
+

Returns the value as a Measure (assumes type() == Type::MEASURE)

+
+
Returns
+

the value as a Measure.

+
+
+
+ +
+
+const std::string &stringValue()
+

Returns the value as a string (assumes type() == Type::STRING)

+
+
Returns
+

the value as a string.

+
+
+
+ +
+
+const std::string &valueFile()
+

Returns the value as a filename (assumes type() == Type::FILENAME)

+
+
Returns
+

the value as a filename.

+
+
+
+ +
+
+int integerValue()
+

Returns the value as a integer (assumes type() == Type::INTEGER)

+
+
Returns
+

the value as a integer.

+
+
+
+ +
+
+bool booleanValue()
+

Returns the value as a boolean (assumes type() == Type::BOOLEAN)

+
+
Returns
+

the value as a boolean.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static ParameterValueNNPtr create(const common::Measure &measureIn)
+

Instantiate a ParameterValue from a Measure (i.e. a value associated with a unit)

+
+
Returns
+

a new ParameterValue.

+
+
+
+ +
+
+static ParameterValueNNPtr create(const char *stringValueIn)
+

Instantiate a ParameterValue from a string value.

+
+
Returns
+

a new ParameterValue.

+
+
+
+ +
+
+static ParameterValueNNPtr create(const std::string &stringValueIn)
+

Instantiate a ParameterValue from a string value.

+
+
Returns
+

a new ParameterValue.

+
+
+
+ +
+
+static ParameterValueNNPtr create(int integerValueIn)
+

Instantiate a ParameterValue from a integer value.

+
+
Returns
+

a new ParameterValue.

+
+
+
+ +
+
+static ParameterValueNNPtr create(bool booleanValueIn)
+

Instantiate a ParameterValue from a boolean value.

+
+
Returns
+

a new ParameterValue.

+
+
+
+ +
+
+static ParameterValueNNPtr createFilename(const std::string &stringValueIn)
+

Instantiate a ParameterValue from a filename.

+
+
Returns
+

a new ParameterValue.

+
+
+
+ +
+
+ +
+
+class PointMotionOperation : public osgeo::proj::operation::SingleOperation
+
+#include <coordinateoperation.hpp>
+

A mathematical operation that describes the change of coordinate values within one coordinate reference system due to the motion of the point between one coordinate epoch and another coordinate epoch.

+

The motion is due to tectonic plate movement or deformation.

+

+

Remark

+

Implements PointMotionOperation from ISO 19111:2019

+
+

+
+ +
+
+class SingleOperation : public virtual osgeo::proj::operation::CoordinateOperation
+
+#include <coordinateoperation.hpp>
+

A single (not concatenated) coordinate operation (CoordinateOperation)

+

+

Remark

+

Implements SingleOperation from ISO 19111:2019

+
+

+

Subclassed by osgeo::proj::operation::Conversion, osgeo::proj::operation::PointMotionOperation, osgeo::proj::operation::Transformation

+
+

Public Functions

+
+
+const std::vector<GeneralParameterValueNNPtr> &parameterValues()
+

Return the parameter values.

+
+
Returns
+

the parameter values.

+
+
+
+ +
+
+const OperationMethodNNPtr &method()
+

Return the operation method associated to the operation.

+
+
Returns
+

the operation method.

+
+
+
+ +
+
+const ParameterValuePtr &parameterValue(const std::string &paramName, int epsg_code = 0) const noexcept
+

Return the parameter value corresponding to a parameter name or EPSG code.

+
+
Parameters
+
    +
  • paramName – the parameter name (or empty, in which case epsg_code should be non zero)

  • +
  • epsg_code – the parameter EPSG code (possibly zero)

  • +
+
+
Returns
+

the value, or nullptr if not found.

+
+
+
+ +
+
+const ParameterValuePtr &parameterValue(int epsg_code) const noexcept
+

Return the parameter value corresponding to a EPSG code.

+
+
Parameters
+

epsg_code – the parameter EPSG code

+
+
Returns
+

the value, or nullptr if not found.

+
+
+
+ +
+
+const common::Measure &parameterValueMeasure(const std::string &paramName, int epsg_code = 0) const noexcept
+

Return the parameter value, as a measure, corresponding to a parameter name or EPSG code.

+
+
Parameters
+
    +
  • paramName – the parameter name (or empty, in which case epsg_code should be non zero)

  • +
  • epsg_code – the parameter EPSG code (possibly zero)

  • +
+
+
Returns
+

the measure, or the empty Measure() object if not found.

+
+
+
+ +
+
+const common::Measure &parameterValueMeasure(int epsg_code) const noexcept
+

Return the parameter value, as a measure, corresponding to a EPSG code.

+
+
Parameters
+

epsg_code – the parameter EPSG code

+
+
Returns
+

the measure, or the empty Measure() object if not found.

+
+
+
+ +
+
+virtual std::set<GridDescription> gridsNeeded(const io::DatabaseContextPtr &databaseContext, bool considerKnownGridsAsAvailable) const override
+

Return grids needed by an operation.

+
+ +
+
+std::list<std::string> validateParameters() const
+

Validate the parameters used by a coordinate operation.

+

Return whether the method is known or not, or a list of missing or extra parameters for the operations recognized by this implementation.

+
+ +
+
+

Public Static Functions

+
+
+static SingleOperationNNPtr createPROJBased(const util::PropertyMap &properties, const std::string &PROJString, const crs::CRSPtr &sourceCRS, const crs::CRSPtr &targetCRS, const std::vector<metadata::PositionalAccuracyNNPtr> &accuracies = std::vector<metadata::PositionalAccuracyNNPtr>())
+

Instantiate a PROJ-based single operation.

+
+

Note

+

The operation might internally be a pipeline chaining several operations. The use of the SingleOperation modeling here is mostly to be able to get the PROJ string as a parameter.

+
+
+
Parameters
+
    +
  • properties – Properties

  • +
  • PROJString – the PROJ string.

  • +
  • sourceCRS – source CRS (might be null).

  • +
  • targetCRS – target CRS (might be null).

  • +
  • accuracies – Vector of positional accuracy (might be empty).

  • +
+
+
Returns
+

the new instance

+
+
+
+ +
+
+ +
+
+class Transformation : public osgeo::proj::operation::SingleOperation
+
+#include <coordinateoperation.hpp>
+

A mathematical operation on coordinates in which parameters are empirically derived from data containing the coordinates of a series of points in both coordinate reference systems.

+

This computational process is usually “over-determined”, allowing derivation of error (or accuracy) estimates for the coordinate transformation. Also, the stochastic nature of the parameters may result in multiple (different) versions of the same coordinate transformations between the same source and target CRSs. Any single coordinate operation in which the input and output coordinates are referenced to different datums (reference frames) will be a coordinate transformation.

+

+

Remark

+

Implements Transformation from ISO 19111:2019

+
+

+
+

Public Functions

+
+
+const crs::CRSNNPtr &sourceCRS()
+

Return the source crs::CRS of the transformation.

+
+
Returns
+

the source CRS.

+
+
+
+ +
+
+const crs::CRSNNPtr &targetCRS()
+

Return the target crs::CRS of the transformation.

+
+
Returns
+

the target CRS.

+
+
+
+ +
+
+virtual CoordinateOperationNNPtr inverse() const override
+

Return the inverse of the coordinate operation.

+
+
Throws
+

util::UnsupportedOperationException

+
+
+
+ +
+
+TransformationNNPtr substitutePROJAlternativeGridNames(io::DatabaseContextNNPtr databaseContext) const
+

Return an equivalent transformation to the current one, but using PROJ alternative grid names.

+
+ +
+
+

Public Static Functions

+
+
+static TransformationNNPtr create(const util::PropertyMap &properties, const crs::CRSNNPtr &sourceCRSIn, const crs::CRSNNPtr &targetCRSIn, const crs::CRSPtr &interpolationCRSIn, const OperationMethodNNPtr &methodIn, const std::vector<GeneralParameterValueNNPtr> &values, const std::vector<metadata::PositionalAccuracyNNPtr> &accuracies)
+

Instantiate a transformation from a vector of GeneralParameterValue.

+
+
Parameters
+
    +
  • properties – See General properties. At minimum the name should be defined.

  • +
  • sourceCRSIn – Source CRS.

  • +
  • targetCRSIn – Target CRS.

  • +
  • interpolationCRSIn – Interpolation CRS (might be null)

  • +
  • methodIn – Operation method.

  • +
  • values – Vector of GeneralOperationParameterNNPtr.

  • +
  • accuracies – Vector of positional accuracy (might be empty).

  • +
+
+
Throws
+

InvalidOperation

+
+
Returns
+

new Transformation.

+
+
+
+ +
+
+static TransformationNNPtr create(const util::PropertyMap &propertiesTransformation, const crs::CRSNNPtr &sourceCRSIn, const crs::CRSNNPtr &targetCRSIn, const crs::CRSPtr &interpolationCRSIn, const util::PropertyMap &propertiesOperationMethod, const std::vector<OperationParameterNNPtr> &parameters, const std::vector<ParameterValueNNPtr> &values, const std::vector<metadata::PositionalAccuracyNNPtr> &accuracies)
+

Instantiate a transformation and its OperationMethod.

+
+
Parameters
+
    +
  • propertiesTransformation – The General properties of the Transformation. At minimum the name should be defined.

  • +
  • sourceCRSIn – Source CRS.

  • +
  • targetCRSIn – Target CRS.

  • +
  • interpolationCRSIn – Interpolation CRS (might be null)

  • +
  • propertiesOperationMethod – The General properties of the OperationMethod. At minimum the name should be defined.

  • +
  • parameters – Vector of parameters of the operation method.

  • +
  • values – Vector of ParameterValueNNPtr. Constraint: values.size() == parameters.size()

  • +
  • accuracies – Vector of positional accuracy (might be empty).

  • +
+
+
Throws
+

InvalidOperation

+
+
Returns
+

new Transformation.

+
+
+
+ +
+
+static TransformationNNPtr createGeocentricTranslations(const util::PropertyMap &properties, const crs::CRSNNPtr &sourceCRSIn, const crs::CRSNNPtr &targetCRSIn, double translationXMetre, double translationYMetre, double translationZMetre, const std::vector<metadata::PositionalAccuracyNNPtr> &accuracies)
+

Instantiate a transformation with Geocentric Translations method.

+
+
Parameters
+
    +
  • properties – See General properties of the Transformation. At minimum the name should be defined.

  • +
  • sourceCRSIn – Source CRS.

  • +
  • targetCRSIn – Target CRS.

  • +
  • translationXMetre – Value of the Translation_X parameter (in metre).

  • +
  • translationYMetre – Value of the Translation_Y parameter (in metre).

  • +
  • translationZMetre – Value of the Translation_Z parameter (in metre).

  • +
  • accuracies – Vector of positional accuracy (might be empty).

  • +
+
+
Returns
+

new Transformation.

+
+
+
+ +
+
+static TransformationNNPtr createPositionVector(const util::PropertyMap &properties, const crs::CRSNNPtr &sourceCRSIn, const crs::CRSNNPtr &targetCRSIn, double translationXMetre, double translationYMetre, double translationZMetre, double rotationXArcSecond, double rotationYArcSecond, double rotationZArcSecond, double scaleDifferencePPM, const std::vector<metadata::PositionalAccuracyNNPtr> &accuracies)
+

Instantiate a transformation with Position vector transformation method.

+

This is similar to createCoordinateFrameRotation(), except that the sign of the rotation terms is inverted.

+
+
Parameters
+
    +
  • properties – See General properties of the Transformation. At minimum the name should be defined.

  • +
  • sourceCRSIn – Source CRS.

  • +
  • targetCRSIn – Target CRS.

  • +
  • translationXMetre – Value of the Translation_X parameter (in metre).

  • +
  • translationYMetre – Value of the Translation_Y parameter (in metre).

  • +
  • translationZMetre – Value of the Translation_Z parameter (in metre).

  • +
  • rotationXArcSecond – Value of the Rotation_X parameter (in arc-second).

  • +
  • rotationYArcSecond – Value of the Rotation_Y parameter (in arc-second).

  • +
  • rotationZArcSecond – Value of the Rotation_Z parameter (in arc-second).

  • +
  • scaleDifferencePPM – Value of the Scale_Difference parameter (in parts-per-million).

  • +
  • accuracies – Vector of positional accuracy (might be empty).

  • +
+
+
Returns
+

new Transformation.

+
+
+
+ +
+
+static TransformationNNPtr createCoordinateFrameRotation(const util::PropertyMap &properties, const crs::CRSNNPtr &sourceCRSIn, const crs::CRSNNPtr &targetCRSIn, double translationXMetre, double translationYMetre, double translationZMetre, double rotationXArcSecond, double rotationYArcSecond, double rotationZArcSecond, double scaleDifferencePPM, const std::vector<metadata::PositionalAccuracyNNPtr> &accuracies)
+

Instantiate a transformation with Coordinate Frame Rotation method.

+

This is similar to createPositionVector(), except that the sign of the rotation terms is inverted.

+
+
Parameters
+
    +
  • properties – See General properties of the Transformation. At minimum the name should be defined.

  • +
  • sourceCRSIn – Source CRS.

  • +
  • targetCRSIn – Target CRS.

  • +
  • translationXMetre – Value of the Translation_X parameter (in metre).

  • +
  • translationYMetre – Value of the Translation_Y parameter (in metre).

  • +
  • translationZMetre – Value of the Translation_Z parameter (in metre).

  • +
  • rotationXArcSecond – Value of the Rotation_X parameter (in arc-second).

  • +
  • rotationYArcSecond – Value of the Rotation_Y parameter (in arc-second).

  • +
  • rotationZArcSecond – Value of the Rotation_Z parameter (in arc-second).

  • +
  • scaleDifferencePPM – Value of the Scale_Difference parameter (in parts-per-million).

  • +
  • accuracies – Vector of positional accuracy (might be empty).

  • +
+
+
Returns
+

new Transformation.

+
+
+
+ +
+
+static TransformationNNPtr createTimeDependentPositionVector(const util::PropertyMap &properties, const crs::CRSNNPtr &sourceCRSIn, const crs::CRSNNPtr &targetCRSIn, double translationXMetre, double translationYMetre, double translationZMetre, double rotationXArcSecond, double rotationYArcSecond, double rotationZArcSecond, double scaleDifferencePPM, double rateTranslationX, double rateTranslationY, double rateTranslationZ, double rateRotationX, double rateRotationY, double rateRotationZ, double rateScaleDifference, double referenceEpochYear, const std::vector<metadata::PositionalAccuracyNNPtr> &accuracies)
+

Instantiate a transformation with Time Dependent position vector transformation method.

+

This is similar to createTimeDependentCoordinateFrameRotation(), except that the sign of the rotation terms is inverted.

+

This method is defined as [EPSG:1053] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::1053)

+
+
Parameters
+
    +
  • properties – See General properties of the Transformation. At minimum the name should be defined.

  • +
  • sourceCRSIn – Source CRS.

  • +
  • targetCRSIn – Target CRS.

  • +
  • translationXMetre – Value of the Translation_X parameter (in metre).

  • +
  • translationYMetre – Value of the Translation_Y parameter (in metre).

  • +
  • translationZMetre – Value of the Translation_Z parameter (in metre).

  • +
  • rotationXArcSecond – Value of the Rotation_X parameter (in arc-second).

  • +
  • rotationYArcSecond – Value of the Rotation_Y parameter (in arc-second).

  • +
  • rotationZArcSecond – Value of the Rotation_Z parameter (in arc-second).

  • +
  • scaleDifferencePPM – Value of the Scale_Difference parameter (in parts-per-million).

  • +
  • rateTranslationX – Value of the rate of change of X-axis translation (in metre/year)

  • +
  • rateTranslationY – Value of the rate of change of Y-axis translation (in metre/year)

  • +
  • rateTranslationZ – Value of the rate of change of Z-axis translation (in metre/year)

  • +
  • rateRotationX – Value of the rate of change of X-axis rotation (in arc-second/year)

  • +
  • rateRotationY – Value of the rate of change of Y-axis rotation (in arc-second/year)

  • +
  • rateRotationZ – Value of the rate of change of Z-axis rotation (in arc-second/year)

  • +
  • rateScaleDifference – Value of the rate of change of scale difference (in PPM/year)

  • +
  • referenceEpochYear – Parameter reference epoch (in decimal year)

  • +
  • accuracies – Vector of positional accuracy (might be empty).

  • +
+
+
Returns
+

new Transformation.

+
+
+
+ +
+
+static TransformationNNPtr createTimeDependentCoordinateFrameRotation(const util::PropertyMap &properties, const crs::CRSNNPtr &sourceCRSIn, const crs::CRSNNPtr &targetCRSIn, double translationXMetre, double translationYMetre, double translationZMetre, double rotationXArcSecond, double rotationYArcSecond, double rotationZArcSecond, double scaleDifferencePPM, double rateTranslationX, double rateTranslationY, double rateTranslationZ, double rateRotationX, double rateRotationY, double rateRotationZ, double rateScaleDifference, double referenceEpochYear, const std::vector<metadata::PositionalAccuracyNNPtr> &accuracies)
+

Instantiate a transformation with Time Dependent Position coordinate frame rotation transformation method.

+

This is similar to createTimeDependentPositionVector(), except that the sign of the rotation terms is inverted.

+

This method is defined as [EPSG:1056] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::1056)

+
+
Parameters
+
    +
  • properties – See General properties of the Transformation. At minimum the name should be defined.

  • +
  • sourceCRSIn – Source CRS.

  • +
  • targetCRSIn – Target CRS.

  • +
  • translationXMetre – Value of the Translation_X parameter (in metre).

  • +
  • translationYMetre – Value of the Translation_Y parameter (in metre).

  • +
  • translationZMetre – Value of the Translation_Z parameter (in metre).

  • +
  • rotationXArcSecond – Value of the Rotation_X parameter (in arc-second).

  • +
  • rotationYArcSecond – Value of the Rotation_Y parameter (in arc-second).

  • +
  • rotationZArcSecond – Value of the Rotation_Z parameter (in arc-second).

  • +
  • scaleDifferencePPM – Value of the Scale_Difference parameter (in parts-per-million).

  • +
  • rateTranslationX – Value of the rate of change of X-axis translation (in metre/year)

  • +
  • rateTranslationY – Value of the rate of change of Y-axis translation (in metre/year)

  • +
  • rateTranslationZ – Value of the rate of change of Z-axis translation (in metre/year)

  • +
  • rateRotationX – Value of the rate of change of X-axis rotation (in arc-second/year)

  • +
  • rateRotationY – Value of the rate of change of Y-axis rotation (in arc-second/year)

  • +
  • rateRotationZ – Value of the rate of change of Z-axis rotation (in arc-second/year)

  • +
  • rateScaleDifference – Value of the rate of change of scale difference (in PPM/year)

  • +
  • referenceEpochYear – Parameter reference epoch (in decimal year)

  • +
  • accuracies – Vector of positional accuracy (might be empty).

  • +
+
+
Throws
+

InvalidOperation

+
+
Returns
+

new Transformation.

+
+
+
+ +
+
+static TransformationNNPtr createTOWGS84(const crs::CRSNNPtr &sourceCRSIn, const std::vector<double> &TOWGS84Parameters)
+

Instantiate a transformation from TOWGS84 parameters.

+

This is a helper of createPositionVector() with the source CRS being the GeographicCRS of sourceCRSIn, and the target CRS being EPSG:4326

+
+
Parameters
+
    +
  • sourceCRSIn – Source CRS.

  • +
  • TOWGS84Parameters – The vector of 3 double values (Translation_X,_Y,_Z) or 7 double values (Translation_X,_Y,_Z, Rotation_X,_Y,_Z, Scale_Difference) passed to createPositionVector()

  • +
+
+
Throws
+

InvalidOperation

+
+
Returns
+

new Transformation.

+
+
+
+ +
+
+static TransformationNNPtr createNTv2(const util::PropertyMap &properties, const crs::CRSNNPtr &sourceCRSIn, const crs::CRSNNPtr &targetCRSIn, const std::string &filename, const std::vector<metadata::PositionalAccuracyNNPtr> &accuracies)
+

Instantiate a transformation with NTv2 method.

+
+
Parameters
+
    +
  • properties – See General properties of the Transformation. At minimum the name should be defined.

  • +
  • sourceCRSIn – Source CRS.

  • +
  • targetCRSIn – Target CRS.

  • +
  • filename – NTv2 filename.

  • +
  • accuracies – Vector of positional accuracy (might be empty).

  • +
+
+
Returns
+

new Transformation.

+
+
+
+ +
+
+static TransformationNNPtr createMolodensky(const util::PropertyMap &properties, const crs::CRSNNPtr &sourceCRSIn, const crs::CRSNNPtr &targetCRSIn, double translationXMetre, double translationYMetre, double translationZMetre, double semiMajorAxisDifferenceMetre, double flattingDifference, const std::vector<metadata::PositionalAccuracyNNPtr> &accuracies)
+

Instantiate a transformation with Molodensky method.

+

+This method is defined as [EPSG:9604] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9604)

+

See also

+

createAbridgedMolodensky() for a related method.

+
+

+
+
Parameters
+
    +
  • properties – See General properties of the Transformation. At minimum the name should be defined.

  • +
  • sourceCRSIn – Source CRS.

  • +
  • targetCRSIn – Target CRS.

  • +
  • translationXMetre – Value of the Translation_X parameter (in metre).

  • +
  • translationYMetre – Value of the Translation_Y parameter (in metre).

  • +
  • translationZMetre – Value of the Translation_Z parameter (in metre).

  • +
  • semiMajorAxisDifferenceMetre – The difference between the semi-major axis values of the ellipsoids used in the target and source CRS (in metre).

  • +
  • flattingDifference – The difference between the flattening values of the ellipsoids used in the target and source CRS.

  • +
  • accuracies – Vector of positional accuracy (might be empty).

  • +
+
+
Throws
+

InvalidOperation

+
+
Returns
+

new Transformation.

+
+
+
+ +
+
+static TransformationNNPtr createAbridgedMolodensky(const util::PropertyMap &properties, const crs::CRSNNPtr &sourceCRSIn, const crs::CRSNNPtr &targetCRSIn, double translationXMetre, double translationYMetre, double translationZMetre, double semiMajorAxisDifferenceMetre, double flattingDifference, const std::vector<metadata::PositionalAccuracyNNPtr> &accuracies)
+

Instantiate a transformation with Abridged Molodensky method.

+

+This method is defined as [EPSG:9605] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9605)

+

See also

+

createdMolodensky() for a related method.

+
+

+
+
Parameters
+
    +
  • properties – See General properties of the Transformation. At minimum the name should be defined.

  • +
  • sourceCRSIn – Source CRS.

  • +
  • targetCRSIn – Target CRS.

  • +
  • translationXMetre – Value of the Translation_X parameter (in metre).

  • +
  • translationYMetre – Value of the Translation_Y parameter (in metre).

  • +
  • translationZMetre – Value of the Translation_Z parameter (in metre).

  • +
  • semiMajorAxisDifferenceMetre – The difference between the semi-major axis values of the ellipsoids used in the target and source CRS (in metre).

  • +
  • flattingDifference – The difference between the flattening values of the ellipsoids used in the target and source CRS.

  • +
  • accuracies – Vector of positional accuracy (might be empty).

  • +
+
+
Throws
+

InvalidOperation

+
+
Returns
+

new Transformation.

+
+
+
+ +
+
+static TransformationNNPtr createGravityRelatedHeightToGeographic3D(const util::PropertyMap &properties, const crs::CRSNNPtr &sourceCRSIn, const crs::CRSNNPtr &targetCRSIn, const crs::CRSPtr &interpolationCRSIn, const std::string &filename, const std::vector<metadata::PositionalAccuracyNNPtr> &accuracies)
+

Instantiate a transformation from GravityRelatedHeight to Geographic3D.

+
+
Parameters
+
    +
  • properties – See General properties of the Transformation. At minimum the name should be defined.

  • +
  • sourceCRSIn – Source CRS.

  • +
  • targetCRSIn – Target CRS.

  • +
  • interpolationCRSIn – Interpolation CRS. (might be null)

  • +
  • filename – GRID filename.

  • +
  • accuracies – Vector of positional accuracy (might be empty).

  • +
+
+
Returns
+

new Transformation.

+
+
+
+ +
+
+static TransformationNNPtr createVERTCON(const util::PropertyMap &properties, const crs::CRSNNPtr &sourceCRSIn, const crs::CRSNNPtr &targetCRSIn, const std::string &filename, const std::vector<metadata::PositionalAccuracyNNPtr> &accuracies)
+

Instantiate a transformation with method VERTCON.

+
+
Parameters
+
    +
  • properties – See General properties of the Transformation. At minimum the name should be defined.

  • +
  • sourceCRSIn – Source CRS.

  • +
  • targetCRSIn – Target CRS.

  • +
  • filename – GRID filename.

  • +
  • accuracies – Vector of positional accuracy (might be empty).

  • +
+
+
Returns
+

new Transformation.

+
+
+
+ +
+
+static TransformationNNPtr createLongitudeRotation(const util::PropertyMap &properties, const crs::CRSNNPtr &sourceCRSIn, const crs::CRSNNPtr &targetCRSIn, const common::Angle &offset)
+

Instantiate a transformation with method Longitude rotation.

+

This method is defined as [EPSG:9601] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9601)

    +
  • +
+

+
+
Parameters
+
    +
  • properties – See General properties of the Transformation. At minimum the name should be defined.

  • +
  • sourceCRSIn – Source CRS.

  • +
  • targetCRSIn – Target CRS.

  • +
  • offset – Longitude offset to add.

  • +
+
+
Returns
+

new Transformation.

+
+
+
+ +
+
+static TransformationNNPtr createGeographic2DOffsets(const util::PropertyMap &properties, const crs::CRSNNPtr &sourceCRSIn, const crs::CRSNNPtr &targetCRSIn, const common::Angle &offsetLat, const common::Angle &offsetLon, const std::vector<metadata::PositionalAccuracyNNPtr> &accuracies)
+

Instantiate a transformation with method Geographic 2D offsets.

+

This method is defined as [EPSG:9619] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9619)

    +
  • +
+

+
+
Parameters
+
    +
  • properties – See General properties of the Transformation. At minimum the name should be defined.

  • +
  • sourceCRSIn – Source CRS.

  • +
  • targetCRSIn – Target CRS.

  • +
  • offsetLat – Latitude offset to add.

  • +
  • offsetLon – Longitude offset to add.

  • +
  • accuracies – Vector of positional accuracy (might be empty).

  • +
+
+
Returns
+

new Transformation.

+
+
+
+ +
+
+static TransformationNNPtr createGeographic3DOffsets(const util::PropertyMap &properties, const crs::CRSNNPtr &sourceCRSIn, const crs::CRSNNPtr &targetCRSIn, const common::Angle &offsetLat, const common::Angle &offsetLon, const common::Length &offsetHeight, const std::vector<metadata::PositionalAccuracyNNPtr> &accuracies)
+

Instantiate a transformation with method Geographic 3D offsets.

+

This method is defined as [EPSG:9660] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9660)

    +
  • +
+

+
+
Parameters
+
    +
  • properties – See General properties of the Transformation. At minimum the name should be defined.

  • +
  • sourceCRSIn – Source CRS.

  • +
  • targetCRSIn – Target CRS.

  • +
  • offsetLat – Latitude offset to add.

  • +
  • offsetLon – Longitude offset to add.

  • +
  • offsetHeight – Height offset to add.

  • +
  • accuracies – Vector of positional accuracy (might be empty).

  • +
+
+
Returns
+

new Transformation.

+
+
+
+ +
+
+static TransformationNNPtr createGeographic2DWithHeightOffsets(const util::PropertyMap &properties, const crs::CRSNNPtr &sourceCRSIn, const crs::CRSNNPtr &targetCRSIn, const common::Angle &offsetLat, const common::Angle &offsetLon, const common::Length &offsetHeight, const std::vector<metadata::PositionalAccuracyNNPtr> &accuracies)
+

Instantiate a transformation with method Geographic 2D with height offsets.

+

This method is defined as [EPSG:9618] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9618)

    +
  • +
+

+
+
Parameters
+
    +
  • properties – See General properties of the Transformation. At minimum the name should be defined.

  • +
  • sourceCRSIn – Source CRS.

  • +
  • targetCRSIn – Target CRS.

  • +
  • offsetLat – Latitude offset to add.

  • +
  • offsetLon – Longitude offset to add.

  • +
  • offsetHeight – Geoid undulation to add.

  • +
  • accuracies – Vector of positional accuracy (might be empty).

  • +
+
+
Returns
+

new Transformation.

+
+
+
+ +
+
+static TransformationNNPtr createVerticalOffset(const util::PropertyMap &properties, const crs::CRSNNPtr &sourceCRSIn, const crs::CRSNNPtr &targetCRSIn, const common::Length &offsetHeight, const std::vector<metadata::PositionalAccuracyNNPtr> &accuracies)
+

Instantiate a transformation with method Vertical Offset.

+

This method is defined as [EPSG:9616] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9616)

    +
  • +
+

+
+
Parameters
+
    +
  • properties – See General properties of the Transformation. At minimum the name should be defined.

  • +
  • sourceCRSIn – Source CRS.

  • +
  • targetCRSIn – Target CRS.

  • +
  • offsetHeight – Geoid undulation to add.

  • +
  • accuracies – Vector of positional accuracy (might be empty).

  • +
+
+
Returns
+

new Transformation.

+
+
+
+ +
+
+static TransformationNNPtr createChangeVerticalUnit(const util::PropertyMap &properties, const crs::CRSNNPtr &sourceCRSIn, const crs::CRSNNPtr &targetCRSIn, const common::Scale &factor, const std::vector<metadata::PositionalAccuracyNNPtr> &accuracies)
+

Instantiate a transformation based on the Change of Vertical Unit method.

+

This method is defined as [EPSG:1069] (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::1069)

+
+
Parameters
+
    +
  • properties – See General properties of the conversion. If the name is not provided, it is automatically set.

  • +
  • sourceCRSIn – Source CRS.

  • +
  • targetCRSIn – Target CRS.

  • +
  • factorConversion factor

  • +
  • accuracies – Vector of positional accuracy (might be empty).

  • +
+
+
Returns
+

a new Transformation.

+
+
+
+ +
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/development/reference/cpp/util.html b/development/reference/cpp/util.html new file mode 100644 index 00000000..36f51bd9 --- /dev/null +++ b/development/reference/cpp/util.html @@ -0,0 +1,688 @@ + + + + + + + util namespace — PROJ 9.0.0 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

util namespace

+
+
+namespace osgeo::proj::util
+

A set of base types from ISO 19103, GeoAPI and other PROJ specific classes.

+

osgeo.proj.util namespace.

+
+

Typedefs

+
+
+using BaseObjectPtr = std::shared_ptr<BaseObject>
+

Shared pointer of BaseObject.

+
+ +
+
+using BoxedValuePtr = std::shared_ptr<BoxedValue>
+

Shared pointer of BoxedValue.

+
+ +
+
+using BoxedValueNNPtr = util::nn<BoxedValuePtr>
+

Non-null shared pointer of BoxedValue.

+
+ +
+
+using ArrayOfBaseObjectPtr = std::shared_ptr<ArrayOfBaseObject>
+

Shared pointer of ArrayOfBaseObject.

+
+ +
+
+using ArrayOfBaseObjectNNPtr = util::nn<ArrayOfBaseObjectPtr>
+

Non-null shared pointer of ArrayOfBaseObject.

+
+ +
+
+using LocalNamePtr = std::shared_ptr<LocalName>
+

Shared pointer of LocalName.

+
+ +
+
+using LocalNameNNPtr = util::nn<LocalNamePtr>
+

Non-null shared pointer of LocalName.

+
+ +
+
+using NameSpacePtr = std::shared_ptr<NameSpace>
+

Shared pointer of NameSpace.

+
+ +
+
+using NameSpaceNNPtr = util::nn<NameSpacePtr>
+

Non-null shared pointer of NameSpace.

+
+ +
+
+using GenericNamePtr = std::shared_ptr<GenericName>
+

Shared pointer of GenericName.

+
+ +
+
+using GenericNameNNPtr = util::nn<GenericNamePtr>
+

Non-null shared pointer of GenericName.

+
+ +
+
+
+class ArrayOfBaseObject : public osgeo::proj::util::BaseObject
+
+#include <util.hpp>
+

Array of BaseObject.

+
+

Public Functions

+
+
+void add(const BaseObjectNNPtr &obj)
+

Adds an object to the array.

+
+
Parameters
+

obj – the object to add.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static ArrayOfBaseObjectNNPtr create()
+

Instantiate a ArrayOfBaseObject.

+
+
Returns
+

a new ArrayOfBaseObject.

+
+
+
+ +
+
+ +
+
+class BaseObject
+
+#include <util.hpp>
+

Class that can be derived from, to emulate Java’s Object behavior.

+

Subclassed by osgeo::proj::common::IdentifiedObject, osgeo::proj::common::Measure, osgeo::proj::common::ObjectDomain, osgeo::proj::common::UnitOfMeasure, osgeo::proj::metadata::Citation, osgeo::proj::metadata::Extent, osgeo::proj::metadata::GeographicExtent, osgeo::proj::metadata::Identifier, osgeo::proj::metadata::PositionalAccuracy, osgeo::proj::metadata::TemporalExtent, osgeo::proj::metadata::VerticalExtent, osgeo::proj::operation::GeneralParameterValue, osgeo::proj::operation::ParameterValue, osgeo::proj::util::ArrayOfBaseObject, osgeo::proj::util::BoxedValue, osgeo::proj::util::GenericName

+
+ +
+
+struct BaseObjectNNPtr : public util::nn<BaseObjectPtr>
+
+#include <util.hpp>
+

Non-null shared pointer of BaseObject.

+
+ +
+
+class BoxedValue : public osgeo::proj::util::BaseObject
+
+#include <util.hpp>
+

Encapsulate standard datatypes in an object.

+
+

Public Functions

+
+
+BoxedValue(const char *stringValueIn)
+

Constructs a BoxedValue from a string.

+
+ +
+
+BoxedValue(const std::string &stringValueIn)
+

Constructs a BoxedValue from a string.

+
+ +
+
+BoxedValue(int integerValueIn)
+

Constructs a BoxedValue from an integer.

+
+ +
+
+BoxedValue(bool booleanValueIn)
+

Constructs a BoxedValue from a boolean.

+
+ +
+
+ +
+
+class CodeList
+
+#include <util.hpp>
+

Abstract class to define an enumeration of values.

+

Subclassed by osgeo::proj::cs::AxisDirection, osgeo::proj::datum::RealizationMethod

+
+

Public Functions

+
+
+inline const std::string &toString()
+

Return the CodeList item as a string.

+
+ +
+
+inline operator std::string()
+

Return the CodeList item as a string.

+
+ +
+
+ +
+
+class Exception : public std::exception
+
+#include <util.hpp>
+

Root exception class.

+

Subclassed by osgeo::proj::crs::InvalidCompoundCRSException, osgeo::proj::io::FactoryException, osgeo::proj::io::FormattingException, osgeo::proj::io::ParsingException, osgeo::proj::operation::InvalidOperation, osgeo::proj::util::InvalidValueTypeException, osgeo::proj::util::UnsupportedOperationException

+
+

Public Functions

+
+
+virtual const char *what() const noexcept override
+

Return the exception text.

+
+ +
+
+ +
+
+class GenericName : public osgeo::proj::util::BaseObject
+
+#include <util.hpp>
+

A sequence of identifiers rooted within the context of a namespace.

+

+

+

Subclassed by osgeo::proj::util::LocalName

+
+

Public Functions

+
+
+virtual const NameSpacePtr scope() const = 0
+

Return the scope of the object, possibly a global one.

+
+ +
+
+virtual std::string toString() const = 0
+

Return the LocalName as a string.

+
+ +
+
+virtual GenericNameNNPtr toFullyQualifiedName() const = 0
+

Return a fully qualified name corresponding to the local name.

+

The namespace of the resulting name is a global one.

+
+ +
+
+ +
+
+class IComparable
+
+#include <util.hpp>
+

Interface for an object that can be compared to another.

+

Subclassed by osgeo::proj::common::IdentifiedObject, osgeo::proj::common::ObjectDomain, osgeo::proj::metadata::Extent, osgeo::proj::metadata::GeographicExtent, osgeo::proj::metadata::TemporalExtent, osgeo::proj::metadata::VerticalExtent, osgeo::proj::operation::GeneralParameterValue, osgeo::proj::operation::ParameterValue

+
+

Public Types

+
+
+enum class Criterion
+

Comparison criterion.

+

Values:

+
+
+enumerator STRICT
+

All properties are identical.

+
+ +
+
+enumerator EQUIVALENT
+

The objects are equivalent for the purpose of coordinate operations. They can differ by the name of their objects, identifiers, other metadata. Parameters may be expressed in different units, provided that the value is (with some tolerance) the same once expressed in a common unit.

+
+ +
+
+enumerator EQUIVALENT_EXCEPT_AXIS_ORDER_GEOGCRS
+

Same as EQUIVALENT, relaxed with an exception that the axis order of the base CRS of a DerivedCRS/ProjectedCRS or the axis order of a GeographicCRS is ignored. Only to be used with DerivedCRS/ProjectedCRS/GeographicCRS

+
+ +
+ +
+
+

Public Functions

+
+
+bool isEquivalentTo(const IComparable *other, Criterion criterion = Criterion::STRICT, const io::DatabaseContextPtr &dbContext = nullptr) const
+

Returns whether an object is equivalent to another one.

+
+
Parameters
+
    +
  • other – other object to compare to

  • +
  • criterion – comparison criterion.

  • +
  • dbContext – Database context, or nullptr.

  • +
+
+
Returns
+

true if objects are equivalent.

+
+
+
+ +
+
+ +
+
+class InvalidValueTypeException : public osgeo::proj::util::Exception
+
+#include <util.hpp>
+

Exception thrown when an invalid value type is set as the value of a key of a PropertyMap.

+
+ +
+
+class LocalName : public osgeo::proj::util::GenericName
+
+#include <util.hpp>
+

Identifier within a NameSpace for a local object.

+

Local names are names which are directly accessible to and maintained by a NameSpace within which they are local, indicated by the scope.

+

+

+
+

Public Functions

+
+
+virtual const NameSpacePtr scope() const override
+

Return the scope of the object, possibly a global one.

+
+ +
+
+virtual std::string toString() const override
+

Return the LocalName as a string.

+
+ +
+
+virtual GenericNameNNPtr toFullyQualifiedName() const override
+

Return a fully qualified name corresponding to the local name.

+

The namespace of the resulting name is a global one.

+
+ +
+
+ +
+
+class NameFactory
+
+#include <util.hpp>
+

Factory for generic names.

+

+

+
+

Public Static Functions

+
+
+static NameSpaceNNPtr createNameSpace(const GenericNameNNPtr &name, const PropertyMap &properties)
+

Instantiate a NameSpace.

+
+
Parameters
+
    +
  • name – name of the namespace.

  • +
  • properties – Properties. Allowed keys are “separator” and “separator.head”.

  • +
+
+
Returns
+

a new NameFactory.

+
+
+
+ +
+
+static LocalNameNNPtr createLocalName(const NameSpacePtr &scope, const std::string &name)
+

Instantiate a LocalName.

+
+
Parameters
+
    +
  • scope – scope.

  • +
  • name – string of the local name.

  • +
+
+
Returns
+

a new LocalName.

+
+
+
+ +
+
+static GenericNameNNPtr createGenericName(const NameSpacePtr &scope, const std::vector<std::string> &parsedNames)
+

Instantiate a GenericName.

+
+
Parameters
+
    +
  • scope – scope.

  • +
  • parsedNames – the components of the name.

  • +
+
+
Returns
+

a new GenericName.

+
+
+
+ +
+
+ +
+
+class NameSpace
+
+#include <util.hpp>
+

A domain in which names given by strings are defined.

+

+

+
+

Public Functions

+
+
+bool isGlobal() const
+

Returns whether this is a global namespace.

+
+ +
+
+const GenericNamePtr &name() const
+

Returns the name of this namespace.

+
+ +
+
+ +
+
+template<class T>
class optional
+
+#include <util.hpp>
+

Loose transposition of [std::optional] (https://en.cppreference.com/w/cpp/utility/optional) available from C++17.

+
+

Public Functions

+
+
+inline const T *operator->() const
+

Returns a pointer to the contained value.

+
+ +
+
+inline const T &operator*() const
+

Returns a reference to the contained value.

+
+ +
+
+inline explicit operator bool() const noexcept
+

Return whether the optional has a value

+
+ +
+
+inline bool has_value() const noexcept
+

Return whether the optional has a value

+
+ +
+
+ +
+
+class PropertyMap
+
+#include <util.hpp>
+

Wrapper of a std::map<std::string, BaseObjectNNPtr>

+
+

Public Functions

+
+
+PropertyMap &set(const std::string &key, const BaseObjectNNPtr &val)
+

Set a BaseObjectNNPtr as the value of a key.

+
+ +
+
+PropertyMap &set(const std::string &key, const char *val)
+

Set a string as the value of a key.

+
+ +
+
+PropertyMap &set(const std::string &key, const std::string &val)
+

Set a string as the value of a key.

+
+ +
+
+PropertyMap &set(const std::string &key, int val)
+

Set a integer as the value of a key.

+
+ +
+
+PropertyMap &set(const std::string &key, bool val)
+

Set a boolean as the value of a key.

+
+ +
+
+PropertyMap &set(const std::string &key, const std::vector<std::string> &array)
+

Set a vector of strings as the value of a key.

+
+ +
+
+ +
+
+class UnsupportedOperationException : public osgeo::proj::util::Exception
+
+#include <util.hpp>
+

Exception Thrown to indicate that the requested operation is not supported.

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/development/reference/datatypes.html b/development/reference/datatypes.html new file mode 100644 index 00000000..40e65259 --- /dev/null +++ b/development/reference/datatypes.html @@ -0,0 +1,2275 @@ + + + + + + + Data types — PROJ 9.0.0 documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Data types

+

This section describes the numerous data types in use in PROJ.4. As a rule +of thumb PROJ.4 data types are prefixed with PJ_, or in one particular case, +is simply called PJ. A few notable exceptions can be traced +back to the very early days of PROJ.4 when the PJ_ prefix was not +consistently used.

+
+

Transformation objects

+
+
+type PJ
+

Object containing everything related to a given projection or transformation. +As a user of the PROJ.4 library you are only exposed to pointers to this +object and the contents is hidden behind the public API. PJ objects +are created with proj_create() and destroyed with +proj_destroy().

+
+ +
+
+type PJ_DIRECTION
+

Enumeration that is used to convey in which direction a given transformation +should be performed. Used in transformation function call as described in +the section on transformation functions.

+

Forward transformations are defined with the :c:

+
typedef enum proj_direction {
+    PJ_FWD   =  1,   /* Forward    */
+    PJ_IDENT =  0,   /* Do nothing */
+    PJ_INV   = -1    /* Inverse    */
+} PJ_DIRECTION;
+
+
+
+
+enumerator PJ_FWD
+

Perform transformation in the forward direction.

+
+ +
+
+enumerator PJ_IDENT
+

Identity. Do nothing.

+
+ +
+
+enumerator PJ_INV
+

Perform transformation in the inverse direction.

+
+ +
+ +
+
+type PJ_CONTEXT
+

Context objects enable safe multi-threaded usage of PROJ.4. Each PJ +object is connected to a context (if not specified, the default context is +used). All operations within a context should be performed in the same thread. +PJ_CONTEXT objects are created with proj_context_create() +and destroyed with proj_context_destroy().

+
+ +
+
+type PJ_AREA
+
+

New in version 6.0.0.

+
+

Opaque object describing an area in which a transformation is performed.

+

It is used with proj_create_crs_to_crs() to select the best transformation +between the two input coordinate reference systems.

+
+ +
+
+

2 dimensional coordinates

+

Various 2-dimensional coordinate data types.

+
+
+type PJ_LP
+

Geodetic coordinate, latitude and longitude. Usually in radians.

+
typedef struct { double lam, phi; } PJ_LP;
+
+
+
+
+double PJ_LP.lam
+

Longitude. Lambda.

+
+ +
+
+double PJ_LP.phi
+

Latitude. Phi.

+
+ +
+ +
+
+type PJ_XY
+

2-dimensional cartesian coordinate.

+
typedef struct { double x, y; } PJ_XY;
+
+
+
+
+double PJ_XY.x
+

Easting.

+
+ +
+
+double PJ_XY.y
+

Northing.

+
+ +
+ +
+
+type PJ_UV
+

2-dimensional generic coordinate. Usually used when contents can be either +a PJ_XY or PJ_LP.

+
typedef struct {double u, v; } PJ_UV;
+
+
+
+
+double PJ_UV.u
+

Longitude or easting, depending on use.

+
+ +
+
+double PJ_UV.v
+

Latitude or northing, depending on use.

+
+ +
+ +
+
+

3 dimensional coordinates

+

The following data types are the 3-dimensional equivalents to the data +types above.

+
+
+type PJ_LPZ
+

3-dimensional version of PJ_LP. Holds longitude, latitude and +a vertical component.

+
typedef struct { double lam, phi, z; } PJ_LPZ;
+
+
+
+
+double PJ_LPZ.lam
+

Longitude. Lambda.

+
+ +
+
+double PJ_LPZ.phi
+

Latitude. Phi.

+
+ +
+
+double PJ_LPZ.z
+

Vertical component.

+
+ +
+ +
+
+type PJ_XYZ
+

Cartesian coordinate in 3 dimensions. Extension of PJ_XY.

+
typedef struct { double x, y, z; } PJ_XYZ;
+
+
+
+
+double PJ_XYZ.x
+

Easting or the X component of a 3D cartesian system.

+
+ +
+
+double PJ_XYZ.y
+

Northing or the Y component of a 3D cartesian system.

+
+ +
+
+double PJ_XYZ.z
+

Vertical component or the Z component of a 3D cartesian system.

+
+ +
+ +
+
+type PJ_UVW
+

3-dimensional extension of PJ_UV.

+
typedef struct {double u, v, w; } PJ_UVW;
+
+
+
+
+double PJ_UVW.u
+

Longitude or easting, depending on use.

+
+ +
+
+double PJ_UVW.v
+

Latitude or northing, depending on use.

+
+ +
+
+double PJ_UVW.w
+

Vertical component.

+
+ +
+ +
+
+

Spatiotemporal coordinate types

+

The following data types are extensions of the triplets above into the time +domain.

+
+
+type PJ_LPZT
+

Spatiotemporal version of PJ_LPZ.

+
typedef struct {
+    double lam;
+    double phi;
+    double z;
+    double t;
+} PJ_LPZT;
+
+
+
+
+double PJ_LPZT.lam
+

Longitude.

+
+ +
+
+double PJ_LPZT.phi
+

Latitude

+
+ +
+
+double PJ_LPZT.z
+

Vertical component.

+
+ +
+
+double PJ_LPZT.t
+

Time component.

+
+ +
+ +
+
+type PJ_XYZT
+

Generic spatiotemporal coordinate. Useful for e.g. cartesian coordinates with +an attached time-stamp.

+
typedef struct {
+    double x;
+    double y;
+    double z;
+    double t;
+} PJ_XYZT;
+
+
+
+
+double PJ_XYZT.x
+

Easting or the X component of a 3D cartesian system.

+
+ +
+
+double PJ_XYZT.y
+

Northing or the Y component of a 3D cartesian system.

+
+ +
+
+double PJ_XYZT.z
+

Vertical or the Z component of a 3D cartesian system.

+
+ +
+
+double PJ_XYZT.t
+

Time component.

+
+ +
+ +
+
+type PJ_UVWT
+

Spatiotemporal version of PJ_UVW.

+
typedef struct { double u, v, w, t; } PJ_UVWT;
+
+
+
+
+double PJ_UVWT.e
+

First horizontal component.

+
+ +
+
+double PJ_UVWT.n
+

Second horizontal component.

+
+ +
+
+double PJ_UVWT.w
+

Vertical component.

+
+ +
+
+double PJ_UVWT.t
+

Temporal component.

+
+ +
+ +
+
+

Ancillary types for geodetic computations

+
+
+type PJ_OPK
+

Rotations, for instance three euler angles.

+
typedef struct { double o, p, k; } PJ_OPK;
+
+
+
+
+double PJ_OPK.o
+

First rotation angle, omega.

+
+ +
+
+double PJ_OPK.p
+

Second rotation angle, phi.

+
+ +
+
+double PJ_OPK.k
+

Third rotation angle, kappa.

+
+ +
+ +
+
+type PJ_ENU
+

East, north and up components.

+
typedef struct { double e, n, u; }          PJ_ENU;
+
+
+
+
+double PJ_ENU.e
+

East component.

+
+ +
+
+double PJ_ENU.n
+

North component.

+
+ +
+
+double PJ_ENU.u
+

Up component.

+
+ +
+ +
+
+type PJ_GEOD
+

Geodesic length, forward and reverse azimuths.

+
typedef struct { double s, a1, a2; }        PJ_GEOD;
+
+
+
+
+double PJ_GEOD.s
+

Geodesic length.

+
+ +
+
+double PJ_GEOD.a1
+

Forward azimuth.

+
+ +
+
+double PJ_GEOD.a2
+

Reverse azimuth.

+
+ +
+ +
+
+

Complex coordinate types

+
+
+type PJ_COORD
+

General purpose coordinate union type, applicable in two, three and four dimensions. +This is the default coordinate datatype used in PROJ.

+
typedef union {
+    double v[4];
+    PJ_XYZT xyzt;
+    PJ_UVWT uvwt;
+    PJ_LPZT lpzt;
+    PJ_GEOD geod;
+    PJ_OPK opk;
+    PJ_ENU enu;
+    PJ_XYZ  xyz;
+    PJ_UVW  uvw;
+    PJ_LPZ  lpz;
+    PJ_XY   xy;
+    PJ_UV   uv;
+    PJ_LP   lp;
+} PJ_COORD ;
+
+
+
+
+double v[4]
+

Generic four-dimensional vector.

+
+ +
+
+PJ_XYZT PJ_COORD.xyzt
+

Spatiotemporal cartesian coordinate.

+
+ +
+
+PJ_UVWT PJ_COORD.uvwt
+

Spatiotemporal generic coordinate.

+
+ +
+
+PJ_LPZT PJ_COORD.lpzt
+

Longitude, latitude, vertical and time components.

+
+ +
+
+PJ_GEOD PJ_COORD.geod
+

Geodesic length, forward and reverse azimuths.

+
+ +
+
+PJ_OPK PJ_COORD.opk
+

Rotations, for instance three euler angles.

+
+ +
+
+PJ_ENU PJ_COORD.enu
+

East, north and up components.

+
+ +
+
+PJ_XYZ PJ_COORD.xyz
+

3-dimensional cartesian coordinate.

+
+ +
+
+PJ_UVW PJ_COORD.uvw
+

3-dimensional generic coordinate.

+
+ +
+
+PJ_LPZ PJ_COORD.lpz
+

Longitude, latitude and vertical component.

+
+ +
+
+PJ_XY PJ_COORD.xy
+

2-dimensional cartesian coordinate.

+
+ +
+
+PJ_UV PJ_COORD.uv
+

2-dimensional generic coordinate.

+
+ +
+
+PJ_LP PJ_COORD.lp
+

Longitude and latitude.

+
+ +
+ +
+
+

Projection derivatives

+
+
+type PJ_FACTORS
+

Various cartographic properties, such as scale factors, angular distortion +and meridian convergence. Calculated with proj_factors().

+
typedef struct {
+    double meridional_scale;
+    double parallel_scale;
+    double areal_scale;
+
+    double angular_distortion;
+    double meridian_parallel_angle;
+    double meridian_convergence;
+
+    double tissot_semimajor;
+    double tissot_semiminor;
+
+    double dx_dlam;
+    double dx_dphi;
+    double dy_dlam;
+    double dy_dphi;
+} PJ_FACTORS;
+
+
+
+
+double PJ_FACTORS.meridional_scale
+

Meridional scale at coordinate \(\left(\lambda,\phi\right)\).

+
+ +
+
+double PJ_FACTORS.parallel_scale
+

Parallel scale at coordinate \(\left(\lambda,\phi\right)\).

+
+ +
+
+double PJ_FACTORS.areal_scale
+

Areal scale factor at coordinate \(\left(\lambda,\phi\right)\).

+
+ +
+
+double PJ_FACTORS.angular_distortion
+

Angular distortion at coordinate \(\left(\lambda,\phi\right)\).

+
+ +
+
+double PJ_FACTORS.meridian_parallel_angle
+
+

Meridian/parallel angle, \(\theta^\prime\), at coordinate \(\left(\lambda,\phi\right)\).

+
+
+
+double PJ_FACTORS.meridian_convergence
+

Meridian convergence at coordinate \(\left(\lambda,\phi\right)\). +Sometimes also described as grid declination.

+
+ +
+ +
+
+double PJ_FACTORS.tissot_semimajor
+

Maximum scale factor.

+
+ +
+
+double PJ_FACTORS.tissot_semiminor
+

Minimum scale factor.

+
+ +
+
+double PJ_FACTORS.dx_dlam
+

Partial derivative \(\frac{\partial x}{\partial \lambda}\) of coordinate +\(\left(\lambda,\phi\right)\).

+
+ +
+
+double PJ_FACTORS.dy_dlam
+

Partial derivative \(\frac{\partial y}{\partial \lambda}\) of coordinate +\(\left(\lambda,\phi\right)\).

+
+ +
+
+double PJ_FACTORS.dx_dphi
+

Partial derivative \(\frac{\partial x}{\partial \phi}\) of coordinate +\(\left(\lambda,\phi\right)\).

+
+ +
+
+double PJ_FACTORS.dy_dphi
+

Partial derivative \(\frac{\partial y}{\partial \phi}\) of coordinate +\(\left(\lambda,\phi\right)\).

+
+ +
+ +
+
+

List structures

+
+
+type PJ_OPERATIONS
+

Description a PROJ.4 operation

+
struct PJ_OPERATIONS {
+    const char  *id;            /* operation keyword */
+    PJ *(*proj)(PJ *);          /* operation  entry point */
+    char    * const *descr;     /* description text */
+};
+
+
+
+
+const char *id
+

Operation keyword.

+
+ +
+
+PJ *(*op)(PJ*)
+

Operation entry point.

+
+ +
+
+char *const *descr
+

Description of operation.

+
+ +
+ +
+
+type PJ_ELLPS
+

Description of ellipsoids defined in PROJ.4

+
struct PJ_ELLPS {
+    const char  *id;
+    const char  *major;
+    const char  *ell;
+    const char  *name;
+};
+
+
+
+
+const char *id
+

Keyword name of the ellipsoid.

+
+ +
+
+const char *major
+

Semi-major axis of the ellipsoid, or radius in case of a sphere.

+
+ +
+
+const char *ell
+

Elliptical parameter, e.g. rf=298.257 or b=6356772.2.

+
+ +
+
+const char *name
+

Name of the ellipsoid

+
+ +
+ +
+
+type PJ_UNITS
+

Distance units defined in PROJ.

+
struct PJ_UNITS {
+    const char  *id;        /* units keyword */
+    const char  *to_meter;  /* multiply by value to get meters */
+    const char  *name;      /* comments */
+    double      factor;     /* to_meter factor in actual numbers */
+};
+
+
+
+
+const char *id
+

Keyword for the unit.

+
+ +
+
+const char *to_meter
+

Text representation of the factor that converts a given unit to meters

+
+ +
+
+const char *name
+

Name of the unit.

+
+ +
+
+double factor
+

Conversion factor that converts the unit to meters.

+
+ +
+ +
+
+type PJ_PRIME_MERIDIANS
+

Prime meridians defined in PROJ.

+
struct PJ_PRIME_MERIDIANS {
+    const char  *id;
+    const char  *defn;
+};
+
+
+
+
+const char *id
+

Keyword for the prime meridian

+
+ +
+
+const char *def
+

Offset from Greenwich in DMS format.

+
+ +
+ +
+
+

Info structures

+
+
+type PJ_INFO
+

Struct holding information about the current instance of PROJ. Struct is +populated by proj_info().

+
typedef struct {
+    int           major;
+    int           minor;
+    int           patch;
+    const char   *release;
+    const char   *version;
+    const char   *searchpath;
+} PJ_INFO;
+
+
+
+
+const char *PJ_INFO.release
+

Release info. Version number and release date, +e.g. “Rel. 4.9.3, 15 August 2016”.

+
+ +
+
+const char *PJ_INFO.version
+

Text representation of the full version number, +e.g. “4.9.3”.

+
+ +
+
+int PJ_INFO.major
+

Major version number.

+
+ +
+
+int PJ_INFO.minor
+

Minor version number.

+
+ +
+
+int PJ_INFO.patch
+

Patch level of release.

+
+ +
+
+const char PJ_INFO.searchpath
+

Search path for PROJ. List of directories separated by +semicolons (Windows) or colons (non-Windows), e.g. +C:\\Users\\doctorwho;C:\\OSGeo4W64\\share\\proj. +Grids and init files are looked for in +directories in the search path.

+
+ +
+ +
+
+type PJ_PROJ_INFO
+

Struct holding information about a PJ object. Populated by +proj_pj_info(). The PJ_PROJ_INFO object provides a +view into the internals of a PJ, so once the PJ +is destroyed or otherwise becomes invalid, so does the +PJ_PROJ_INFO

+
typedef struct {
+    const char  *id;
+    const char  *description;
+    const char  *definition;
+    int          has_inverse;
+    double       accuracy;
+} PJ_PROJ_INFO;
+
+
+
+
+const char *PJ_PROJ_INFO.id
+

Short ID of the operation the PJ object is based on, that is, +what comes after the +proj= in a proj-string, e.g. “merc”.

+
+ +
+
+const char *PJ_PROJ_INFO.description
+

Long describes of the operation the PJ object is based on, +e.g. “Mercator Cyl, Sph&Ell lat_ts=”.

+
+ +
+
+const char *PJ_PROJ_INFO.definition
+

The proj-string that was used to create the PJ object with, +e.g. “+proj=merc +lat_0=24 +lon_0=53 +ellps=WGS84”.

+
+ +
+
+int PJ_PROJ_INFO.has_inverse
+

1 if an inverse mapping of the defined operation exists, otherwise 0.

+
+ +
+
+double PJ_PROJ_INFO.accuracy
+

Expected accuracy of the transformation. -1 if unknown.

+
+ +
+ +
+
+type PJ_GRID_INFO
+

Struct holding information about a specific grid in the search path of +PROJ. Populated with the function proj_grid_info().

+
typedef struct {
+    char        gridname[32];
+    char        filename[260];
+    char        format[8];
+    LP          lowerleft;
+    LP          upperright;
+    int         n_lon, n_lat;
+    double      cs_lon, cs_lat;
+} PJ_GRID_INFO;
+
+
+
+
+char PJ_GRID_INFO.gridname[32]
+

Name of grid, e.g. “BETA2007.gsb”.

+
+ +
+
+char PJ_GRID_INFO
+

Full path of grid file, e.g. “C:\OSGeo4W64\share\proj\BETA2007.gsb”

+
+ +
+
+char PJ_GRID_INFO.format[8]
+

File format of grid file, e.g. “ntv2

+
+ +
+
+LP PJ_GRID_INFO.lowerleft
+

Geodetic coordinate of lower left corner of grid.

+
+ +
+
+LP PJ_GRID_INFO.upperright
+

Geodetic coordinate of upper right corner of grid.

+
+ +
+
+int PJ_GRID_INFO.n_lon
+

Number of grid cells in the longitudinal direction.

+
+ +
+
+int PJ_GRID_INFO.n_lat
+

Number of grid cells in the latitudinal direction.

+
+ +
+
+double PJ_GRID_INFO.cs_lon
+

Cell size in the longitudinal direction. In radians.

+
+ +
+
+double PJ_GRID_INFO.cs_lat
+

Cell size in the latitudinal direction. In radians.

+
+ +
+ +
+
+type PJ_INIT_INFO
+

Struct holding information about a specific init file in the search path of +PROJ. Populated with the function proj_init_info().

+
typedef struct {
+    char        name[32];
+    char        filename[260];
+    char        version[32];
+    char        origin[32];
+    char        lastupdate[16];
+} PJ_INIT_INFO;
+
+
+
+
+char PJ_INIT_INFO.name[32]
+

Name of init file, e.g. “epsg”.

+
+ +
+
+char PJ_INIT_INFO.filename[260]
+

Full path of init file, e.g. “C:\OSGeo4W64\share\proj\epsg

+
+ +
+
+char PJ_INIT_INFO.version[32]
+

Version number of init file, e.g. “9.0.0

+
+ +
+
+char PJ_INIT_INFO.origin[32]
+

Originating entity of the init file, e.g. “EPSG

+
+ +
+
+char PJ_INIT_INFO.lastupdate
+

Date of last update of the init file.

+
+ +
+ +
+
+

Error codes

+
+

New in version 8.0.0.

+
+

Three classes of errors are defined below. The belonging of a given error +code to a class can bit tested with a binary and test. The error class itself +can be used as an error value in some rare cases where the error does not +fit into a more precise error value.

+

Those error codes are still quite generic for a number of them. Details on the +actual errors will be typically logged with the PJ_LOG_ERROR level.

+
+

Errors in class PROJ_ERR_INVALID_OP

+
+
+PROJ_ERR_INVALID_OP
+

Class of error codes typically related to coordinate operation initialization, +typically when creating a PJ* object from a PROJ string.

+
+

Note

+

some of them can also be emitted during coordinate transformation, +like PROJ_ERR_INVALID_OP_FILE_NOT_FOUND_OR_INVALID in case the resource loading +is deferred until it is really needed.

+
+
+ +
+
+PROJ_ERR_INVALID_OP_WRONG_SYNTAX
+

Invalid pipeline structure, missing +proj argument, etc.

+
+ +
+
+PROJ_ERR_INVALID_OP_MISSING_ARG
+

Missing required operation parameter

+
+ +
+
+PROJ_ERR_INVALID_OP_ILLEGAL_ARG_VALUE
+

One of the operation parameter has an illegal value.

+
+ +
+
+PROJ_ERR_INVALID_OP_MUTUALLY_EXCLUSIVE_ARGS
+

Mutually exclusive arguments

+
+ +
+
+PROJ_ERR_INVALID_OP_FILE_NOT_FOUND_OR_INVALID
+

File not found or with invalid content (particular case of PROJ_ERR_INVALID_OP_ILLEGAL_ARG_VALUE)

+
+ +
+
+

Errors in class PROJ_ERR_COORD_TRANSFM

+
+
+PROJ_ERR_COORD_TRANSFM
+

Class of error codes related to transformation on a specific coordinate.

+
+ +
+
+PROJ_ERR_COORD_TRANSFM_INVALID_COORD
+

Invalid input coordinate. e.g. a latitude > 90°.

+
+ +
+
+PROJ_ERR_COORD_TRANSFM_OUTSIDE_PROJECTION_DOMAIN
+

Coordinate is outside of the projection domain. e.g. approximate mercator +with |longitude - lon_0| > 90°, or iterative convergence method failed.

+
+ +
+
+PROJ_ERR_COORD_TRANSFM_NO_OPERATION
+

No operation found, e.g. if no match the required accuracy, or if ballpark transformations +were asked to not be used and they would be only such candidate.

+
+ +
+
+PROJ_ERR_COORD_TRANSFM_OUTSIDE_GRID
+

Point to transform falls outside grid/subgrid/TIN.

+
+ +
+
+PROJ_ERR_COORD_TRANSFM_GRID_AT_NODATA
+

Point to transform falls in a grid cell that evaluates to nodata.

+
+ +
+
+

Errors in class PROJ_ERR_OTHER

+
+
+PROJ_ERR_OTHER
+

Class of error codes that do not fit into one of the above class.

+
+ +
+
+PROJ_ERR_OTHER_API_MISUSE
+

Error related to a misuse of PROJ API.

+
+ +
+
+PROJ_ERR_OTHER_NO_INVERSE_OP
+

No inverse method available

+
+ +
+
+PROJ_ERR_OTHER_NETWORK_ERROR
+

Failure when accessing a network resource.

+
+ +
+
+
+

Logging

+
+
+type PJ_LOG_LEVEL
+

Enum of logging levels in PROJ. Used to set the logging level in PROJ. +Usually using proj_log_level().

+
+
+enumerator PJ_LOG_NONE
+

Don’t log anything.

+
+ +
+
+enumerator PJ_LOG_ERROR
+

Log only errors.

+
+ +
+
+enumerator PJ_LOG_DEBUG
+

Log errors and additional debug information.

+
+ +
+
+enumerator PJ_LOG_TRACE
+

Highest logging level. Log everything including very detailed debug +information.

+
+ +
+
+enumerator PJ_LOG_TELL
+

Special logging level that when used in proj_log_level() +will return the current logging level set in PROJ.

+
+ +
+

New in version 5.1.0.

+
+
+ +
+
+type PJ_LOG_FUNC
+

Function prototype for the logging function used by PROJ. +Defined as

+
typedef void (*PJ_LOG_FUNCTION)(void *, int, const char *);
+
+
+

where the first argument (void pointer) references a data structure used by the +calling application, the second argument (int type) is used to set the logging level +and the third argument (const char pointer) is the string that will be logged +by the function.

+
+

New in version 5.1.0.

+
+
+ +
+
+

Setting custom I/O functions

+
+

New in version 7.0.0.

+
+
+
+struct PROJ_FILE_API
+

File API callbacks

+
+

Public Members

+
+
+int version
+

Version of this structure. Should be set to 1 currently.

+
+ +
+
+PROJ_FILE_HANDLE *(*open_cbk)(PJ_CONTEXT *ctx, const char *filename, PROJ_OPEN_ACCESS access, void *user_data)
+

Open file. Return NULL if error

+
+ +
+
+size_t (*read_cbk)(PJ_CONTEXT *ctx, PROJ_FILE_HANDLE*, void *buffer, size_t sizeBytes, void *user_data)
+

Read sizeBytes into buffer from current position and return number of bytes read

+
+ +
+
+size_t (*write_cbk)(PJ_CONTEXT *ctx, PROJ_FILE_HANDLE*, const void *buffer, size_t sizeBytes, void *user_data)
+

Write sizeBytes into buffer from current position and return number of bytes written

+
+ +
+
+int (*seek_cbk)(PJ_CONTEXT *ctx, PROJ_FILE_HANDLE*, long long offset, int whence, void *user_data)
+

Seek to offset using whence=SEEK_SET/SEEK_CUR/SEEK_END. Return TRUE in case of success

+
+ +
+
+unsigned long long (*tell_cbk)(PJ_CONTEXT *ctx, PROJ_FILE_HANDLE*, void *user_data)
+

Return current file position

+
+ +
+
+void (*close_cbk)(PJ_CONTEXT *ctx, PROJ_FILE_HANDLE*, void *user_data)
+

Close file

+
+ +
+
+int (*exists_cbk)(PJ_CONTEXT *ctx, const char *filename, void *user_data)
+

Return TRUE if a file exists

+
+ +
+
+int (*mkdir_cbk)(PJ_CONTEXT *ctx, const char *filename, void *user_data)
+

Return TRUE if directory exists or could be created

+
+ +
+ +

Return TRUE if file could be removed

+
+ +
+
+int (*rename_cbk)(PJ_CONTEXT *ctx, const char *oldPath, const char *newPath, void *user_data)
+

Return TRUE if file could be renamed

+
+ +
+
+ +
+
+typedef struct PROJ_FILE_HANDLE PROJ_FILE_HANDLE
+

Opaque structure for PROJ for a file handle. Implementations might cast it to their structure/class of choice.

+
+ +
+
+enum PROJ_OPEN_ACCESS
+

Open access / mode

+

Values:

+
+
+enumerator PROJ_OPEN_ACCESS_READ_ONLY
+

Read-only access. Equivalent to “rb”

+
+ +
+
+enumerator PROJ_OPEN_ACCESS_READ_UPDATE
+

Read-update access. File should be created if not existing. Equivalent to “r+b”

+
+ +
+
+enumerator PROJ_OPEN_ACCESS_CREATE
+

Create access. File should be truncated to 0-byte if already existing. Equivalent to “w+b”

+
+ +
+ +
+ +
+

C API for ISO-19111 functionality

+
+
+enum PJ_GUESSED_WKT_DIALECT
+

Guessed WKT “dialect”.

+

Values:

+
+
+enumerator PJ_GUESSED_WKT2_2019
+

WKT2:2019

+
+ +
+
+enumerator PJ_GUESSED_WKT2_2018
+

Deprecated alias for PJ_GUESSED_WKT2_2019

+
+ +
+
+enumerator PJ_GUESSED_WKT2_2015
+

WKT2:2015

+
+ +
+
+enumerator PJ_GUESSED_WKT1_GDAL
+

WKT1 specification

+
+ +
+
+enumerator PJ_GUESSED_WKT1_ESRI
+

ESRI variant of WKT1

+
+ +
+
+enumerator PJ_GUESSED_NOT_WKT
+

Not WKT / unrecognized

+
+ +
+ +
+
+enum PJ_CATEGORY
+

Object category.

+

Values:

+
+
+enumerator PJ_CATEGORY_ELLIPSOID
+
+ +
+
+enumerator PJ_CATEGORY_PRIME_MERIDIAN
+
+ +
+
+enumerator PJ_CATEGORY_DATUM
+
+ +
+
+enumerator PJ_CATEGORY_CRS
+
+ +
+
+enumerator PJ_CATEGORY_COORDINATE_OPERATION
+
+ +
+
+enumerator PJ_CATEGORY_DATUM_ENSEMBLE
+
+ +
+ +
+
+enum PJ_TYPE
+

Object type.

+

Values:

+
+
+enumerator PJ_TYPE_UNKNOWN
+
+ +
+
+enumerator PJ_TYPE_ELLIPSOID
+
+ +
+
+enumerator PJ_TYPE_PRIME_MERIDIAN
+
+ +
+
+enumerator PJ_TYPE_GEODETIC_REFERENCE_FRAME
+
+ +
+
+enumerator PJ_TYPE_DYNAMIC_GEODETIC_REFERENCE_FRAME
+
+ +
+
+enumerator PJ_TYPE_VERTICAL_REFERENCE_FRAME
+
+ +
+
+enumerator PJ_TYPE_DYNAMIC_VERTICAL_REFERENCE_FRAME
+
+ +
+
+enumerator PJ_TYPE_DATUM_ENSEMBLE
+
+ +
+
+enumerator PJ_TYPE_CRS
+

Abstract type, not returned by proj_get_type()

+
+ +
+
+enumerator PJ_TYPE_GEODETIC_CRS
+
+ +
+
+enumerator PJ_TYPE_GEOCENTRIC_CRS
+
+ +
+
+enumerator PJ_TYPE_GEOGRAPHIC_CRS
+

proj_get_type() will never return that type, but PJ_TYPE_GEOGRAPHIC_2D_CRS or PJ_TYPE_GEOGRAPHIC_3D_CRS.

+
+ +
+
+enumerator PJ_TYPE_GEOGRAPHIC_2D_CRS
+
+ +
+
+enumerator PJ_TYPE_GEOGRAPHIC_3D_CRS
+
+ +
+
+enumerator PJ_TYPE_VERTICAL_CRS
+
+ +
+
+enumerator PJ_TYPE_PROJECTED_CRS
+
+ +
+
+enumerator PJ_TYPE_COMPOUND_CRS
+
+ +
+
+enumerator PJ_TYPE_TEMPORAL_CRS
+
+ +
+
+enumerator PJ_TYPE_ENGINEERING_CRS
+
+ +
+
+enumerator PJ_TYPE_BOUND_CRS
+
+ +
+
+enumerator PJ_TYPE_OTHER_CRS
+
+ +
+
+enumerator PJ_TYPE_CONVERSION
+
+ +
+
+enumerator PJ_TYPE_TRANSFORMATION
+
+ +
+
+enumerator PJ_TYPE_CONCATENATED_OPERATION
+
+ +
+
+enumerator PJ_TYPE_OTHER_COORDINATE_OPERATION
+
+ +
+
+enumerator PJ_TYPE_TEMPORAL_DATUM
+
+ +
+
+enumerator PJ_TYPE_ENGINEERING_DATUM
+
+ +
+
+enumerator PJ_TYPE_PARAMETRIC_DATUM
+
+ +
+ +
+
+enum PJ_COMPARISON_CRITERION
+

Comparison criterion.

+

Values:

+
+
+enumerator PJ_COMP_STRICT
+

All properties are identical.

+
+ +
+
+enumerator PJ_COMP_EQUIVALENT
+

The objects are equivalent for the purpose of coordinate operations. They can differ by the name of their objects, identifiers, other metadata. Parameters may be expressed in different units, provided that the value is (with some tolerance) the same once expressed in a common unit.

+
+ +
+
+enumerator PJ_COMP_EQUIVALENT_EXCEPT_AXIS_ORDER_GEOGCRS
+

Same as EQUIVALENT, relaxed with an exception that the axis order of the base CRS of a DerivedCRS/ProjectedCRS or the axis order of a GeographicCRS is ignored. Only to be used with DerivedCRS/ProjectedCRS/GeographicCRS

+
+ +
+ +
+
+enum PJ_WKT_TYPE
+

WKT version.

+

Values:

+
+
+enumerator PJ_WKT2_2015
+

cf osgeo::proj::io::WKTFormatter::Convention::WKT2

+
+ +
+
+enumerator PJ_WKT2_2015_SIMPLIFIED
+

cf osgeo::proj::io::WKTFormatter::Convention::WKT2_SIMPLIFIED

+
+ +
+
+enumerator PJ_WKT2_2019
+

cf osgeo::proj::io::WKTFormatter::Convention::WKT2_2019

+
+ +
+
+enumerator PJ_WKT2_2018
+

Deprecated alias for PJ_WKT2_2019

+
+ +
+
+enumerator PJ_WKT2_2019_SIMPLIFIED
+

cf osgeo::proj::io::WKTFormatter::Convention::WKT2_2019_SIMPLIFIED

+
+ +
+
+enumerator PJ_WKT2_2018_SIMPLIFIED
+

Deprecated alias for PJ_WKT2_2019

+
+ +
+
+enumerator PJ_WKT1_GDAL
+

cf osgeo::proj::io::WKTFormatter::Convention::WKT1_GDAL

+
+ +
+
+enumerator PJ_WKT1_ESRI
+

cf osgeo::proj::io::WKTFormatter::Convention::WKT1_ESRI

+
+ +
+ +
+
+enum PROJ_CRS_EXTENT_USE
+

Specify how source and target CRS extent should be used to restrict candidate operations (only taken into account if no explicit area of interest is specified.

+

Values:

+
+
+enumerator PJ_CRS_EXTENT_NONE
+

Ignore CRS extent

+
+ +
+
+enumerator PJ_CRS_EXTENT_BOTH
+

Test coordinate operation extent against both CRS extent.

+
+ +
+
+enumerator PJ_CRS_EXTENT_INTERSECTION
+

Test coordinate operation extent against the intersection of both CRS extent.

+
+ +
+
+enumerator PJ_CRS_EXTENT_SMALLEST
+

Test coordinate operation against the smallest of both CRS extent.

+
+ +
+ +
+
+enum PROJ_GRID_AVAILABILITY_USE
+

Describe how grid availability is used.

+

Values:

+
+
+enumerator PROJ_GRID_AVAILABILITY_USED_FOR_SORTING
+

Grid availability is only used for sorting results. Operations where some grids are missing will be sorted last.

+
+ +
+
+enumerator PROJ_GRID_AVAILABILITY_DISCARD_OPERATION_IF_MISSING_GRID
+

Completely discard an operation if a required grid is missing.

+
+ +
+
+enumerator PROJ_GRID_AVAILABILITY_IGNORED
+

Ignore grid availability at all. Results will be presented as if all grids were available.

+
+ +
+
+enumerator PROJ_GRID_AVAILABILITY_KNOWN_AVAILABLE
+

Results will be presented as if grids known to PROJ (that is registered in the grid_alternatives table of its database) were available. Used typically when networking is enabled.

+
+ +
+ +
+
+enum PJ_PROJ_STRING_TYPE
+

PROJ string version.

+

Values:

+
+
+enumerator PJ_PROJ_5
+

cf osgeo::proj::io::PROJStringFormatter::Convention::PROJ_5

+
+ +
+
+enumerator PJ_PROJ_4
+

cf osgeo::proj::io::PROJStringFormatter::Convention::PROJ_4

+
+ +
+ +
+
+enum PROJ_SPATIAL_CRITERION
+

Spatial criterion to restrict candidate operations.

+

Values:

+
+
+enumerator PROJ_SPATIAL_CRITERION_STRICT_CONTAINMENT
+

The area of validity of transforms should strictly contain the are of interest.

+
+ +
+
+enumerator PROJ_SPATIAL_CRITERION_PARTIAL_INTERSECTION
+

The area of validity of transforms should at least intersect the area of interest.

+
+ +
+ +
+
+enum PROJ_INTERMEDIATE_CRS_USE
+

Describe if and how intermediate CRS should be used

+

Values:

+
+
+enumerator PROJ_INTERMEDIATE_CRS_USE_ALWAYS
+

Always search for intermediate CRS.

+
+ +
+
+enumerator PROJ_INTERMEDIATE_CRS_USE_IF_NO_DIRECT_TRANSFORMATION
+

Only attempt looking for intermediate CRS if there is no direct transformation available.

+
+ +
+
+enumerator PROJ_INTERMEDIATE_CRS_USE_NEVER
+
+ +
+ +
+
+enum PJ_COORDINATE_SYSTEM_TYPE
+

Type of coordinate system.

+

Values:

+
+
+enumerator PJ_CS_TYPE_UNKNOWN
+
+ +
+
+enumerator PJ_CS_TYPE_CARTESIAN
+
+ +
+
+enumerator PJ_CS_TYPE_ELLIPSOIDAL
+
+ +
+
+enumerator PJ_CS_TYPE_VERTICAL
+
+ +
+
+enumerator PJ_CS_TYPE_SPHERICAL
+
+ +
+
+enumerator PJ_CS_TYPE_ORDINAL
+
+ +
+
+enumerator PJ_CS_TYPE_PARAMETRIC
+
+ +
+
+enumerator PJ_CS_TYPE_DATETIMETEMPORAL
+
+ +
+
+enumerator PJ_CS_TYPE_TEMPORALCOUNT
+
+ +
+
+enumerator PJ_CS_TYPE_TEMPORALMEASURE
+
+ +
+ +
+
+typedef char **PROJ_STRING_LIST
+

Type representing a NULL terminated list of NULL-terminate strings.

+
+ +
+
+struct PROJ_CRS_INFO
+
+#include <proj.h>
+

Structure given overall description of a CRS.

+

This structure may grow over time, and should not be directly allocated by client code.

+
+

Public Members

+
+
+char *auth_name
+

Authority name.

+
+ +
+
+char *code
+

Object code.

+
+ +
+
+char *name
+

Object name.

+
+ +
+
+PJ_TYPE type
+

Object type.

+
+ +
+
+int deprecated
+

Whether the object is deprecated

+
+ +
+
+int bbox_valid
+

Whereas the west_lon_degree, south_lat_degree, east_lon_degree and north_lat_degree fields are valid.

+
+ +
+
+double west_lon_degree
+

Western-most longitude of the area of use, in degrees.

+
+ +
+
+double south_lat_degree
+

Southern-most latitude of the area of use, in degrees.

+
+ +
+
+double east_lon_degree
+

Eastern-most longitude of the area of use, in degrees.

+
+ +
+
+double north_lat_degree
+

Northern-most latitude of the area of use, in degrees.

+
+ +
+
+char *area_name
+

Name of the area of use.

+
+ +
+
+char *projection_method_name
+

Name of the projection method for a projected CRS. Might be NULL even for projected CRS in some cases.

+
+ +
+
+char *celestial_body_name
+

Name of the celestial body of the CRS (e.g. “Earth”).

+
Since

8.1

+
+
+

+
+ +
+
+ +
+
+struct PROJ_CRS_LIST_PARAMETERS
+
+#include <proj.h>
+

Structure describing optional parameters for proj_get_crs_list();.

+

This structure may grow over time, and should not be directly allocated by client code.

+
+

Public Members

+
+
+const PJ_TYPE *types
+

Array of allowed object types. Should be NULL if all types are allowed

+
+ +
+
+size_t typesCount
+

Size of types. Should be 0 if all types are allowed

+
+ +
+
+int crs_area_of_use_contains_bbox
+

If TRUE and bbox_valid == TRUE, then only CRS whose area of use entirely contains the specified bounding box will be returned. If FALSE and bbox_valid == TRUE, then only CRS whose area of use intersects the specified bounding box will be returned.

+
+ +
+
+int bbox_valid
+

To set to TRUE so that west_lon_degree, south_lat_degree, east_lon_degree and north_lat_degree fields are taken into account.

+
+ +
+
+double west_lon_degree
+

Western-most longitude of the area of use, in degrees.

+
+ +
+
+double south_lat_degree
+

Southern-most latitude of the area of use, in degrees.

+
+ +
+
+double east_lon_degree
+

Eastern-most longitude of the area of use, in degrees.

+
+ +
+
+double north_lat_degree
+

Northern-most latitude of the area of use, in degrees.

+
+ +
+
+int allow_deprecated
+

Whether deprecated objects are allowed. Default to FALSE.

+
+ +
+
+const char *celestial_body_name
+

Celestial body of the CRS (e.g. “Earth”). The default value, NULL, means no restriction

+
Since

8.1

+
+
+

+
+ +
+
+ +
+
+struct PROJ_UNIT_INFO
+
+#include <proj.h>
+

Structure given description of a unit.

+

This structure may grow over time, and should not be directly allocated by client code.

+
Since

7.1

+
+
+

+
+

Public Members

+
+
+char *auth_name
+

Authority name.

+
+ +
+
+char *code
+

Object code.

+
+ +
+
+char *name
+

Object name. For example “metre”, “US survey foot”, etc.

+
+ +
+
+char *category
+

Category of the unit: one of “linear”, “linear_per_time”, “angular”, “angular_per_time”, “scale”, “scale_per_time” or “time”

+
+ +
+
+double conv_factor
+

Conversion factor to apply to transform from that unit to the corresponding SI unit (metre for “linear”, radian for “angular”, etc.). It might be 0 in some cases to indicate no known conversion factor.

+
+ +
+
+char *proj_short_name
+

PROJ short name, like “m”, “ft”, “us-ft”, etc… Might be NULL

+
+ +
+
+int deprecated
+

Whether the object is deprecated

+
+ +
+
+ +
+
+struct PROJ_CELESTIAL_BODY_INFO
+
+#include <proj.h>
+

Structure given description of a celestial body.

+

This structure may grow over time, and should not be directly allocated by client code.

+
Since

8.1

+
+
+

+
+

Public Members

+
+
+char *auth_name
+

Authority name.

+
+ +
+
+char *name
+

Object name. For example “Earth”

+
+ +
+
+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/development/reference/functions.html b/development/reference/functions.html new file mode 100644 index 00000000..737cc4ef --- /dev/null +++ b/development/reference/functions.html @@ -0,0 +1,3681 @@ + + + + + + + Functions — PROJ 9.0.0 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Functions

+
+

Threading contexts

+
+
+PJ_CONTEXT *proj_context_create(void)
+

Create a new threading-context.

+
+
Returns
+

a new context

+
+
+
+ +
+
+PJ_CONTEXT *proj_context_clone(PJ_CONTEXT *ctx)
+
+

New in version 7.2.

+
+

Create a new threading-context based on an existing context.

+
+
Returns
+

a new context

+
+
+
+ +
+
+void proj_context_destroy(PJ_CONTEXT *ctx)
+

Deallocate a threading-context.

+
+
Parameters
+
+
+
+
+ +
+
+

Transformation setup

+

The objects returned by the functions defined in this section have minimal +interaction with the functions of the +C API for ISO-19111 functionality, and vice versa. See its introduction +paragraph for more details.

+
+
+PJ *proj_create(PJ_CONTEXT *ctx, const char *definition)
+

Create a transformation object, or a CRS object, from:

+ +

Example call:

+
PJ *P = proj_create(0, "+proj=etmerc +lat_0=38 +lon_0=125 +ellps=bessel");
+
+
+

If a proj-string contains a +type=crs option, then it is interpreted as +a CRS definition. In particular geographic CRS are assumed to have axis +in the longitude, latitude order and with degree angular unit. The use +of proj-string to describe a CRS is discouraged. It is a legacy means of +conveying CRS descriptions: use of object codes (EPSG:XXXX typically) or +WKT description is recommended for better expressivity.

+

If a proj-string does not contain +type=crs, then it is interpreted as a +coordination operation / transformation.

+

If creation of the transformation object fails, the function returns 0 and +the PROJ error number is updated. The error number can be read with +proj_errno() or proj_context_errno().

+

The returned PJ-pointer should be deallocated with proj_destroy().

+
+
Parameters
+
    +
  • ctx (PJ_CONTEXT *) – Threading context.

  • +
  • definition (const char*) – Proj-string of the desired transformation.

  • +
+
+
+
+ +
+
+PJ *proj_create_argv(PJ_CONTEXT *ctx, int argc, char **argv)
+

Create a transformation object, or a CRS object, with argc/argv-style initialization. For this +application each parameter in the defining proj-string is an entry in argv.

+

Example call:

+
char *args[3] = {"proj=utm", "zone=32", "ellps=GRS80"};
+PJ* P = proj_create_argv(0, 3, args);
+
+
+

If there is a type=crs argument, then the arguments are interpreted as +a CRS definition. In particular geographic CRS are assumed to have axis +in the longitude, latitude order and with degree angular unit.

+

If there is no type=crs argument, then it is interpreted as a +coordination operation / transformation.

+

If creation of the transformation object fails, the function returns 0 and +the PROJ error number is updated. The error number can be read with +proj_errno() or proj_context_errno().

+

The returned PJ-pointer should be deallocated with proj_destroy().

+
+
Parameters
+
    +
  • ctx (PJ_CONTEXT *) – Threading context.

  • +
  • argc (int) – Count of arguments in argv

  • +
  • argv (char **) – Array of strings with proj-string parameters, e.g. +proj=merc

  • +
+
+
Returns
+

PJ *

+
+
+
+ +
+
+PJ *proj_create_crs_to_crs(PJ_CONTEXT *ctx, const char *source_crs, const char *target_crs, PJ_AREA *area)
+

Create a transformation object that is a pipeline between two known +coordinate reference systems.

+

source_crs and target_crs can be :

+
+
    +
  • a “AUTHORITY:CODE”, like EPSG:25832. When using that syntax for a source +CRS, the created pipeline will expect that the values passed to proj_trans() +respect the axis order and axis unit of the official definition ( +so for example, for EPSG:4326, with latitude first and longitude next, +in degrees). Similarly, when using that syntax for a target CRS, output +values will be emitted according to the official definition of this CRS.

  • +
  • a PROJ string, like “+proj=longlat +datum=WGS84”. +When using that syntax, the axis order and unit for geographic CRS will +be longitude, latitude, and the unit degrees.

  • +
  • the name of a CRS as found in the PROJ database, e.g “WGS84”, “NAD27”, etc.

  • +
  • more generally any string accepted by proj_create() representing +a CRS

  • +
+
+

An “area of use” can be specified in area. When it is supplied, the more +accurate transformation between two given systems can be chosen.

+

When no area of use is specific and several coordinate operations are possible +depending on the area of use, this function will internally store those +candidate coordinate operations in the return PJ object. Each subsequent +coordinate transformation done with proj_trans() will then select +the appropriate coordinate operation by comparing the input coordinates with +the area of use of the candidate coordinate operations.

+

Example call:

+
PJ *P = proj_create_crs_to_crs(0, "EPSG:25832", "EPSG:25833", 0);
+
+
+

If creation of the transformation object fails, the function returns 0 and +the PROJ error number is updated. The error number can be read with +proj_errno() or proj_context_errno().

+

The returned PJ-pointer should be deallocated with proj_destroy().

+
+
Parameters
+
    +
  • ctx (PJ_CONTEXT *) – Threading context.

  • +
  • source_crs (const char*) – Source CRS.

  • +
  • target_crs (const char*) – Destination SRS.

  • +
  • area (PJ_AREA *) – Descriptor of the desired area for the transformation.

  • +
+
+
Returns
+

PJ *

+
+
+
+ +
+
+PJ *proj_create_crs_to_crs_from_pj(PJ_CONTEXT *ctx, PJ *source_crs, PJ *target_crs, PJ_AREA *area, const char *const *options)
+
+

New in version 6.2.0.

+
+

Create a transformation object that is a pipeline between two known +coordinate reference systems.

+

This is the same as proj_create_crs_to_crs() except that the source and +target CRS are passed as PJ* objects which must be of the CRS variety.

+
+
Parameters
+
    +
  • options – a list of NUL terminated options, or NULL.

  • +
+
+
+

The list of supported options is:

+
    +
  • AUTHORITY=name: to restrict the authority of coordinate operations +looked up in the database. When not specified, coordinate +operations from any authority will be searched, with the restrictions set +in the authority_to_authority_preference database table related to the authority +of the source/target CRS themselves. +If authority is set to “any”, then coordinate operations from any authority will be searched +If authority is a non-empty string different of any, then coordinate operations +will be searched only in that authority namespace (e.g EPSG).

  • +
  • ACCURACY=value: to set the minimum desired accuracy (in metres) of the +candidate coordinate operations.

  • +
  • ALLOW_BALLPARK=YES/NO: can be set to NO to disallow the use of +Ballpark transformation in the candidate coordinate operations.

  • +
  • FORCE_OVER=YES/NO: can be set to YES to force the +over flag on the transformation +returned by this function.

  • +
+
+ +
+
+PJ *proj_normalize_for_visualization(PJ_CONTEXT *ctx, const PJ *obj)
+

Returns a PJ* object whose axis order is the one expected for visualization purposes.

+

The input object must be either:

    +
  • a coordinate operation, that has been created with proj_create_crs_to_crs(). If the axis order of its source or target CRS is northing,easting, then an axis swap operation will be inserted.

  • +
  • or a CRS. The axis order of geographic CRS will be longitude, latitude [,height], and the one of projected CRS will be easting, northing [, height]

  • +
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • obj – Object of type CRS, or CoordinateOperation created with proj_create_crs_to_crs() (must not be NULL)

  • +
+
+
Returns
+

a new PJ* object to free with proj_destroy() in case of success, or nullptr in case of error

+
+
+
+ +
+
+PJ *proj_destroy(PJ *P)
+

Deallocate a PJ transformation object.

+
+
Parameters
+
    +
  • P (const PJ *) – Transformation object

  • +
+
+
Returns
+

PJ *

+
+
+
+ +
+
+

Area of interest

+
+

New in version 6.0.0.

+
+
+
+PJ_AREA *proj_area_create(void)
+

Create an area of use.

+

Such an area of use is to be passed to proj_create_crs_to_crs() to +specify the area of use for the choice of relevant coordinate operations.

+
+
Returns
+

PJ_AREA * to be deallocated with proj_area_destroy()

+
+
+
+ +
+
+void proj_area_set_bbox(PJ_AREA *area, double west_lon_degree, double south_lat_degree, double east_lon_degree, double north_lat_degree)
+

Set the bounding box of the area of use

+

Such an area of use is to be passed to proj_create_crs_to_crs() to +specify the area of use for the choice of relevant coordinate operations.

+

In the case of an area of use crossing the antimeridian (longitude +/- 180 degrees), +west_lon_degree will be greater than east_lon_degree.

+
+
Parameters
+
    +
  • area – Pointer to an object returned by proj_area_create().

  • +
  • west_lon_degree – West longitude, in degrees. In [-180,180] range.

  • +
  • south_lat_degree – South latitude, in degrees. In [-90,90] range.

  • +
  • east_lon_degree – East longitude, in degrees. In [-180,180] range.

  • +
  • north_lat_degree – North latitude, in degrees. In [-90,90] range.

  • +
+
+
+
+ +
+
+void proj_area_destroy(PJ_AREA *area)
+

Deallocate a PJ_AREA object.

+

:param PJ_AREA* area

+
+ +
+
+

Coordinate transformation

+
+
+PJ_COORD proj_trans(PJ *P, PJ_DIRECTION direction, PJ_COORD coord)
+

Transform a single PJ_COORD coordinate.

+
+
Parameters
+
    +
  • P (PJ *) – Transformation object

  • +
  • direction (PJ_DIRECTION) – Transformation direction.

  • +
  • coord (PJ_COORD) – Coordinate that will be transformed.

  • +
+
+
Returns
+

PJ_COORD

+
+
+
+ +
+
+size_t proj_trans_generic(PJ *P, PJ_DIRECTION direction, double *x, size_t sx, size_t nx, double *y, size_t sy, size_t ny, double *z, size_t sz, size_t nz, double *t, size_t st, size_t nt)
+

Transform a series of coordinates, where the individual coordinate dimension +may be represented by an array that is either

+
+
    +
  1. fully populated

  2. +
  3. a null pointer and/or a length of zero, which will be treated as a +fully populated array of zeroes

  4. +
  5. of length one, i.e. a constant, which will be treated as a fully +populated array of that constant value

  6. +
+
+
+

Note

+

Even though the coordinate components are named x, y, +z and t, axis ordering of the to and from CRS +is respected. Transformations exhibit the same behavior +as if they were gathered in a PJ_COORD struct.

+
+

The strides, sx, sy, sz, st, +represent the step length, in bytes, between +consecutive elements of the corresponding array. This makes it possible for +proj_trans_generic() to handle transformation of a large class of application +specific data structures, without necessarily understanding the data structure +format, as in:

+
typedef struct {
+    double x, y;
+    int quality_level;
+    char surveyor_name[134];
+} XYQS;
+
+XYQS survey[345];
+double height = 23.45;
+size_t stride = sizeof (XYQS);
+
+...
+
+proj_trans_generic (
+    P, PJ_INV,
+    &(survey[0].x), stride, 345,  /*  We have 345 eastings  */
+    &(survey[0].y), stride, 345,  /*  ...and 345 northings. */
+    &height, sizeof(double), 1,   /*  The height is the constant  23.45 m */
+    0, 0, 0                       /*  and the time is the constant 0.00 s */
+);
+
+
+

This is similar to the inner workings of the deprecated pj_transform() +function, but the stride functionality has been generalized to work for any +size of basic unit, not just a fixed number of doubles.

+

In most cases, the stride will be identical for x, y, z, and t, since they will +typically be either individual arrays (stride = sizeof(double)), or strided +views into an array of application specific data structures (stride = sizeof (...)).

+

But in order to support cases where x, y, z, +and t come from heterogeneous sources, individual strides, +sx, sy, sz, st, are used.

+
+

Note

+

Since proj_trans_generic() does its work in place, +this means that even the supposedly constants (i.e. length 1 arrays) +will return from the call in altered state. Hence, remember to +reinitialize between repeated calls.

+
+
+
Parameters
+
    +
  • P (PJ *) – Transformation object

  • +
  • direction (PJ_DIRECTION) – Transformation direction.

  • +
  • x (double *) – Array of x-coordinates

  • +
  • sx (size_t) – Step length, in bytes, between consecutive elements of the corresponding array

  • +
  • nx (size_t) – Number of elements in the corresponding array

  • +
  • y (double *) – Array of y-coordinates

  • +
  • sy (size_t) – Step length, in bytes, between consecutive elements of the corresponding array

  • +
  • ny (size_t) – Number of elements in the corresponding array

  • +
  • z (double *) – Array of z-coordinates

  • +
  • sz (size_t) – Step length, in bytes, between consecutive elements of the corresponding array

  • +
  • nz (size_t) – Number of elements in the corresponding array

  • +
  • t (double *) – Array of t-coordinates

  • +
  • st (size_t) – Step length, in bytes, between consecutive elements of the corresponding array

  • +
  • nt (size_t) – Number of elements in the corresponding array

  • +
+
+
Returns
+

Number of transformations successfully completed

+
+
+
+ +
+
+int proj_trans_array(PJ *P, PJ_DIRECTION direction, size_t n, PJ_COORD *coord)
+

Batch transform an array of PJ_COORD.

+

Performs transformation on all points, even if errors occur on some points +(new to 8.0. Previous versions would exit early in case of failure on a given point)

+

Individual points that fail to transform will have their components set to +HUGE_VAL

+
+
Parameters
+
    +
  • P (PJ *) – Transformation object

  • +
  • direction (PJ_DIRECTION) – Transformation direction.

  • +
  • n (size_t) – Number of coordinates in coord

  • +
+
+
Returns
+

int 0 if all observations are transformed without error, otherwise returns error number. +This error number will be a precise error number if all coordinates that fail to transform +for the same reason, or a generic error code if they fail for different +reasons.

+
+
+
+ +
+
+int proj_trans_bounds(PJ_CONTEXT *context, PJ *P, PJ_DIRECTION direction, double xmin, double ymin, double xmax, double ymax, double *out_xmin, double *out_ymin, double *out_xmax, double *out_ymax, int densify_pts)
+

Transform boundary,.

+

Transform boundary densifying the edges to account for nonlinear transformations along these edges and extracting the outermost bounds.

+

If the destination CRS is geographic, the first axis is longitude, and xmax < xmin then the bounds crossed the antimeridian. In this scenario there are two polygons, one on each side of the antimeridian. The first polygon should be constructed with (xmin, ymin, 180, ymax) and the second with (-180, ymin, xmax, ymax).

+

If the destination CRS is geographic, the first axis is latitude, and ymax < ymin then the bounds crossed the antimeridian. In this scenario there are two polygons, one on each side of the antimeridian. The first polygon should be constructed with (ymin, xmin, ymax, 180) and the second with (ymin, -180, ymax, xmax).

+

+
Since

8.2

+
+
+

+
+
Parameters
+
    +
  • context – The PJ_CONTEXT object.

  • +
  • P – The PJ object representing the transformation.

  • +
  • direction – The direction of the transformation.

  • +
  • xmin – Minimum bounding coordinate of the first axis in source CRS (target CRS if direction is inverse).

  • +
  • ymin – Minimum bounding coordinate of the second axis in source CRS. (target CRS if direction is inverse).

  • +
  • xmax – Maximum bounding coordinate of the first axis in source CRS. (target CRS if direction is inverse).

  • +
  • ymax – Maximum bounding coordinate of the second axis in source CRS. (target CRS if direction is inverse).

  • +
  • out_xmin – Minimum bounding coordinate of the first axis in target CRS (source CRS if direction is inverse).

  • +
  • out_ymin – Minimum bounding coordinate of the second axis in target CRS. (source CRS if direction is inverse).

  • +
  • out_xmax – Maximum bounding coordinate of the first axis in target CRS. (source CRS if direction is inverse).

  • +
  • out_ymax – Maximum bounding coordinate of the second axis in target CRS. (source CRS if direction is inverse).

  • +
  • densify_pts – Recommended to use 21. This is the number of points to use to densify the bounding polygon in the transformation.

  • +
+
+
Returns
+

an integer. 1 if successful. 0 if failures encountered.

+
+
+
+ +
+
+

Error reporting

+
+
+int proj_errno(PJ *P)
+

Get a reading of the current error-state of P. An non-zero error +codes indicates an error either with the transformation setup or during a +transformation. In cases P is 0 the error number of the default +context is read. A text representation of the error number can be retrieved +with proj_errno_string().

+

Consult Error codes for the list of error codes (PROJ >= 8.0)

+
+
Parameters
+
    +
  • P (PJ *) – Transformation object

  • +
+
+
Returns
+

int

+
+
+
+ +
+
+int proj_context_errno(PJ_CONTEXT *ctx)
+

Get a reading of the current error-state of ctx. An non-zero error +codes indicates an error either with the transformation setup or during a +transformation. A text representation of the error number can be retrieved +with proj_errno_string().

+

Consult Error codes for the list of error codes (PROJ >= 8.0)

+
+
Parameters
+
+
+
Returns
+

int

+
+
+
+ +
+
+void proj_errno_set(PJ *P, int err)
+

Change the error-state of P to err.

+
+
Parameters
+
    +
  • P (PJ *) – Transformation object

  • +
  • err (int) – Error number.

  • +
+
+
+
+ +
+
+int proj_errno_reset(PJ *P)
+

Clears the error number in P, and bubbles it up to the context.

+

Example:

+
void foo (PJ *P) {
+    int last_errno = proj_errno_reset (P);
+
+    do_something_with_P (P);
+
+    /* failure - keep latest error status */
+    if (proj_errno(P))
+        return;
+    /* success - restore previous error status */
+    proj_errno_restore (P, last_errno);
+    return;
+}
+
+
+
+
Parameters
+
    +
  • P (PJ *) – Transformation object

  • +
+
+
Returns
+

int Returns the previous value of the errno, for convenient reset/restore operations.

+
+
+
+ +
+
+void proj_errno_restore(PJ *P, int err)
+

Reduce some mental impedance in the canonical reset/restore use case: +Basically, proj_errno_restore() is a synonym for +proj_errno_set(), but the use cases are very different: +set indicate an error to higher level user code, restore passes previously +set error indicators in case of no errors at this level.

+

Hence, although the inner working is identical, we provide both options, +to avoid some rather confusing real world code.

+

See usage example under proj_errno_reset()

+
+
Parameters
+
    +
  • P (PJ *) – Transformation object

  • +
  • err (int) – Error number.

  • +
+
+
+
+ +
+
+const char *proj_errno_string(int err)
+
+

New in version 5.1.0.

+
+

Get a text representation of an error number.

+
+

Deprecated since version This: function is potentially thread-unsafe, replaced by proj_context_errno_string().

+
+
+
Parameters
+
    +
  • err (int) – Error number.

  • +
+
+
Returns
+

const char* String with description of error.

+
+
+
+ +
+
+const char *proj_context_errno_string(PJ_CONTEXT *ctx, int err)
+
+

New in version 8.0.0.

+
+

Get a text representation of an error number.

+
+
Parameters
+
    +
  • ctx (PJ_CONTEXT *) – threading context.

  • +
  • err (int) – Error number.

  • +
+
+
Returns
+

const char* String with description of error.

+
+
+
+ +
+
+

Logging

+
+
+PJ_LOG_LEVEL proj_log_level(PJ_CONTEXT *ctx, PJ_LOG_LEVEL level)
+

Get and set logging level for a given context. Changes the log level to +level and returns the previous logging level. If called with +level set to PJ_LOG_TELL the function returns the current +logging level without changing it.

+
+
Parameters
+
+
+
Returns
+

PJ_LOG_LEVEL

+
+
+
+

New in version 5.1.0.

+
+
+ +
+
+void proj_log_func(PJ_CONTEXT *ctx, void *app_data, PJ_LOG_FUNCTION logf)
+

Override the internal log function of PROJ.

+
+
Parameters
+
    +
  • ctx (PJ_CONTEXT *) – Threading context.

  • +
  • app_data (void *) – Pointer to data structure used by the calling application.

  • +
  • logf (PJ_LOG_FUNCTION) – Log function that overrides the PROJ log function.

  • +
+
+
+
+

New in version 5.1.0.

+
+
+ +
+
+

Info functions

+
+
+PJ_INFO proj_info(void)
+

Get information about the current instance of the PROJ library.

+
+
Returns
+

PJ_INFO

+
+
+
+ +
+
+PJ_PROJ_INFO proj_pj_info(const PJ *P)
+

Get information about a specific transformation object, P.

+
+
Parameters
+
    +
  • P (const PJ *) – Transformation object

  • +
+
+
Returns
+

PJ_PROJ_INFO

+
+
+
+ +
+
+PJ_GRID_INFO proj_grid_info(const char *gridname)
+

Get information about a specific grid.

+
+
Parameters
+
    +
  • gridname (const char*) – Gridname in the PROJ searchpath

  • +
+
+
Returns
+

PJ_GRID_INFO

+
+
+
+ +
+
+PJ_INIT_INFO proj_init_info(const char *initname)
+

Get information about a specific init file.

+
+
Parameters
+
    +
  • initname (const char*) – Init file in the PROJ searchpath

  • +
+
+
Returns
+

PJ_INIT_INFO

+
+
+
+ +
+
+

Lists

+
+
+const PJ_OPERATIONS *proj_list_operations(void)
+

Get a pointer to an array of all operations in PROJ. The last entry +of the returned array is a NULL-entry. The array is statically allocated +and does not need to be freed after use.

+

Print a list of all operations in PROJ:

+
PJ_OPERATIONS *ops;
+for (ops = proj_list_operations(); ops->id; ++ops)
+    printf("%s\n", ops->id);
+
+
+
+
Returns
+

const PJ_OPERATIONS *

+
+
+
+ +
+
+const PJ_ELLPS *proj_list_ellps(void)
+

Get a pointer to an array of ellipsoids defined in PROJ. The last entry +of the returned array is a NULL-entry. The array is statically allocated +and does not need to be freed after use.

+
+
Returns
+

const PJ_ELLPS *

+
+
+
+ +
+
+const PJ_UNITS *proj_list_units(void)
+

Get a pointer to an array of distance units defined in PROJ. The last +entry of the returned array is a NULL-entry. The array is statically +allocated and does not need to be freed after use.

+

Note: starting with PROJ 7.1, this function is deprecated by +proj_get_units_from_database()

+
+
Returns
+

const PJ_UNITS *

+
+
+
+ +
+
+const PJ_PRIME_MERIDIANS *proj_list_prime_meridians(void)
+

Get a pointer to an array of prime meridians defined in PROJ. The last +entry of the returned array is a NULL-entry. The array is statically +allocated and does not need to be freed after use.

+
+
Returns
+

const PJ_PRIME_MERIDIANS *

+
+
+
+ +
+
+

Distances

+
+
+double proj_lp_dist(const PJ *P, PJ_COORD a, PJ_COORD b)
+

Calculate geodesic distance between two points in geodetic coordinates. The +calculated distance is between the two points located on the ellipsoid.

+

The coordinates in a and b needs to be given as longitude +and latitude in radians. Note that the axis order of the P object +is not taken into account in this function, so even though a CRS object comes +with axis ordering latitude/longitude coordinates used in this function should +be reordered as longitude/latitude.

+
+
Parameters
+
    +
  • P (const PJ *) – Transformation or CRS object

  • +
  • a (PJ_COORD) – Coordinate of first point

  • +
  • b (PJ_COORD) – Coordinate of second point

  • +
+
+
Returns
+

double Distance between a and b in meters.

+
+
+
+ +
+
+double proj_lpz_dist(const PJ *P, PJ_COORD a, PJ_COORD b)
+

Calculate geodesic distance between two points in geodetic coordinates. +Similar to proj_lp_dist() but also takes the height above the ellipsoid +into account.

+

The coordinates in a and b needs to be given as longitude +and latitude in radians. Note that the axis order of the P object +is not taken into account in this function, so even though a CRS object comes +with axis ordering latitude/longitude coordinates used in this function should +be reordered as longitude/latitude.

+
+
Parameters
+
    +
  • P (const PJ *) – Transformation or CRS object

  • +
  • a (PJ_COORD) – Coordinate of first point

  • +
  • b (PJ_COORD) – Coordinate of second point

  • +
+
+
Returns
+

double Distance between a and b in meters.

+
+
+
+ +
+
+double proj_xy_dist(PJ_COORD a, PJ_COORD b)
+

Calculate 2-dimensional euclidean between two projected coordinates.

+
+
Parameters
+
+
+
Returns
+

double Distance between a and b in meters.

+
+
+
+ +
+
+double proj_xyz_dist(PJ_COORD a, PJ_COORD b)
+

Calculate 3-dimensional euclidean between two projected coordinates.

+
+
Parameters
+
+
+
Returns
+

double Distance between a and b in meters.

+
+
+
+ +
+
+PJ_COORD proj_geod(const PJ *P, PJ_COORD a, PJ_COORD b)
+

Calculate the geodesic distance as well as forward and reverse azimuth +between two points on the ellipsoid.

+

The coordinates in a and b needs to be given as longitude +and latitude in radians. Note that the axis order of the P object +is not taken into account in this function, so even though a CRS object comes +with axis ordering latitude/longitude coordinates used in this function should +be reordered as longitude/latitude.

+
+
Parameters
+
    +
  • P (const PJ *) – Transformation or CRS object

  • +
  • a (PJ_COORD) – Coordinate of first point

  • +
  • b (PJ_COORD) – Coordinate of second point

  • +
+
+
Returns
+

PJ_COORD where the first value is the distance between a +and b in meters, the second value is the forward azimuth +and the third value is the reverse azimuth. The fourth coordinate +value is unused.

+
+
+
+ +
+
+

Various

+
+
+PJ_COORD proj_coord(double x, double y, double z, double t)
+

Initializer for the PJ_COORD union. The function is +shorthand for the otherwise convoluted assignment. +Equivalent to

+
PJ_COORD c = {{10.0, 20.0, 30.0, 40.0}};
+
+
+

or

+
PJ_COORD c;
+// Assign using the PJ_XYZT struct in the union
+c.xyzt.x = 10.0;
+c.xyzt.y = 20.0;
+c.xyzt.z = 30.0;
+c.xyzt.t = 40.0;
+
+
+

Since PJ_COORD is a union of structs, the above assignment can +also be expressed in terms of the other types in the union, e.g. +PJ_UVWT or PJ_LPZT.

+
+
Parameters
+
    +
  • x (double) – 1st component in a PJ_COORD

  • +
  • y (double) – 2nd component in a PJ_COORD

  • +
  • z (double) – 3rd component in a PJ_COORD

  • +
  • t (double) – 4th component in a PJ_COORD

  • +
+
+
Returns
+

PJ_COORD

+
+
+
+ +
+
+double proj_roundtrip(PJ *P, PJ_DIRECTION direction, int n, PJ_COORD *coord)
+

Measure internal consistency of a given transformation. The function +performs n round trip transformations starting in either +the forward or reverse direction. Returns the euclidean +distance of the starting point coo and the resulting +coordinate after n iterations back and forth.

+
+
Parameters
+
    +
  • P (PJ *) – Transformation object

  • +
  • direction (PJ_DIRECTION) – Starting direction of transformation

  • +
  • n (int) – Number of roundtrip transformations

  • +
  • coord (PJ_COORD *) – Input coordinate

  • +
+
+
Returns
+

double Distance between original coordinate and the resulting coordinate after n transformation iterations.

+
+
+
+ +
+
+PJ_FACTORS proj_factors(PJ *P, PJ_COORD lp)
+

Calculate various cartographic properties, such as scale factors, angular +distortion and meridian convergence. Depending on the underlying projection +values will be calculated either numerically (default) or analytically.

+

Starting with PROJ 8.2, the P object can be a projected CRS, for example +instantiated from a EPSG CRS code. The factors computed will be those of the +map projection implied by the transformation from the base geographic CRS of +the projected CRS to the projected CRS.

+

The input geodetic coordinate lp should be such that lp.lam is the longitude +in radian, and lp.phi the latitude in radian (thus independently of the +definition of the base CRS, if P is a projected CRS).

+

The function also calculates the partial derivatives of the given +coordinate.

+
+
Parameters
+
    +
  • P (PJ *) – Transformation object

  • +
  • lp (PJ_COORD) – Geodetic coordinate

  • +
+
+
Returns
+

PJ_FACTORS

+
+
+
+ +
+
+double proj_torad(double angle_in_degrees)
+

Convert degrees to radians.

+
+
Parameters
+
    +
  • angle_in_degrees (double) – Degrees

  • +
+
+
Returns
+

double Radians

+
+
+
+ +
+
+double proj_todeg(double angle_in_radians)
+

Convert radians to degrees

+
+
Parameters
+
    +
  • angle_in_radians (double) – Radians

  • +
+
+
Returns
+

double Degrees

+
+
+
+ +
+
+double proj_dmstor(const char *is, char **rs)
+

Convert string of degrees, minutes and seconds to radians. +Works similarly to the C standard library function strtod().

+
+
Parameters
+
    +
  • is (const char*) – Value to be converted to radians

  • +
  • rs – Reference to an already allocated char*, whose value is set by the function to the next character in is after the numerical value.

  • +
+
+
+
+ +
+
+char *proj_rtodms(char *s, double r, int pos, int neg)
+

Convert radians to string representation of degrees, minutes and seconds.

+
+
Parameters
+
    +
  • s (char *) – Buffer that holds the output string

  • +
  • r (double) – Value to convert to dms-representation

  • +
  • pos (int) – Character denoting positive direction, typically ‘N’ or ‘E’.

  • +
  • neg (int) – Character denoting negative direction, typically ‘S’ or ‘W’.

  • +
+
+
Returns
+

char* Pointer to output buffer (same as s)

+
+
+
+ +
+
+int proj_angular_input(PJ *P, enum PJ_DIRECTION dir)
+

Check if an operation expects input in radians or not.

+
+
Parameters
+
    +
  • P (PJ *) – Transformation object

  • +
  • direction (PJ_DIRECTION) – Starting direction of transformation

  • +
+
+
Returns
+

int 1 if input units is expected in radians, otherwise 0

+
+
+
+ +
+
+int proj_angular_output(PJ *P, enum PJ_DIRECTION dir)
+

Check if an operation returns output in radians or not.

+
+
Parameters
+
    +
  • P (PJ *) – Transformation object

  • +
  • direction (PJ_DIRECTION) – Starting direction of transformation

  • +
+
+
Returns
+

int 1 if output units is expected in radians, otherwise 0

+
+
+
+ +
+
+int proj_degree_input(PJ *P, enum PJ_DIRECTION dir)
+
+

New in version 7.1.0.

+
+

Check if an operation expects input in degrees or not.

+
+
Parameters
+
    +
  • P (PJ *) – Transformation object

  • +
  • direction (PJ_DIRECTION) – Starting direction of transformation

  • +
+
+
Returns
+

int 1 if input units is expected in degrees, otherwise 0

+
+
+
+ +
+
+int proj_degree_output(PJ *P, enum PJ_DIRECTION dir)
+
+

New in version 7.1.0.

+
+

Check if an operation returns output in degrees or not.

+
+
Parameters
+
    +
  • P (PJ *) – Transformation object

  • +
  • direction (PJ_DIRECTION) – Starting direction of transformation

  • +
+
+
Returns
+

int 1 if output units is expected in degrees, otherwise 0

+
+
+
+ +
+
+

Setting custom I/O functions

+
+

New in version 7.0.0.

+
+
+
+int proj_context_set_fileapi(PJ_CONTEXT *ctx, const PROJ_FILE_API *fileapi, void *user_data)
+

Set a file API

+

All callbacks should be provided (non NULL pointers). If read-only usage is intended, then the callbacks might have a dummy implementation.

+

+
Since

7.0

+
+
+

+
+

Note

+

Those callbacks will not be used for SQLite3 database access. If custom I/O is desired for that, then proj_context_set_sqlite3_vfs_name() should be used.

+
+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL

  • +
  • fileapi – Pointer to file API structure (content will be copied).

  • +
  • user_data – Arbitrary pointer provided by the user, and passed to the above callbacks. May be NULL.

  • +
+
+
Returns
+

TRUE in case of success.

+
+
+
+ +
+
+void proj_context_set_sqlite3_vfs_name(PJ_CONTEXT *ctx, const char *name)
+

Set the name of a custom SQLite3 VFS.

+

This should be a valid SQLite3 VFS name, such as the one passed to the sqlite3_vfs_register(). See https://www.sqlite.org/vfs.html

+

It will be used to read proj.db or create&access the cache.db file in the PROJ user writable directory.

+

+
Since

7.0

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL

  • +
  • name – SQLite3 VFS name. If NULL is passed, default implementation by SQLite will be used.

  • +
+
+
+
+ +
+
+void proj_context_set_file_finder(PJ_CONTEXT *ctx, proj_file_finder finder, void *user_data)
+

Assign a file finder callback to a context.

+

This callback will be used whenever PROJ must open one of its resource files (proj.db database, grids, etc…)

+

The callback will be called with the context currently in use at the moment where it is used (not necessarily the one provided during this call), and with the provided user_data (which may be NULL). The user_data must remain valid during the whole lifetime of the context.

+

A finder set on the default context will be inherited by contexts created later.

+

+
Since

PROJ 6.0

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for the default context.

  • +
  • finder – Finder callback. May be NULL

  • +
  • user_data – User data provided to the finder callback. May be NULL.

  • +
+
+
+
+ +
+
+void proj_context_set_search_paths(PJ_CONTEXT *ctx, int count_paths, const char *const *paths)
+

Sets search paths.

+

Those search paths will be used whenever PROJ must open one of its resource files (proj.db database, grids, etc…)

+

If set on the default context, they will be inherited by contexts created later.

+

Starting with PROJ 7.0, the path(s) should be encoded in UTF-8.

+

+
Since

PROJ 6.0

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for the default context.

  • +
  • count_paths – Number of paths. 0 if paths == NULL.

  • +
  • paths – Paths. May be NULL.

  • +
+
+
+
+ +
+
+void proj_context_set_ca_bundle_path(PJ_CONTEXT *ctx, const char *path)
+

Sets CA Bundle path.

+

Those CA Bundle path will be used by PROJ when curl and PROJ_NETWORK are enabled.

+

If set on the default context, they will be inherited by contexts created later.

+

The path should be encoded in UTF-8.

+

+
Since

PROJ 7.2

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for the default context.

  • +
  • path – Path. May be NULL.

  • +
+
+
+
+ +
+ +
+

Cleanup

+
+
+void proj_cleanup()
+
+

New in version 6.2.0.

+
+

This function frees global resources (grids, cache of +init files). It +should be called typically before process termination, and after having +freed PJ and PJ_CONTEXT objects.

+
+ +
+
+

C API for ISO-19111 functionality

+
+

New in version 6.0.0.

+
+

The PJ* objects returned by proj_create_from_wkt(), +proj_create_from_database() and other functions in that section +will have generally minimal interaction with the functions declared in the +previous sections (calling those functions on those objects +will either return an error or default/nonsensical values). The exception is +for ISO19111 objects of type CoordinateOperation that can be exported as a +valid PROJ pipeline. In this case, objects will work for example with +proj_trans_generic(). +Conversely, objects returned by proj_create() and proj_create_argv(), +which are not of type CRS (can be tested with proj_is_crs()), +will return an error when used with functions of this section.

+
+
+void proj_string_list_destroy(PROJ_STRING_LIST list)
+

Free a list of NULL terminated strings.

+
+ +
+
+void proj_context_set_autoclose_database(PJ_CONTEXT *ctx, int autoclose)
+

Starting with PROJ 8.1, this function does nothing.

+

If you want to take into account changes to the PROJ database, you need to re-create a new context.

+

+
+Deprecated:
+

Since 8.1

+
+ +
+
Since

6.2

+
+
+

+
+
Parameters
+
    +
  • ctx – Ignored

  • +
  • autoclose – Ignored

  • +
+
+
+
+ +
+
+int proj_context_set_database_path(PJ_CONTEXT *ctx, const char *dbPath, const char *const *auxDbPaths, const char *const *options)
+

Explicitly point to the main PROJ CRS and coordinate operation definition database (“proj.db”), and potentially auxiliary databases with same structure.

+

Starting with PROJ 8.1, if the auxDbPaths parameter is an empty array, the PROJ_AUX_DB environment variable will be used, if set. It must contain one or several paths. If several paths are provided, they must be separated by the colon (:) character on Unix, and on Windows, by the semi-colon (;) character.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • dbPath – Path to main database, or NULL for default.

  • +
  • auxDbPaths – NULL-terminated list of auxiliary database filenames, or NULL.

  • +
  • options – should be set to NULL for now

  • +
+
+
Returns
+

TRUE in case of success

+
+
+
+ +
+
+const char *proj_context_get_database_path(PJ_CONTEXT *ctx)
+

Returns the path to the database.

+

The returned pointer remains valid while ctx is valid, and until proj_context_set_database_path() is called.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
+
+
Returns
+

path, or nullptr

+
+
+
+ +
+
+const char *proj_context_get_database_metadata(PJ_CONTEXT *ctx, const char *key)
+

Return a metadata from the database.

+

The returned pointer remains valid while ctx is valid, and until proj_context_get_database_metadata() is called.

+

Available keys:

+

    +
  • DATABASE.LAYOUT.VERSION.MAJOR

  • +
  • DATABASE.LAYOUT.VERSION.MINOR

  • +
  • EPSG.VERSION

  • +
  • EPSG.DATE

  • +
  • ESRI.VERSION

  • +
  • ESRI.DATE

  • +
  • IGNF.SOURCE

  • +
  • IGNF.VERSION

  • +
  • IGNF.DATE

  • +
  • NKG.SOURCE

  • +
  • NKG.VERSION

  • +
  • NKG.DATE

  • +
  • PROJ.VERSION

  • +
  • PROJ_DATA.VERSION : PROJ-data version most compatible with this database.

  • +
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • key – Metadata key. Must not be NULL

  • +
+
+
Returns
+

value, or nullptr

+
+
+
+ +
+
+PROJ_STRING_LIST proj_context_get_database_structure(PJ_CONTEXT *ctx, const char *const *options)
+

Return the database structure.

+

Return SQL statements to run to initiate a new valid auxiliary empty database. It contains definitions of tables, views and triggers, as well as metadata for the version of the layout of the database.

+

+
Since

8.1

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • options – null-terminated list of options, or NULL. None currently.

  • +
+
+
Returns
+

list of SQL statements (to be freed with proj_string_list_destroy()), or NULL in case of error.

+
+
+
+ +
+
+PJ_GUESSED_WKT_DIALECT proj_context_guess_wkt_dialect(PJ_CONTEXT *ctx, const char *wkt)
+

Guess the “dialect” of the WKT string.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • wkt – String (must not be NULL)

  • +
+
+
+
+ +
+
+PJ *proj_create_from_wkt(PJ_CONTEXT *ctx, const char *wkt, const char *const *options, PROJ_STRING_LIST *out_warnings, PROJ_STRING_LIST *out_grammar_errors)
+

Instantiate an object from a WKT string.

+

This function calls osgeo::proj::io::WKTParser::createFromWKT()

+

The returned object must be unreferenced with proj_destroy() after use. It should be used by at most one thread at a time.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • wkt – WKT string (must not be NULL)

  • +
  • options – null-terminated list of options, or NULL. Currently supported options are:

      +
    • STRICT=YES/NO. Defaults to NO. When set to YES, strict validation will be enabled.

    • +
    +

  • +
  • out_warnings – Pointer to a PROJ_STRING_LIST object, or NULL. If provided, *out_warnings will contain a list of warnings, typically for non recognized projection method or parameters. It must be freed with proj_string_list_destroy().

  • +
  • out_grammar_errors – Pointer to a PROJ_STRING_LIST object, or NULL. If provided, *out_grammar_errors will contain a list of errors regarding the WKT grammar. It must be freed with proj_string_list_destroy().

  • +
+
+
Returns
+

Object that must be unreferenced with proj_destroy(), or NULL in case of error.

+
+
+
+ +
+
+PJ *proj_create_from_database(PJ_CONTEXT *ctx, const char *auth_name, const char *code, PJ_CATEGORY category, int usePROJAlternativeGridNames, const char *const *options)
+

Instantiate an object from a database lookup.

+

The returned object must be unreferenced with proj_destroy() after use. It should be used by at most one thread at a time.

+
+
Parameters
+
    +
  • ctx – Context, or NULL for default context.

  • +
  • auth_name – Authority name (must not be NULL)

  • +
  • code – Object code (must not be NULL)

  • +
  • category – Object category

  • +
  • usePROJAlternativeGridNames – Whether PROJ alternative grid names should be substituted to the official grid names. Only used on transformations

  • +
  • options – should be set to NULL for now

  • +
+
+
Returns
+

Object that must be unreferenced with proj_destroy(), or NULL in case of error.

+
+
+
+ +
+
+int proj_uom_get_info_from_database(PJ_CONTEXT *ctx, const char *auth_name, const char *code, const char **out_name, double *out_conv_factor, const char **out_category)
+

Get information for a unit of measure from a database lookup.

+
+
Parameters
+
    +
  • ctx – Context, or NULL for default context.

  • +
  • auth_name – Authority name (must not be NULL)

  • +
  • code – Unit of measure code (must not be NULL)

  • +
  • out_name – Pointer to a string value to store the parameter name. or NULL. This value remains valid until the next call to proj_uom_get_info_from_database() or the context destruction.

  • +
  • out_conv_factor – Pointer to a value to store the conversion factor of the prime meridian longitude unit to radian. or NULL

  • +
  • out_category – Pointer to a string value to store the parameter name. or NULL. This value might be “unknown”, “none”, “linear”, “linear_per_time”, “angular”, “angular_per_time”, “scale”, “scale_per_time”, “time”, “parametric” or “parametric_per_time”

  • +
+
+
Returns
+

TRUE in case of success

+
+
+
+ +
+
+int proj_grid_get_info_from_database(PJ_CONTEXT *ctx, const char *grid_name, const char **out_full_name, const char **out_package_name, const char **out_url, int *out_direct_download, int *out_open_license, int *out_available)
+

Get information for a grid from a database lookup.

+
+
Parameters
+
    +
  • ctx – Context, or NULL for default context.

  • +
  • grid_name – Grid name (must not be NULL)

  • +
  • out_full_name – Pointer to a string value to store the grid full filename. or NULL

  • +
  • out_package_name – Pointer to a string value to store the package name where the grid might be found. or NULL

  • +
  • out_url – Pointer to a string value to store the grid URL or the package URL where the grid might be found. or NULL

  • +
  • out_direct_download – Pointer to a int (boolean) value to store whether *out_url can be downloaded directly. or NULL

  • +
  • out_open_license – Pointer to a int (boolean) value to store whether the grid is released with an open license. or NULL

  • +
  • out_available – Pointer to a int (boolean) value to store whether the grid is available at runtime. or NULL

  • +
+
+
Returns
+

TRUE in case of success.

+
+
+
+ +
+
+PJ *proj_clone(PJ_CONTEXT *ctx, const PJ *obj)
+

“Clone” an object.

+

The object might be used independently of the original object, provided that the use of context is compatible. In particular if you intend to use a clone in a different thread than the original object, you should pass a context that is different from the one of the original object (or later assign a different context with proj_assign_context()).

+

The returned object must be unreferenced with proj_destroy() after use. It should be used by at most one thread at a time.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • obj – Object to clone. Must not be NULL.

  • +
+
+
Returns
+

Object that must be unreferenced with proj_destroy(), or NULL in case of error.

+
+
+
+ +
+
+PJ_OBJ_LIST *proj_create_from_name(PJ_CONTEXT *ctx, const char *auth_name, const char *searchedName, const PJ_TYPE *types, size_t typesCount, int approximateMatch, size_t limitResultCount, const char *const *options)
+

Return a list of objects by their name.

+
+
Parameters
+
    +
  • ctx – Context, or NULL for default context.

  • +
  • auth_name – Authority name, used to restrict the search. Or NULL for all authorities.

  • +
  • searchedName – Searched name. Must be at least 2 character long.

  • +
  • types – List of object types into which to search. If NULL, all object types will be searched.

  • +
  • typesCount – Number of elements in types, or 0 if types is NULL

  • +
  • approximateMatch – Whether approximate name identification is allowed.

  • +
  • limitResultCount – Maximum number of results to return. Or 0 for unlimited.

  • +
  • options – should be set to NULL for now

  • +
+
+
Returns
+

a result set that must be unreferenced with proj_list_destroy(), or NULL in case of error.

+
+
+
+ +
+
+PJ_TYPE proj_get_type(const PJ *obj)
+

Return the type of an object.

+
+
Parameters
+
    +
  • obj – Object (must not be NULL)

  • +
+
+
Returns
+

its type.

+
+
+
+ +
+
+int proj_is_deprecated(const PJ *obj)
+

Return whether an object is deprecated.

+
+
Parameters
+
    +
  • obj – Object (must not be NULL)

  • +
+
+
Returns
+

TRUE if it is deprecated, FALSE otherwise

+
+
+
+ +
+
+PJ_OBJ_LIST *proj_get_non_deprecated(PJ_CONTEXT *ctx, const PJ *obj)
+

Return a list of non-deprecated objects related to the passed one.

+
+
Parameters
+
    +
  • ctx – Context, or NULL for default context.

  • +
  • obj – Object (of type CRS for now) for which non-deprecated objects must be searched. Must not be NULL

  • +
+
+
Returns
+

a result set that must be unreferenced with proj_list_destroy(), or NULL in case of error.

+
+
+
+ +
+
+int proj_is_equivalent_to(const PJ *obj, const PJ *other, PJ_COMPARISON_CRITERION criterion)
+

Return whether two objects are equivalent.

+

Use proj_is_equivalent_to_with_ctx() to be able to use database information.

+
+
Parameters
+
    +
  • obj – Object (must not be NULL)

  • +
  • other – Other object (must not be NULL)

  • +
  • criterion – Comparison criterion

  • +
+
+
Returns
+

TRUE if they are equivalent

+
+
+
+ +
+
+int proj_is_equivalent_to_with_ctx(PJ_CONTEXT *ctx, const PJ *obj, const PJ *other, PJ_COMPARISON_CRITERION criterion)
+

Return whether two objects are equivalent.

+

Possibly using database to check for name aliases.

+

+
Since

6.3

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • obj – Object (must not be NULL)

  • +
  • other – Other object (must not be NULL)

  • +
  • criterion – Comparison criterion

  • +
+
+
Returns
+

TRUE if they are equivalent

+
+
+
+ +
+
+int proj_is_crs(const PJ *obj)
+

Return whether an object is a CRS.

+
+
Parameters
+
    +
  • obj – Object (must not be NULL)

  • +
+
+
+
+ +
+
+const char *proj_get_name(const PJ *obj)
+

Get the name of an object.

+

The lifetime of the returned string is the same as the input obj parameter.

+
+
Parameters
+
    +
  • obj – Object (must not be NULL)

  • +
+
+
Returns
+

a string, or NULL in case of error or missing name.

+
+
+
+ +
+
+const char *proj_get_id_auth_name(const PJ *obj, int index)
+

Get the authority name / codespace of an identifier of an object.

+

The lifetime of the returned string is the same as the input obj parameter.

+
+
Parameters
+
    +
  • obj – Object (must not be NULL)

  • +
  • index – Index of the identifier. 0 = first identifier

  • +
+
+
Returns
+

a string, or NULL in case of error or missing name.

+
+
+
+ +
+
+const char *proj_get_id_code(const PJ *obj, int index)
+

Get the code of an identifier of an object.

+

The lifetime of the returned string is the same as the input obj parameter.

+
+
Parameters
+
    +
  • obj – Object (must not be NULL)

  • +
  • index – Index of the identifier. 0 = first identifier

  • +
+
+
Returns
+

a string, or NULL in case of error or missing name.

+
+
+
+ +
+
+const char *proj_get_remarks(const PJ *obj)
+

Get the remarks of an object.

+

The lifetime of the returned string is the same as the input obj parameter.

+
+
Parameters
+
    +
  • obj – Object (must not be NULL)

  • +
+
+
Returns
+

a string, or NULL in case of error.

+
+
+
+ +
+
+const char *proj_get_scope(const PJ *obj)
+

Get the scope of an object.

+

In case of multiple usages, this will be the one of first usage.

+

The lifetime of the returned string is the same as the input obj parameter.

+
+
Parameters
+
    +
  • obj – Object (must not be NULL)

  • +
+
+
Returns
+

a string, or NULL in case of error or missing scope.

+
+
+
+ +
+
+int proj_get_area_of_use(PJ_CONTEXT *ctx, const PJ *obj, double *out_west_lon_degree, double *out_south_lat_degree, double *out_east_lon_degree, double *out_north_lat_degree, const char **out_area_name)
+

Return the area of use of an object.

+

In case of multiple usages, this will be the one of first usage.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • obj – Object (must not be NULL)

  • +
  • out_west_lon_degree – Pointer to a double to receive the west longitude (in degrees). Or NULL. If the returned value is -1000, the bounding box is unknown.

  • +
  • out_south_lat_degree – Pointer to a double to receive the south latitude (in degrees). Or NULL. If the returned value is -1000, the bounding box is unknown.

  • +
  • out_east_lon_degree – Pointer to a double to receive the east longitude (in degrees). Or NULL. If the returned value is -1000, the bounding box is unknown.

  • +
  • out_north_lat_degree – Pointer to a double to receive the north latitude (in degrees). Or NULL. If the returned value is -1000, the bounding box is unknown.

  • +
  • out_area_name – Pointer to a string to receive the name of the area of use. Or NULL. *p_area_name is valid while obj is valid itself.

  • +
+
+
Returns
+

TRUE in case of success, FALSE in case of error or if the area of use is unknown.

+
+
+
+ +
+
+const char *proj_as_wkt(PJ_CONTEXT *ctx, const PJ *obj, PJ_WKT_TYPE type, const char *const *options)
+

Get a WKT representation of an object.

+

The returned string is valid while the input obj parameter is valid, and until a next call to proj_as_wkt() with the same input object.

+

This function calls osgeo::proj::io::IWKTExportable::exportToWKT().

+

This function may return NULL if the object is not compatible with an export to the requested type.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • obj – Object (must not be NULL)

  • +
  • type – WKT version.

  • +
  • options – null-terminated list of options, or NULL. Currently supported options are:

      +
    • MULTILINE=YES/NO. Defaults to YES, except for WKT1_ESRI

    • +
    • INDENTATION_WIDTH=number. Defaults to 4 (when multiline output is on).

    • +
    • OUTPUT_AXIS=AUTO/YES/NO. In AUTO mode, axis will be output for WKT2 variants, for WKT1_GDAL for ProjectedCRS with easting/northing ordering (otherwise stripped), but not for WKT1_ESRI. Setting to YES will output them unconditionally, and to NO will omit them unconditionally.

    • +
    • STRICT=YES/NO. Default is YES. If NO, a Geographic 3D CRS can be for example exported as WKT1_GDAL with 3 axes, whereas this is normally not allowed.

    • +
    • ALLOW_ELLIPSOIDAL_HEIGHT_AS_VERTICAL_CRS=YES/NO. Default is NO. If set to YES and type == PJ_WKT1_GDAL, a Geographic 3D CRS or a Projected 3D CRS will be exported as a compound CRS whose vertical part represents an ellipsoidal height (for example for use with LAS 1.4 WKT1).

    • +
    +

  • +
+
+
Returns
+

a string, or NULL in case of error.

+
+
+
+ +
+
+const char *proj_as_proj_string(PJ_CONTEXT *ctx, const PJ *obj, PJ_PROJ_STRING_TYPE type, const char *const *options)
+

Get a PROJ string representation of an object.

+

The returned string is valid while the input obj parameter is valid, and until a next call to proj_as_proj_string() with the same input object.

+

+This function calls osgeo::proj::io::IPROJStringExportable::exportToPROJString().

+

This function may return NULL if the object is not compatible with an export to the requested type.

+
+

Warning

+

If a CRS object was not created from a PROJ string, exporting to a PROJ string will in most cases cause a loss of information. This can potentially lead to erroneous transformations.

+
+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • obj – Object (must not be NULL)

  • +
  • type – PROJ String version.

  • +
  • options – NULL-terminated list of strings with “KEY=VALUE” format. or NULL. Currently supported options are:

      +
    • USE_APPROX_TMERC=YES to add the +approx flag to +proj=tmerc or +proj=utm.

    • +
    • MULTILINE=YES/NO. Defaults to NO

    • +
    • INDENTATION_WIDTH=number. Defaults to 2 (when multiline output is on).

    • +
    • MAX_LINE_LENGTH=number. Defaults to 80 (when multiline output is on).

    • +
    +

  • +
+
+
Returns
+

a string, or NULL in case of error.

+
+
+
+ +
+
+const char *proj_as_projjson(PJ_CONTEXT *ctx, const PJ *obj, const char *const *options)
+

Get a PROJJSON string representation of an object.

+

The returned string is valid while the input obj parameter is valid, and until a next call to proj_as_proj_string() with the same input object.

+

This function calls osgeo::proj::io::IJSONExportable::exportToJSON().

+

This function may return NULL if the object is not compatible with an export to the requested type.

+

+
Since

6.2

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • obj – Object (must not be NULL)

  • +
  • options – NULL-terminated list of strings with “KEY=VALUE” format. or NULL. Currently supported options are:

      +
    • MULTILINE=YES/NO. Defaults to YES

    • +
    • INDENTATION_WIDTH=number. Defaults to 2 (when multiline output is on).

    • +
    • SCHEMA=string. URL to PROJJSON schema. Can be set to empty string to disable it.

    • +
    +

  • +
+
+
Returns
+

a string, or NULL in case of error.

+
+
+
+ +
+
+PJ *proj_get_source_crs(PJ_CONTEXT *ctx, const PJ *obj)
+

Return the base CRS of a BoundCRS or a DerivedCRS/ProjectedCRS, or the source CRS of a CoordinateOperation.

+

The returned object must be unreferenced with proj_destroy() after use. It should be used by at most one thread at a time.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • obj – Object of type BoundCRS or CoordinateOperation (must not be NULL)

  • +
+
+
Returns
+

Object that must be unreferenced with proj_destroy(), or NULL in case of error, or missing source CRS.

+
+
+
+ +
+
+PJ *proj_get_target_crs(PJ_CONTEXT *ctx, const PJ *obj)
+

Return the hub CRS of a BoundCRS or the target CRS of a CoordinateOperation.

+

The returned object must be unreferenced with proj_destroy() after use. It should be used by at most one thread at a time.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • obj – Object of type BoundCRS or CoordinateOperation (must not be NULL)

  • +
+
+
Returns
+

Object that must be unreferenced with proj_destroy(), or NULL in case of error, or missing target CRS.

+
+
+
+ +
+
+PJ_OBJ_LIST *proj_identify(PJ_CONTEXT *ctx, const PJ *obj, const char *auth_name, const char *const *options, int **out_confidence)
+

Identify the CRS with reference CRSs.

+

The candidate CRSs are either hard-coded, or looked in the database when it is available.

+

Note that the implementation uses a set of heuristics to have a good compromise of successful identifications over execution time. It might miss legitimate matches in some circumstances.

+

The method returns a list of matching reference CRS, and the percentage (0-100) of confidence in the match. The list is sorted by decreasing confidence.

    +
  • 100% means that the name of the reference entry perfectly matches the CRS name, and both are equivalent. In which case a single result is returned. Note: in the case of a GeographicCRS whose axis order is implicit in the input definition (for example ESRI WKT), then axis order is ignored for the purpose of identification. That is the CRS built from GEOGCS[“GCS_WGS_1984”,DATUM[“D_WGS_1984”,SPHEROID[“WGS_1984”,6378137.0,298.257223563]], PRIMEM[“Greenwich”,0.0],UNIT[“Degree”,0.0174532925199433]] will be identified to EPSG:4326, but will not pass a isEquivalentTo(EPSG_4326, util::IComparable::Criterion::EQUIVALENT) test, but rather isEquivalentTo(EPSG_4326,

    +

    util::IComparable::Criterion::EQUIVALENT_EXCEPT_AXIS_ORDER_GEOGCRS)

    +

  • +
  • 90% means that CRS are equivalent, but the names are not exactly the same.

  • +
  • 70% means that CRS are equivalent, but the names are not equivalent.

  • +
  • 25% means that the CRS are not equivalent, but there is some similarity in the names.

  • +
+ +Other confidence values may be returned by some specialized implementations.

+

This is implemented for GeodeticCRS, ProjectedCRS, VerticalCRS and CompoundCRS.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • obj – Object of type CRS. Must not be NULL

  • +
  • auth_name – Authority name, or NULL for all authorities

  • +
  • options – Placeholder for future options. Should be set to NULL.

  • +
  • out_confidence – Output parameter. Pointer to an array of integers that will be allocated by the function and filled with the confidence values (0-100). There are as many elements in this array as proj_list_get_count() returns on the return value of this function. *confidence should be released with proj_int_list_destroy().

  • +
+
+
Returns
+

a list of matching reference CRS, or nullptr in case of error.

+
+
+
+ +
+
+PROJ_STRING_LIST proj_get_geoid_models_from_database(PJ_CONTEXT *ctx, const char *auth_name, const char *code, const char *const *options)
+

Returns a list of geoid models available for that crs.

+

The list includes the geoid models connected directly with the crs, or via “Height Depth Reversal” or “Change of Vertical Unit” transformations. The returned list is NULL terminated and must be freed with proj_string_list_destroy().

+

+
Since

8.1

+
+
+

+
+
Parameters
+
    +
  • ctx – Context, or NULL for default context.

  • +
  • auth_name – Authority name (must not be NULL)

  • +
  • code – Object code (must not be NULL)

  • +
  • options – should be set to NULL for now

  • +
+
+
Returns
+

list of geoid models names (to be freed with proj_string_list_destroy()), or NULL in case of error.

+
+
+
+ +
+
+void proj_int_list_destroy(int *list)
+

Free an array of integer.

+
+ +
+
+PROJ_STRING_LIST proj_get_authorities_from_database(PJ_CONTEXT *ctx)
+

Return the list of authorities used in the database.

+

The returned list is NULL terminated and must be freed with proj_string_list_destroy().

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
+
+
Returns
+

a NULL terminated list of NUL-terminated strings that must be freed with proj_string_list_destroy(), or NULL in case of error.

+
+
+
+ +
+
+PROJ_STRING_LIST proj_get_codes_from_database(PJ_CONTEXT *ctx, const char *auth_name, PJ_TYPE type, int allow_deprecated)
+

Returns the set of authority codes of the given object type.

+

The returned list is NULL terminated and must be freed with proj_string_list_destroy().

+

+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context.

  • +
  • auth_name – Authority name (must not be NULL)

  • +
  • type – Object type.

  • +
  • allow_deprecated – whether we should return deprecated objects as well.

  • +
+
+
Returns
+

a NULL terminated list of NUL-terminated strings that must be freed with proj_string_list_destroy(), or NULL in case of error.

+
+
+
+ +
+
+PROJ_CELESTIAL_BODY_INFO **proj_get_celestial_body_list_from_database(PJ_CONTEXT *ctx, const char *auth_name, int *out_result_count)
+

Enumerate celestial bodies from the database.

+

The returned object is an array of PROJ_CELESTIAL_BODY_INFO* pointers, whose last entry is NULL. This array should be freed with proj_celestial_body_list_destroy()

+

+
Since

8.1

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • auth_name – Authority name, used to restrict the search. Or NULL for all authorities.

  • +
  • out_result_count – Output parameter pointing to an integer to receive the size of the result list. Might be NULL

  • +
+
+
Returns
+

an array of PROJ_CELESTIAL_BODY_INFO* pointers to be freed with proj_celestial_body_list_destroy(), or NULL in case of error.

+
+
+
+ +
+
+void proj_celestial_body_list_destroy(PROJ_CELESTIAL_BODY_INFO **list)
+

Destroy the result returned by proj_get_celestial_body_list_from_database().

+

+
Since

8.1

+
+
+

+
+ +
+
+PROJ_CRS_LIST_PARAMETERS *proj_get_crs_list_parameters_create(void)
+

Instantiate a default set of parameters to be used by proj_get_crs_list().

+
+
Returns
+

a new object to free with proj_get_crs_list_parameters_destroy()

+
+
+
+ +
+
+void proj_get_crs_list_parameters_destroy(PROJ_CRS_LIST_PARAMETERS *params)
+

Destroy an object returned by proj_get_crs_list_parameters_create()

+
+ +
+
+PROJ_CRS_INFO **proj_get_crs_info_list_from_database(PJ_CONTEXT *ctx, const char *auth_name, const PROJ_CRS_LIST_PARAMETERS *params, int *out_result_count)
+

Enumerate CRS objects from the database, taking into account various criteria.

+

The returned object is an array of PROJ_CRS_INFO* pointers, whose last entry is NULL. This array should be freed with proj_crs_info_list_destroy()

+

When no filter parameters are set, this is functionally equivalent to proj_get_codes_from_database(), instantiating a PJ* object for each of the codes with proj_create_from_database() and retrieving information with the various getters. However this function will be much faster.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • auth_name – Authority name, used to restrict the search. Or NULL for all authorities.

  • +
  • params – Additional criteria, or NULL. If not-NULL, params SHOULD have been allocated by proj_get_crs_list_parameters_create(), as the PROJ_CRS_LIST_PARAMETERS structure might grow over time.

  • +
  • out_result_count – Output parameter pointing to an integer to receive the size of the result list. Might be NULL

  • +
+
+
Returns
+

an array of PROJ_CRS_INFO* pointers to be freed with proj_crs_info_list_destroy(), or NULL in case of error.

+
+
+
+ +
+
+void proj_crs_info_list_destroy(PROJ_CRS_INFO **list)
+

Destroy the result returned by proj_get_crs_info_list_from_database().

+
+ +
+
+PROJ_UNIT_INFO **proj_get_units_from_database(PJ_CONTEXT *ctx, const char *auth_name, const char *category, int allow_deprecated, int *out_result_count)
+

Enumerate units from the database, taking into account various criteria.

+

The returned object is an array of PROJ_UNIT_INFO* pointers, whose last entry is NULL. This array should be freed with proj_unit_list_destroy()

+

+
Since

7.1

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • auth_name – Authority name, used to restrict the search. Or NULL for all authorities.

  • +
  • category – Filter by category, if this parameter is not NULL. Category is one of “linear”, “linear_per_time”, “angular”, “angular_per_time”, “scale”, “scale_per_time” or “time”

  • +
  • allow_deprecated – whether we should return deprecated objects as well.

  • +
  • out_result_count – Output parameter pointing to an integer to receive the size of the result list. Might be NULL

  • +
+
+
Returns
+

an array of PROJ_UNIT_INFO* pointers to be freed with proj_unit_list_destroy(), or NULL in case of error.

+
+
+
+ +
+
+void proj_unit_list_destroy(PROJ_UNIT_INFO **list)
+

Destroy the result returned by proj_get_units_from_database().

+

+
Since

7.1

+
+
+

+
+ +
+
+PJ_INSERT_SESSION *proj_insert_object_session_create(PJ_CONTEXT *ctx)
+

Starts a session for proj_get_insert_statements()

+

Starts a new session for one or several calls to proj_get_insert_statements().

+

An insertion session guarantees that the inserted objects will not create conflicting intermediate objects.

+

The session must be stopped with proj_insert_object_session_destroy().

+

Only one session may be active at a time for a given context.

+

+
Since

8.1

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
+
+
Returns
+

the session, or NULL in case of error.

+
+
+
+ +
+
+void proj_insert_object_session_destroy(PJ_CONTEXT *ctx, PJ_INSERT_SESSION *session)
+

Stops an insertion session started with proj_insert_object_session_create()

+

+
Since

8.1

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • session – The insertion session.

  • +
+
+
+
+ +
+
+PROJ_STRING_LIST proj_get_insert_statements(PJ_CONTEXT *ctx, PJ_INSERT_SESSION *session, const PJ *object, const char *authority, const char *code, int numeric_codes, const char *const *allowed_authorities, const char *const *options)
+

Returns SQL statements needed to insert the passed object into the database.

+

proj_insert_object_session_create() may have been called previously.

+

It is strongly recommended that new objects should not be added in common registries, such as “EPSG”, “ESRI”, “IAU”, etc. Users should use a custom authority name instead. If a new object should be added to the official EPSG registry, users are invited to follow the procedure explained at https://epsg.org/dataset-change-requests.html.

+

Combined with proj_context_get_database_structure(), users can create auxiliary databases, instead of directly modifying the main proj.db database. Those auxiliary databases can be specified through proj_context_set_database_path() or the PROJ_AUX_DB environment variable.

+

+
Since

8.1

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • session – The insertion session. May be NULL if a single object must be inserted.

  • +
  • object – The object to insert into the database. Currently only PrimeMeridian, Ellipsoid, Datum, GeodeticCRS, ProjectedCRS, VerticalCRS, CompoundCRS or BoundCRS are supported.

  • +
  • authority – Authority name into which the object will be inserted. Must not be NULL.

  • +
  • code – Code with which the object will be inserted.Must not be NULL.

  • +
  • numeric_codes – Whether intermediate objects that can be created should use numeric codes (true), or may be alphanumeric (false)

  • +
  • allowed_authorities – NULL terminated list of authority names, or NULL. Authorities to which intermediate objects are allowed to refer to. “authority” will be implicitly added to it. Note that unit, coordinate systems, projection methods and parameters will in any case be allowed to refer to EPSG. If NULL, allowed_authorities defaults to {“EPSG”, “PROJ”, nullptr}

  • +
  • options – NULL terminated list of options, or NULL. No options are supported currently.

  • +
+
+
Returns
+

a list of insert statements (to be freed with proj_string_list_destroy()), or NULL in case of error.

+
+
+
+ +
+
+char *proj_suggests_code_for(PJ_CONTEXT *ctx, const PJ *object, const char *authority, int numeric_code, const char *const *options)
+

Suggests a database code for the passed object.

+

Supported type of objects are PrimeMeridian, Ellipsoid, Datum, DatumEnsemble, GeodeticCRS, ProjectedCRS, VerticalCRS, CompoundCRS, BoundCRS, Conversion.

+

+
Since

8.1

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • object – Object for which to suggest a code.

  • +
  • authority – Authority name into which the object will be inserted.

  • +
  • numeric_code – Whether the code should be numeric, or derived from the object name.

  • +
  • options – NULL terminated list of options, or NULL. No options are supported currently.

  • +
+
+
Returns
+

the suggested code, that is guaranteed to not conflict with an existing one (to be freed with proj_string_destroy), or nullptr in case of error.

+
+
+
+ +
+
+void proj_string_destroy(char *str)
+

Free a string.

+

Only to be used with functions that document using this function.

+

+
Since

8.1

+
+
+

+
+
Parameters
+
    +
  • str – String to free.

  • +
+
+
+
+ +
+
+PJ_OPERATION_FACTORY_CONTEXT *proj_create_operation_factory_context(PJ_CONTEXT *ctx, const char *authority)
+

Instantiate a context for building coordinate operations between two CRS.

+

The returned object must be unreferenced with proj_operation_factory_context_destroy() after use.

+

If authority is NULL or the empty string, then coordinate operations from any authority will be searched, with the restrictions set in the authority_to_authority_preference database table. If authority is set to “any”, then coordinate operations from any authority will be searched If authority is a non-empty string different of “any”, then coordinate operations will be searched only in that authority namespace.

+
+
Parameters
+
    +
  • ctx – Context, or NULL for default context.

  • +
  • authority – Name of authority to which to restrict the search of candidate operations.

  • +
+
+
Returns
+

Object that must be unreferenced with proj_operation_factory_context_destroy(), or NULL in case of error.

+
+
+
+ +
+
+void proj_operation_factory_context_destroy(PJ_OPERATION_FACTORY_CONTEXT *ctx)
+

Drops a reference on an object.

+

This method should be called one and exactly one for each function returning a PJ_OPERATION_FACTORY_CONTEXT*

+
+
Parameters
+
    +
  • ctx – Object, or NULL.

  • +
+
+
+
+ +
+
+void proj_operation_factory_context_set_desired_accuracy(PJ_CONTEXT *ctx, PJ_OPERATION_FACTORY_CONTEXT *factory_ctx, double accuracy)
+

Set the desired accuracy of the resulting coordinate transformations.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • factory_ctx – Operation factory context. must not be NULL

  • +
  • accuracy – Accuracy in meter (or 0 to disable the filter).

  • +
+
+
+
+ +
+
+void proj_operation_factory_context_set_area_of_interest(PJ_CONTEXT *ctx, PJ_OPERATION_FACTORY_CONTEXT *factory_ctx, double west_lon_degree, double south_lat_degree, double east_lon_degree, double north_lat_degree)
+

Set the desired area of interest for the resulting coordinate transformations.

+

For an area of interest crossing the anti-meridian, west_lon_degree will be greater than east_lon_degree.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • factory_ctx – Operation factory context. must not be NULL

  • +
  • west_lon_degree – West longitude (in degrees).

  • +
  • south_lat_degree – South latitude (in degrees).

  • +
  • east_lon_degree – East longitude (in degrees).

  • +
  • north_lat_degree – North latitude (in degrees).

  • +
+
+
+
+ +
+
+void proj_operation_factory_context_set_crs_extent_use(PJ_CONTEXT *ctx, PJ_OPERATION_FACTORY_CONTEXT *factory_ctx, PROJ_CRS_EXTENT_USE use)
+

Set how source and target CRS extent should be used when considering if a transformation can be used (only takes effect if no area of interest is explicitly defined).

+

The default is PJ_CRS_EXTENT_SMALLEST.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • factory_ctx – Operation factory context. must not be NULL

  • +
  • use – How source and target CRS extent should be used.

  • +
+
+
+
+ +
+
+void proj_operation_factory_context_set_spatial_criterion(PJ_CONTEXT *ctx, PJ_OPERATION_FACTORY_CONTEXT *factory_ctx, PROJ_SPATIAL_CRITERION criterion)
+

Set the spatial criterion to use when comparing the area of validity of coordinate operations with the area of interest / area of validity of source and target CRS.

+

The default is PROJ_SPATIAL_CRITERION_STRICT_CONTAINMENT.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • factory_ctx – Operation factory context. must not be NULL

  • +
  • criterion – spatial criterion to use

  • +
+
+
+
+ +
+
+void proj_operation_factory_context_set_grid_availability_use(PJ_CONTEXT *ctx, PJ_OPERATION_FACTORY_CONTEXT *factory_ctx, PROJ_GRID_AVAILABILITY_USE use)
+

Set how grid availability is used.

+

The default is USE_FOR_SORTING.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • factory_ctx – Operation factory context. must not be NULL

  • +
  • use – how grid availability is used.

  • +
+
+
+
+ +
+
+void proj_operation_factory_context_set_use_proj_alternative_grid_names(PJ_CONTEXT *ctx, PJ_OPERATION_FACTORY_CONTEXT *factory_ctx, int usePROJNames)
+

Set whether PROJ alternative grid names should be substituted to the official authority names.

+

The default is true.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • factory_ctx – Operation factory context. must not be NULL

  • +
  • usePROJNames – whether PROJ alternative grid names should be used

  • +
+
+
+
+ +
+
+void proj_operation_factory_context_set_allow_use_intermediate_crs(PJ_CONTEXT *ctx, PJ_OPERATION_FACTORY_CONTEXT *factory_ctx, PROJ_INTERMEDIATE_CRS_USE use)
+

Set whether an intermediate pivot CRS can be used for researching coordinate operations between a source and target CRS.

+

Concretely if in the database there is an operation from A to C (or C to A), and another one from C to B (or B to C), but no direct operation between A and B, setting this parameter to true, allow chaining both operations.

+

The current implementation is limited to researching one intermediate step.

+

By default, with the IF_NO_DIRECT_TRANSFORMATION strategy, all potential C candidates will be used if there is no direct transformation.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • factory_ctx – Operation factory context. must not be NULL

  • +
  • use – whether and how intermediate CRS may be used.

  • +
+
+
+
+ +
+
+void proj_operation_factory_context_set_allowed_intermediate_crs(PJ_CONTEXT *ctx, PJ_OPERATION_FACTORY_CONTEXT *factory_ctx, const char *const *list_of_auth_name_codes)
+

Restrict the potential pivot CRSs that can be used when trying to build a coordinate operation between two CRS that have no direct operation.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • factory_ctx – Operation factory context. must not be NULL

  • +
  • list_of_auth_name_codes – an array of strings NLL terminated, with the format { “auth_name1”, “code1”, “auth_name2”, “code2”, … NULL }

  • +
+
+
+
+ +
+
+void proj_operation_factory_context_set_discard_superseded(PJ_CONTEXT *ctx, PJ_OPERATION_FACTORY_CONTEXT *factory_ctx, int discard)
+

Set whether transformations that are superseded (but not deprecated) should be discarded.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • factory_ctx – Operation factory context. must not be NULL

  • +
  • discard – superseded crs or not

  • +
+
+
+
+ +
+
+void proj_operation_factory_context_set_allow_ballpark_transformations(PJ_CONTEXT *ctx, PJ_OPERATION_FACTORY_CONTEXT *factory_ctx, int allow)
+

Set whether ballpark transformations are allowed.

+

+
Since

7.1

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • factory_ctx – Operation factory context. must not be NULL

  • +
  • allow – set to TRUE to allow ballpark transformations.

  • +
+
+
+
+ +
+
+PJ_OBJ_LIST *proj_create_operations(PJ_CONTEXT *ctx, const PJ *source_crs, const PJ *target_crs, const PJ_OPERATION_FACTORY_CONTEXT *operationContext)
+

Find a list of CoordinateOperation from source_crs to target_crs.

+

The operations are sorted with the most relevant ones first: by descending area (intersection of the transformation area with the area of interest, or intersection of the transformation with the area of use of the CRS), and by increasing accuracy. Operations with unknown accuracy are sorted last, whatever their area.

+

When one of the source or target CRS has a vertical component but not the other one, the one that has no vertical component is automatically promoted to a 3D version, where its vertical axis is the ellipsoidal height in metres, using the ellipsoid of the base geodetic CRS.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • source_crs – source CRS. Must not be NULL.

  • +
  • target_crs – source CRS. Must not be NULL.

  • +
  • operationContext – Search context. Must not be NULL.

  • +
+
+
Returns
+

a result set that must be unreferenced with proj_list_destroy(), or NULL in case of error.

+
+
+
+ +
+
+int proj_list_get_count(const PJ_OBJ_LIST *result)
+

Return the number of objects in the result set.

+
+
Parameters
+
    +
  • result – Object of type PJ_OBJ_LIST (must not be NULL)

  • +
+
+
+
+ +
+
+PJ *proj_list_get(PJ_CONTEXT *ctx, const PJ_OBJ_LIST *result, int index)
+

Return an object from the result set.

+

The returned object must be unreferenced with proj_destroy() after use. It should be used by at most one thread at a time.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • result – Object of type PJ_OBJ_LIST (must not be NULL)

  • +
  • index – Index

  • +
+
+
Returns
+

a new object that must be unreferenced with proj_destroy(), or nullptr in case of error.

+
+
+
+ +
+
+void proj_list_destroy(PJ_OBJ_LIST *result)
+

Drops a reference on the result set.

+

This method should be called one and exactly one for each function returning a PJ_OBJ_LIST*

+
+
Parameters
+
    +
  • result – Object, or NULL.

  • +
+
+
+
+ +
+
+int proj_get_suggested_operation(PJ_CONTEXT *ctx, PJ_OBJ_LIST *operations, PJ_DIRECTION direction, PJ_COORD coord)
+

Return the index of the operation that would be the most appropriate to transform the specified coordinates.

+

This operation may use resources that are not locally available, depending on the search criteria used by proj_create_operations().

+

This could be done by using proj_create_operations() with a punctual bounding box, but this function is faster when one needs to evaluate on many points with the same (source_crs, target_crs) tuple.

+

+
Since

7.1

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • operations – List of operations returned by proj_create_operations()

  • +
  • direction – Direction into which to transform the point.

  • +
  • coord – Coordinate to transform

  • +
+
+
Returns
+

the index in operations that would be used to transform coord. Or -1 in case of error, or no match.

+
+
+
+ +
+
+int proj_crs_is_derived(PJ_CONTEXT *ctx, const PJ *crs)
+

Returns whether a CRS is a derived CRS.

+

+
Since

8.0

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • crs – Object of type CRS (must not be NULL)

  • +
+
+
Returns
+

TRUE if the CRS is a derived CRS.

+
+
+
+ +
+
+PJ *proj_crs_get_geodetic_crs(PJ_CONTEXT *ctx, const PJ *crs)
+

Get the geodeticCRS / geographicCRS from a CRS.

+

The returned object must be unreferenced with proj_destroy() after use. It should be used by at most one thread at a time.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • crs – Object of type CRS (must not be NULL)

  • +
+
+
Returns
+

Object that must be unreferenced with proj_destroy(), or NULL in case of error.

+
+
+
+ +
+
+PJ *proj_crs_get_horizontal_datum(PJ_CONTEXT *ctx, const PJ *crs)
+

Get the horizontal datum from a CRS.

+

This function may return a Datum or DatumEnsemble object.

+

The returned object must be unreferenced with proj_destroy() after use. It should be used by at most one thread at a time.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • crs – Object of type CRS (must not be NULL)

  • +
+
+
Returns
+

Object that must be unreferenced with proj_destroy(), or NULL in case of error.

+
+
+
+ +
+
+PJ *proj_crs_get_sub_crs(PJ_CONTEXT *ctx, const PJ *crs, int index)
+

Get a CRS component from a CompoundCRS.

+

The returned object must be unreferenced with proj_destroy() after use. It should be used by at most one thread at a time.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • crs – Object of type CRS (must not be NULL)

  • +
  • index – Index of the CRS component (typically 0 = horizontal, 1 = vertical)

  • +
+
+
Returns
+

Object that must be unreferenced with proj_destroy(), or NULL in case of error.

+
+
+
+ +
+
+PJ *proj_crs_get_datum(PJ_CONTEXT *ctx, const PJ *crs)
+

Returns the datum of a SingleCRS.

+

If that function returns NULL,

+

The returned object must be unreferenced with proj_destroy() after use. It should be used by at most one thread at a time.

+
+

See also

+

proj_crs_get_datum_ensemble() to potentially get a DatumEnsemble instead.

+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • crs – Object of type SingleCRS (must not be NULL)

  • +
+
+
Returns
+

Object that must be unreferenced with proj_destroy(), or NULL in case of error (or if there is no datum)

+
+
+
+ +
+
+PJ *proj_crs_get_datum_ensemble(PJ_CONTEXT *ctx, const PJ *crs)
+

Returns the datum ensemble of a SingleCRS.

+

If that function returns NULL,

+

The returned object must be unreferenced with proj_destroy() after use. It should be used by at most one thread at a time.

+
+

See also

+

proj_crs_get_datum() to potentially get a Datum instead.

+
+

+

+
Since

7.2

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • crs – Object of type SingleCRS (must not be NULL)

  • +
+
+
Returns
+

Object that must be unreferenced with proj_destroy(), or NULL in case of error (or if there is no datum ensemble)

+
+
+
+ +
+
+PJ *proj_crs_get_datum_forced(PJ_CONTEXT *ctx, const PJ *crs)
+

Returns a datum for a SingleCRS.

+

If the SingleCRS has a datum, then this datum is returned. Otherwise, the SingleCRS has a datum ensemble, and this datum ensemble is returned as a regular datum instead of a datum ensemble.

+

The returned object must be unreferenced with proj_destroy() after use. It should be used by at most one thread at a time.

+

+
Since

7.2

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • crs – Object of type SingleCRS (must not be NULL)

  • +
+
+
Returns
+

Object that must be unreferenced with proj_destroy(), or NULL in case of error (or if there is no datum)

+
+
+
+ +
+
+int proj_datum_ensemble_get_member_count(PJ_CONTEXT *ctx, const PJ *datum_ensemble)
+

Returns the number of members of a datum ensemble.

+

+
Since

7.2

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • datum_ensemble – Object of type DatumEnsemble (must not be NULL)

  • +
+
+
+
+ +
+
+double proj_datum_ensemble_get_accuracy(PJ_CONTEXT *ctx, const PJ *datum_ensemble)
+

Returns the positional accuracy of the datum ensemble.

+

+
Since

7.2

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • datum_ensemble – Object of type DatumEnsemble (must not be NULL)

  • +
+
+
Returns
+

the accuracy, or -1 in case of error.

+
+
+
+ +
+
+PJ *proj_datum_ensemble_get_member(PJ_CONTEXT *ctx, const PJ *datum_ensemble, int member_index)
+

Returns a member from a datum ensemble.

+

The returned object must be unreferenced with proj_destroy() after use. It should be used by at most one thread at a time.

+

+
Since

7.2

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • datum_ensemble – Object of type DatumEnsemble (must not be NULL)

  • +
  • member_index – Index of the datum member to extract (between 0 and proj_datum_ensemble_get_member_count()-1)

  • +
+
+
Returns
+

Object that must be unreferenced with proj_destroy(), or NULL in case of error (or if there is no datum ensemble)

+
+
+
+ +
+
+double proj_dynamic_datum_get_frame_reference_epoch(PJ_CONTEXT *ctx, const PJ *datum)
+

Returns the frame reference epoch of a dynamic geodetic or vertical reference frame.

+

+
Since

7.2

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • datum – Object of type DynamicGeodeticReferenceFrame or DynamicVerticalReferenceFrame (must not be NULL)

  • +
+
+
Returns
+

the frame reference epoch as decimal year, or -1 in case of error.

+
+
+
+ +
+
+PJ *proj_crs_get_coordinate_system(PJ_CONTEXT *ctx, const PJ *crs)
+

Returns the coordinate system of a SingleCRS.

+

The returned object must be unreferenced with proj_destroy() after use. It should be used by at most one thread at a time.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • crs – Object of type SingleCRS (must not be NULL)

  • +
+
+
Returns
+

Object that must be unreferenced with proj_destroy(), or NULL in case of error.

+
+
+
+ +
+
+PJ_COORDINATE_SYSTEM_TYPE proj_cs_get_type(PJ_CONTEXT *ctx, const PJ *cs)
+

Returns the type of the coordinate system.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • cs – Object of type CoordinateSystem (must not be NULL)

  • +
+
+
Returns
+

type, or PJ_CS_TYPE_UNKNOWN in case of error.

+
+
+
+ +
+
+int proj_cs_get_axis_count(PJ_CONTEXT *ctx, const PJ *cs)
+

Returns the number of axis of the coordinate system.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • cs – Object of type CoordinateSystem (must not be NULL)

  • +
+
+
Returns
+

number of axis, or -1 in case of error.

+
+
+
+ +
+
+int proj_cs_get_axis_info(PJ_CONTEXT *ctx, const PJ *cs, int index, const char **out_name, const char **out_abbrev, const char **out_direction, double *out_unit_conv_factor, const char **out_unit_name, const char **out_unit_auth_name, const char **out_unit_code)
+

Returns information on an axis.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • cs – Object of type CoordinateSystem (must not be NULL)

  • +
  • index – Index of the coordinate system (between 0 and proj_cs_get_axis_count() - 1)

  • +
  • out_name – Pointer to a string value to store the axis name. or NULL

  • +
  • out_abbrev – Pointer to a string value to store the axis abbreviation. or NULL

  • +
  • out_direction – Pointer to a string value to store the axis direction. or NULL

  • +
  • out_unit_conv_factor – Pointer to a double value to store the axis unit conversion factor. or NULL

  • +
  • out_unit_name – Pointer to a string value to store the axis unit name. or NULL

  • +
  • out_unit_auth_name – Pointer to a string value to store the axis unit authority name. or NULL

  • +
  • out_unit_code – Pointer to a string value to store the axis unit code. or NULL

  • +
+
+
Returns
+

TRUE in case of success

+
+
+
+ +
+
+PJ *proj_get_ellipsoid(PJ_CONTEXT *ctx, const PJ *obj)
+

Get the ellipsoid from a CRS or a GeodeticReferenceFrame.

+

The returned object must be unreferenced with proj_destroy() after use. It should be used by at most one thread at a time.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • obj – Object of type CRS or GeodeticReferenceFrame (must not be NULL)

  • +
+
+
Returns
+

Object that must be unreferenced with proj_destroy(), or NULL in case of error.

+
+
+
+ +
+
+int proj_ellipsoid_get_parameters(PJ_CONTEXT *ctx, const PJ *ellipsoid, double *out_semi_major_metre, double *out_semi_minor_metre, int *out_is_semi_minor_computed, double *out_inv_flattening)
+

Return ellipsoid parameters.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • ellipsoid – Object of type Ellipsoid (must not be NULL)

  • +
  • out_semi_major_metre – Pointer to a value to store the semi-major axis in metre. or NULL

  • +
  • out_semi_minor_metre – Pointer to a value to store the semi-minor axis in metre. or NULL

  • +
  • out_is_semi_minor_computed – Pointer to a boolean value to indicate if the semi-minor value was computed. If FALSE, its value comes from the definition. or NULL

  • +
  • out_inv_flattening – Pointer to a value to store the inverse flattening. or NULL

  • +
+
+
Returns
+

TRUE in case of success.

+
+
+
+ +
+
+const char *proj_get_celestial_body_name(PJ_CONTEXT *ctx, const PJ *obj)
+

Get the name of the celestial body of this object.

+

Object should be a CRS, Datum or Ellipsoid.

+

+
Since

8.1

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • obj – Object of type CRS, Datum or Ellipsoid.(must not be NULL)

  • +
+
+
Returns
+

the name of the celestial body, or NULL.

+
+
+
+ +
+
+PJ *proj_get_prime_meridian(PJ_CONTEXT *ctx, const PJ *obj)
+

Get the prime meridian of a CRS or a GeodeticReferenceFrame.

+

The returned object must be unreferenced with proj_destroy() after use. It should be used by at most one thread at a time.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • obj – Object of type CRS or GeodeticReferenceFrame (must not be NULL)

  • +
+
+
Returns
+

Object that must be unreferenced with proj_destroy(), or NULL in case of error.

+
+
+
+ +
+
+int proj_prime_meridian_get_parameters(PJ_CONTEXT *ctx, const PJ *prime_meridian, double *out_longitude, double *out_unit_conv_factor, const char **out_unit_name)
+

Return prime meridian parameters.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • prime_meridian – Object of type PrimeMeridian (must not be NULL)

  • +
  • out_longitude – Pointer to a value to store the longitude of the prime meridian, in its native unit. or NULL

  • +
  • out_unit_conv_factor – Pointer to a value to store the conversion factor of the prime meridian longitude unit to radian. or NULL

  • +
  • out_unit_name – Pointer to a string value to store the unit name. or NULL

  • +
+
+
Returns
+

TRUE in case of success.

+
+
+
+ +
+
+PJ *proj_crs_get_coordoperation(PJ_CONTEXT *ctx, const PJ *crs)
+

Return the Conversion of a DerivedCRS (such as a ProjectedCRS), or the Transformation from the baseCRS to the hubCRS of a BoundCRS.

+

The returned object must be unreferenced with proj_destroy() after use. It should be used by at most one thread at a time.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • crs – Object of type DerivedCRS or BoundCRSs (must not be NULL)

  • +
+
+
Returns
+

Object of type SingleOperation that must be unreferenced with proj_destroy(), or NULL in case of error.

+
+
+
+ +
+
+int proj_coordoperation_get_method_info(PJ_CONTEXT *ctx, const PJ *coordoperation, const char **out_method_name, const char **out_method_auth_name, const char **out_method_code)
+

Return information on the operation method of the SingleOperation.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • coordoperation – Object of type SingleOperation (typically a Conversion or Transformation) (must not be NULL)

  • +
  • out_method_name – Pointer to a string value to store the method (projection) name. or NULL

  • +
  • out_method_auth_name – Pointer to a string value to store the method authority name. or NULL

  • +
  • out_method_code – Pointer to a string value to store the method code. or NULL

  • +
+
+
Returns
+

TRUE in case of success.

+
+
+
+ +
+
+int proj_coordoperation_is_instantiable(PJ_CONTEXT *ctx, const PJ *coordoperation)
+

Return whether a coordinate operation can be instantiated as a PROJ pipeline, checking in particular that referenced grids are available.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • coordoperation – Object of type CoordinateOperation or derived classes (must not be NULL)

  • +
+
+
Returns
+

TRUE or FALSE.

+
+
+
+ +
+
+int proj_coordoperation_has_ballpark_transformation(PJ_CONTEXT *ctx, const PJ *coordoperation)
+

Return whether a coordinate operation has a “ballpark” transformation, that is a very approximate one, due to lack of more accurate transformations.

+

Typically a null geographic offset between two horizontal datum, or a null vertical offset (or limited to unit changes) between two vertical datum. Errors of several tens to one hundred meters might be expected, compared to more accurate transformations.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • coordoperation – Object of type CoordinateOperation or derived classes (must not be NULL)

  • +
+
+
Returns
+

TRUE or FALSE.

+
+
+
+ +
+
+int proj_coordoperation_get_param_count(PJ_CONTEXT *ctx, const PJ *coordoperation)
+

Return the number of parameters of a SingleOperation.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • coordoperation – Object of type SingleOperation or derived classes (must not be NULL)

  • +
+
+
+
+ +
+
+int proj_coordoperation_get_param_index(PJ_CONTEXT *ctx, const PJ *coordoperation, const char *name)
+

Return the index of a parameter of a SingleOperation.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • coordoperation – Object of type SingleOperation or derived classes (must not be NULL)

  • +
  • name – Parameter name. Must not be NULL

  • +
+
+
Returns
+

index (>=0), or -1 in case of error.

+
+
+
+ +
+
+int proj_coordoperation_get_param(PJ_CONTEXT *ctx, const PJ *coordoperation, int index, const char **out_name, const char **out_auth_name, const char **out_code, double *out_value, const char **out_value_string, double *out_unit_conv_factor, const char **out_unit_name, const char **out_unit_auth_name, const char **out_unit_code, const char **out_unit_category)
+

Return a parameter of a SingleOperation.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • coordoperation – Object of type SingleOperation or derived classes (must not be NULL)

  • +
  • index – Parameter index.

  • +
  • out_name – Pointer to a string value to store the parameter name. or NULL

  • +
  • out_auth_name – Pointer to a string value to store the parameter authority name. or NULL

  • +
  • out_code – Pointer to a string value to store the parameter code. or NULL

  • +
  • out_value – Pointer to a double value to store the parameter value (if numeric). or NULL

  • +
  • out_value_string – Pointer to a string value to store the parameter value (if of type string). or NULL

  • +
  • out_unit_conv_factor – Pointer to a double value to store the parameter unit conversion factor. or NULL

  • +
  • out_unit_name – Pointer to a string value to store the parameter unit name. or NULL

  • +
  • out_unit_auth_name – Pointer to a string value to store the unit authority name. or NULL

  • +
  • out_unit_code – Pointer to a string value to store the unit code. or NULL

  • +
  • out_unit_category – Pointer to a string value to store the parameter name. or NULL. This value might be “unknown”, “none”, “linear”, “linear_per_time”, “angular”, “angular_per_time”, “scale”, “scale_per_time”, “time”, “parametric” or “parametric_per_time”

  • +
+
+
Returns
+

TRUE in case of success.

+
+
+
+ +
+
+int proj_coordoperation_get_grid_used_count(PJ_CONTEXT *ctx, const PJ *coordoperation)
+

Return the number of grids used by a CoordinateOperation.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • coordoperation – Object of type CoordinateOperation or derived classes (must not be NULL)

  • +
+
+
+
+ +
+
+int proj_coordoperation_get_grid_used(PJ_CONTEXT *ctx, const PJ *coordoperation, int index, const char **out_short_name, const char **out_full_name, const char **out_package_name, const char **out_url, int *out_direct_download, int *out_open_license, int *out_available)
+

Return a parameter of a SingleOperation.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • coordoperation – Object of type SingleOperation or derived classes (must not be NULL)

  • +
  • index – Parameter index.

  • +
  • out_short_name – Pointer to a string value to store the grid short name. or NULL

  • +
  • out_full_name – Pointer to a string value to store the grid full filename. or NULL

  • +
  • out_package_name – Pointer to a string value to store the package name where the grid might be found. or NULL

  • +
  • out_url – Pointer to a string value to store the grid URL or the package URL where the grid might be found. or NULL

  • +
  • out_direct_download – Pointer to a int (boolean) value to store whether *out_url can be downloaded directly. or NULL

  • +
  • out_open_license – Pointer to a int (boolean) value to store whether the grid is released with an open license. or NULL

  • +
  • out_available – Pointer to a int (boolean) value to store whether the grid is available at runtime. or NULL

  • +
+
+
Returns
+

TRUE in case of success.

+
+
+
+ +
+
+double proj_coordoperation_get_accuracy(PJ_CONTEXT *ctx, const PJ *obj)
+

Return the accuracy (in metre) of a coordinate operation.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • coordoperation – Coordinate operation. Must not be NULL.

  • +
+
+
Returns
+

the accuracy, or a negative value if unknown or in case of error.

+
+
+
+ +
+
+int proj_coordoperation_get_towgs84_values(PJ_CONTEXT *ctx, const PJ *coordoperation, double *out_values, int value_count, int emit_error_if_incompatible)
+

Return the parameters of a Helmert transformation as WKT1 TOWGS84 values.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • coordoperation – Object of type Transformation, that can be represented as a WKT1 TOWGS84 node (must not be NULL)

  • +
  • out_values – Pointer to an array of value_count double values.

  • +
  • value_count – Size of out_values array. The suggested size is 7 to get translation, rotation and scale difference parameters. Rotation and scale difference terms might be zero if the transformation only includes translation parameters. In that case, value_count could be set to 3.

  • +
  • emit_error_if_incompatible – Boolean to indicate if an error must be logged if coordoperation is not compatible with a WKT1 TOWGS84 representation.

  • +
+
+
Returns
+

TRUE in case of success, or FALSE if coordoperation is not compatible with a WKT1 TOWGS84 representation.

+
+
+
+ +
+
+PJ *proj_coordoperation_create_inverse(PJ_CONTEXT *ctx, const PJ *obj)
+

Returns a PJ* coordinate operation object which represents the inverse operation of the specified coordinate operation.

+

+
Since

6.3

+
+
+

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • obj – Object of type CoordinateOperation (must not be NULL)

  • +
+
+
Returns
+

a new PJ* object to free with proj_destroy() in case of success, or nullptr in case of error

+
+
+
+ +
+
+int proj_concatoperation_get_step_count(PJ_CONTEXT *ctx, const PJ *concatoperation)
+

Returns the number of steps of a concatenated operation.

+

The input object must be a concatenated operation.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • concatoperation – Concatenated operation (must not be NULL)

  • +
+
+
Returns
+

the number of steps, or 0 in case of error.

+
+
+
+ +
+
+PJ *proj_concatoperation_get_step(PJ_CONTEXT *ctx, const PJ *concatoperation, int i_step)
+

Returns a step of a concatenated operation.

+

The input object must be a concatenated operation.

+

The returned object must be unreferenced with proj_destroy() after use. It should be used by at most one thread at a time.

+
+
Parameters
+
    +
  • ctx – PROJ context, or NULL for default context

  • +
  • concatoperation – Concatenated operation (must not be NULL)

  • +
  • i_step – Index of the step to extract. Between 0 and proj_concatoperation_get_step_count()-1

  • +
+
+
Returns
+

Object that must be unreferenced with proj_destroy(), or NULL in case of error.

+
+
+
+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/development/reference/index.html b/development/reference/index.html new file mode 100644 index 00000000..04181885 --- /dev/null +++ b/development/reference/index.html @@ -0,0 +1,154 @@ + + + + + + + Reference — PROJ 9.0.0 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Reference

+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/development/reference/macros.html b/development/reference/macros.html new file mode 100644 index 00000000..871f7e44 --- /dev/null +++ b/development/reference/macros.html @@ -0,0 +1,195 @@ + + + + + + + Macros — PROJ 9.0.0 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Macros

+
+
+PROJ_VERSION_MAJOR
+

Major version number, e.g. 8 for PROJ 8.0.1

+
+ +
+
+PROJ_VERSION_MINOR
+

Minor version number, e.g. 0 for PROJ 8.0.1

+
+ +
+
+PROJ_VERSION_PATCH
+

Patch version number, e.g. 1 for PROJ 8.0.1

+
+ +
+
+PROJ_COMPUTE_VERSION(maj, min, patch)
+
+

New in version 8.0.1.

+
+

Compute the version number from the major, minor and patch numbers.

+
+ +
+
+PROJ_VERSION_NUMBER
+
+

New in version 8.0.1.

+
+

Total version number, equal to +PROJ_COMPUTE_VERSION(PROJ_VERSION_MAJOR, PROJ_VERSION_MINOR, PROJ_VERSION_PATCH)

+
+ +
+
+PROJ_AT_LEAST_VERSION(maj, min, patch)
+
+

New in version 8.0.1.

+
+

Macro that returns true if the current PROJ version is at least the version +specified by (maj,min,patch)

+

Equivalent to PROJ_VERSION_NUMBER >= PROJ_COMPUTE_VERSION(maj,min,patch)

+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file -- cgit v1.2.3