common namespace¶
-
namespace
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
-
Angle
(double valueIn, const UnitOfMeasure &unitIn)¶ Instantiate a Angle.
- Parameters
valueIn
: valueunitIn
: unit. Constraint: unit.type() == UnitOfMeasure::Type::ANGULAR
-
-
class
DataEpoch
¶ - #include <common.hpp>
Data epoch.
-
class
DateTime
¶ - #include <common.hpp>
Date-time value, as a ISO:8601 encoded string, or other string encoding.
-
class
IdentifiedObject
: public osgeo::proj::util::BaseObject, public osgeo::proj::util::IComparable, public osgeo::proj::io::IWKTExportable¶ - #include <common.hpp>
Abstract class representating 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::DatumEnsemble, osgeo::proj::datum::Ellipsoid, osgeo::proj::datum::PrimeMeridian, osgeo::proj::operation::GeneralOperationParameter, osgeo::proj::operation::OperationMethod
Public Functions
-
const IdentifierNNPtr &
name
()¶ Return the name of the object.
Generally, the only interesting field of the name will be name()->description().
-
const std::vector<IdentifierNNPtr> &
identifiers
()¶ Return the identifier(s) of the object.
Generally, those will have Identifier::code() and Identifier::codeSpace() filled.
-
const std::vector<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.
- Return
code, or 0 if not found
Public Static Attributes
-
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.
-
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.
-
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.
-
const std::string
REMARKS_KEY
¶ Key to set the remarks of a common::IdentifiedObject.
The value is to be provided as a string.
-
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
-
Length
(double valueIn, const UnitOfMeasure &unitIn)¶ Instantiate a Length.
- Parameters
valueIn
: valueunitIn
: unit. Constraint: unit.type() == UnitOfMeasure::Type::LINEAR
-
-
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
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.
- Return
true if objects are equivalent.
- Parameters
other
: other object to compare tocriterion
: comparaison criterion.maxRelativeError
: Maximum relative error allowed.
Public Static Attributes
-
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 optional<std::string> &
scope
()¶ Return the scope.
- Return
the scope, or empty.
-
const ExtentPtr &
domainOfValidity
()¶ Return the domain of validity.
- Return
the domain of validity, or nullptr.
Public Static Functions
-
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::operation::CoordinateOperation
Public Functions
-
const std::vector<ObjectDomainNNPtr> &
domains
()¶ Return the domains of the object.
Public Static Attributes
-
const std::string
SCOPE_KEY
¶ Key to set the scope of a common::ObjectUsage.
The value is to be provided as a string.
-
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.
-
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
-
Scale
(double valueIn, const UnitOfMeasure &unitIn)¶ Instantiate a Scale.
- Parameters
valueIn
: valueunitIn
: unit. Constraint: unit.type() == UnitOfMeasure::Type::SCALE
-
-
class
UnitOfMeasure
: public osgeo::proj::util::BaseObject¶ - #include <common.hpp>
Unit of measure.
This is a mutable object.
Public Types
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)
- Return
the conversion factor, or 0 if no conversion exists.
-
UnitOfMeasure::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”
- Return
the code space, or empty string.
-
const std::string &
code
()¶ Return the code of the unit of measure.
- Return
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
-
const UnitOfMeasure
NONE
¶ “Empty”/”None”, unit of measure of type NONE.
-
const UnitOfMeasure
SCALE_UNITY
¶ Scale unity, unit of measure of type SCALE.
-
const UnitOfMeasure
PARTS_PER_MILLION
¶ Parts-per-million, unit of measure of type SCALE.
-
const UnitOfMeasure
PPM_PER_YEAR
¶ Part-sper-million per year, unit of measure of type SCALE.
-
const UnitOfMeasure
METRE
¶ Metre, unit of measure of type LINEAR (SI unit).
-
const UnitOfMeasure
METRE_PER_YEAR
¶ Metre per year, unit of measure of type LINEAR.
-
const UnitOfMeasure
RADIAN
¶ Radian, unit of measure of type ANGULAR (SI unit).
-
const UnitOfMeasure
MICRORADIAN
¶ Microradian, unit of measure of type ANGULAR.
-
const UnitOfMeasure
DEGREE
¶ Degree, unit of measure of type ANGULAR.
-
const UnitOfMeasure
ARC_SECOND
¶ Arc-second, unit of measure of type ANGULAR.
-
const UnitOfMeasure
GRAD
¶ Grad, unit of measure of type ANGULAR.
-
const UnitOfMeasure
ARC_SECOND_PER_YEAR
¶ Arc-second per year, unit of measure of type ANGULAR.
-
const UnitOfMeasure
SECOND
¶ Second, unit of measure of type TIME (SI unit).
-
const UnitOfMeasure
YEAR
¶ Year, unit of measure of type TIME.
-
-
typedef std::shared_ptr<UnitOfMeasure>