29 #ifndef COMMON_HH_INCLUDED 30 #define COMMON_HH_INCLUDED 37 #include "metadata.hpp" 80 PROJ_DLL
UnitOfMeasure(
const std::string &nameIn = std::string(),
81 double toSIIn = 1.0,
Type typeIn = Type::UNKNOWN,
82 const std::string &codeSpaceIn = std::string(),
83 const std::string &codeIn = std::string());
86 PROJ_DLL UnitOfMeasure(
const UnitOfMeasure &other);
87 PROJ_DLL ~UnitOfMeasure()
override;
88 PROJ_DLL UnitOfMeasure &operator=(
const UnitOfMeasure &other);
92 PROJ_DLL
const std::string &name() PROJ_PURE_DECL;
93 PROJ_DLL
double conversionToSI() PROJ_PURE_DECL;
94 PROJ_DLL
Type type() PROJ_PURE_DECL;
96 PROJ_DLL
const std::string &codeSpace() PROJ_PURE_DECL;
97 PROJ_DLL
const std::string &code() PROJ_PURE_DECL;
99 PROJ_DLL
bool operator==(
const UnitOfMeasure &other) PROJ_PURE_DECL;
100 PROJ_DLL
bool operator!=(
const UnitOfMeasure &other) PROJ_PURE_DECL;
104 const std::string &unitType = std::string())
107 std::string exportToPROJString()
const;
110 PROJ_DLL
static const UnitOfMeasure
NONE;
116 PROJ_DLL
static const UnitOfMeasure
METRE;
119 PROJ_DLL
static const UnitOfMeasure
RADIAN;
121 PROJ_DLL
static const UnitOfMeasure
DEGREE;
123 PROJ_DLL
static const UnitOfMeasure
GRAD;
126 PROJ_DLL
static const UnitOfMeasure
SECOND;
127 PROJ_DLL
static const UnitOfMeasure
YEAR;
130 PROJ_OPAQUE_PRIVATE_DATA
138 PROJ_DLL
Measure(
double valueIn = 0.0,
142 PROJ_DLL Measure(
const Measure &other);
147 PROJ_DLL
double getSIValue() PROJ_CONST_DECL;
148 PROJ_DLL
double value() PROJ_CONST_DECL;
151 convertToUnit(
const UnitOfMeasure &otherUnit) PROJ_CONST_DECL;
153 PROJ_DLL
bool operator==(
const Measure &other) PROJ_CONST_DECL;
156 isEquivalentTo(
const Measure &other,
158 util::IComparable::Criterion::STRICT)
const;
161 PROJ_OPAQUE_PRIVATE_DATA
162 Measure &operator=(
const Measure &) =
delete;
170 PROJ_DLL
explicit Scale(
double valueIn = 0.0);
171 PROJ_DLL
explicit Scale(
double valueIn,
const UnitOfMeasure &unitIn);
174 PROJ_DLL Scale(
const Scale &other);
175 PROJ_DLL ~Scale()
override;
179 PROJ_FRIEND_OPTIONAL(Scale);
180 Scale &operator=(
const Scale &) =
delete;
188 PROJ_DLL
explicit Angle(
double valueIn = 0.0);
192 PROJ_DLL Angle(
const Angle &other);
193 PROJ_DLL ~Angle()
override;
197 PROJ_FRIEND_OPTIONAL(Angle);
198 Angle &operator=(
const Angle &) =
delete;
206 PROJ_DLL
explicit Length(
double valueIn = 0.0);
207 PROJ_DLL Length(
double valueIn,
const UnitOfMeasure &unitIn);
210 PROJ_DLL Length(
const Length &other);
211 PROJ_DLL ~Length()
override;
215 PROJ_FRIEND_OPTIONAL(Length);
216 Length &operator=(
const Length &) =
delete;
227 PROJ_DLL ~DateTime();
230 PROJ_DLL
bool isISO_8601()
const;
231 PROJ_DLL std::string toString()
const;
233 PROJ_DLL
static DateTime
234 create(
const std::string &str);
238 PROJ_FRIEND_OPTIONAL(DateTime);
241 explicit DateTime(
const std::string &str);
242 DateTime &operator=(
const DateTime &other) =
delete;
244 PROJ_OPAQUE_PRIVATE_DATA
287 PROJ_DLL const std::
string &nameStr() PROJ_CONST_DECL;
288 PROJ_DLL const std::vector<metadata::IdentifierNNPtr> &
289 identifiers() PROJ_CONST_DECL;
290 PROJ_DLL const std::vector<util::GenericNameNNPtr> &
291 aliases() PROJ_CONST_DECL;
292 PROJ_DLL const std::
string &remarks() PROJ_CONST_DECL;
295 PROJ_DLL
bool isDeprecated() PROJ_CONST_DECL;
298 PROJ_DLL std::
string alias() PROJ_CONST_DECL;
299 PROJ_DLL
int getEPSGCode() PROJ_CONST_DECL;
300 PROJ_DLL
bool isEPSG(
int code) PROJ_CONST_DECL;
305 formatID(io::WKTFormatter *formatter) const;
306 void formatRemarks(io::WKTFormatter *formatter) const;
309 isEquivalentTo(const util::IComparable *other,
311 util::IComparable::
Criterion::STRICT) const override;
316 util::IComparable::
Criterion::STRICT) PROJ_CONST_DECL;
323 IdentifiedObject(const IdentifiedObject &other);
325 void setProperties(const util::PropertyMap
329 PROJ_OPAQUE_PRIVATE_DATA
330 IdentifiedObject &operator=(const IdentifiedObject &other) = delete;
345 class ObjectDomain : public util::BaseObject, public util::IComparable {
348 PROJ_DLL ~ObjectDomain()
override;
364 util::IComparable::Criterion::STRICT)
const override;
379 ObjectDomain(
const ObjectDomain &other);
383 PROJ_OPAQUE_PRIVATE_DATA
384 ObjectDomain &operator=(
const ObjectDomain &other) =
delete;
405 PROJ_DLL
const std::vector<ObjectDomainNNPtr> &domains() PROJ_CONST_DECL;
415 util::IComparable::Criterion::STRICT)
const override;
423 void baseExportToWKT(
427 PROJ_OPAQUE_PRIVATE_DATA
435 #endif // COMMON_HH_INCLUDED util::nn< UnitOfMeasurePtr > UnitOfMeasureNNPtr
Definition: common.hpp:54
static const std::string SCOPE_KEY
Key to set the scope of a common::ObjectUsage.
Definition: common.hpp:407
static const UnitOfMeasure PARTS_PER_MILLION
Parts-per-million, unit of measure of type SCALE.
Definition: common.hpp:113
Interface for an object that can be compared to another.
Definition: util.hpp:292
static const UnitOfMeasure YEAR
Year, unit of measure of type TIME.
Definition: common.hpp:127
static const UnitOfMeasure DEGREE
Degree, unit of measure of type ANGULAR.
Definition: common.hpp:121
static const UnitOfMeasure SCALE_UNITY
Scale unity, unit of measure of type SCALE.
Definition: common.hpp:112
std::shared_ptr< ObjectDomain > ObjectDomainPtr
Definition: common.hpp:337
static const UnitOfMeasure METRE
Metre, unit of measure of type LINEAR (SI unit).
Definition: common.hpp:116
static const UnitOfMeasure PPM_PER_YEAR
Part-sper-million per year, unit of measure of type SCALE.
Definition: common.hpp:114
Data epoch.
Definition: common.hpp:250
Numeric value associated with a UnitOfMeasure.
Definition: common.hpp:136
static const std::string OBJECT_DOMAIN_KEY
Key to set the object domain(s) of a common::ObjectUsage.
Definition: common.hpp:410
Usage of a CRS-related object.
Definition: common.hpp:399
static const UnitOfMeasure MICRORADIAN
Microradian, unit of measure of type ANGULAR.
Definition: common.hpp:120
static const std::string IDENTIFIERS_KEY
Key to set the identifier(s) of a common::IdentifiedObject.
Definition: common.hpp:280
Numeric value, with a linear unit of measure.
Definition: common.hpp:204
Criterion
Comparison criterion.
Definition: util.hpp:299
Date-time value, as a ISO:8601 encoded string, or other string encoding.
Definition: common.hpp:223
static const UnitOfMeasure SECOND
Second, unit of measure of type TIME (SI unit).
Definition: common.hpp:126
static const UnitOfMeasure GRAD
Grad, unit of measure of type ANGULAR.
Definition: common.hpp:123
static const std::string DEPRECATED_KEY
Key to set the deprecation flag of a common::IdentifiedObject.
Definition: common.hpp:283
static const UnitOfMeasure ARC_SECOND
Arc-second, unit of measure of type ANGULAR.
Definition: common.hpp:122
static const std::string ALIAS_KEY
Key to set the alias(es) of a common::IdentifiedObject.
Definition: common.hpp:281
static const std::string NAME_KEY
Key to set the name of a common::IdentifiedObject.
Definition: common.hpp:279
std::shared_ptr< UnitOfMeasure > UnitOfMeasurePtr
Definition: common.hpp:52
Wrapper of a std::map<std::string, BaseObjectNNPtr>
Definition: util.hpp:410
The scope and validity of a CRS-related object.
Definition: common.hpp:345
Class that can be derived from, to emulate Java's Object behaviour.
Definition: util.hpp:268
util::nn< ObjectUsagePtr > ObjectUsageNNPtr
Definition: common.hpp:393
util::nn< IdentifiedObjectPtr > IdentifiedObjectNNPtr
Definition: common.hpp:263
static const std::string DOMAIN_OF_VALIDITY_KEY
Key to set the domain of validity of a common::ObjectUsage.
Definition: common.hpp:408
static const std::string REMARKS_KEY
Key to set the remarks of a common::IdentifiedObject.
Definition: common.hpp:282
Numeric value, with a angular unit of measure.
Definition: common.hpp:186
std::shared_ptr< IdentifiedObject > IdentifiedObjectPtr
Definition: common.hpp:261
static const UnitOfMeasure METRE_PER_YEAR
Metre per year, unit of measure of type LINEAR.
Definition: common.hpp:117
static const UnitOfMeasure RADIAN
Radian, unit of measure of type ANGULAR (SI unit).
Definition: common.hpp:119
Numeric value, without a physical unit of measure.
Definition: common.hpp:168
Unit of measure.
Definition: common.hpp:60
Type
Type of unit of measure.
Definition: common.hpp:63
util::nn< ObjectDomainPtr > ObjectDomainNNPtr
Definition: common.hpp:339
Loose transposition of std::optional available from C++17.
Definition: util.hpp:178
static const UnitOfMeasure NONE
"Empty"/"None", unit of measure of type NONE.
Definition: common.hpp:110
static const UnitOfMeasure ARC_SECOND_PER_YEAR
Arc-second per year, unit of measure of type ANGULAR.
Definition: common.hpp:124
std::shared_ptr< ObjectUsage > ObjectUsagePtr
Definition: common.hpp:391
Identifications of a CRS-related object.
Definition: common.hpp:269