1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
|
/******************************************************************************
*
* Project: PROJ
* Purpose: ISO19111:2019 implementation
* Author: Even Rouault <even dot rouault at spatialys dot com>
*
******************************************************************************
* Copyright (c) 2018, Even Rouault <even dot rouault at spatialys dot com>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
****************************************************************************/
#ifndef DATUM_HH_INCLUDED
#define DATUM_HH_INCLUDED
#include <memory>
#include <string>
#include <vector>
#include "common.hpp"
#include "io.hpp"
#include "util.hpp"
NS_PROJ_START
/** osgeo.proj.datum namespace
\brief Datum (the relationship of a coordinate system to the body).
*/
namespace datum {
// ---------------------------------------------------------------------------
/** \brief 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 \ref ISO_19111_2019
*/
class PROJ_GCC_DLL Datum : public common::ObjectUsage,
public io::IJSONExportable {
public:
//! @cond Doxygen_Suppress
PROJ_DLL ~Datum() override;
//! @endcond
PROJ_DLL const util::optional<std::string> &anchorDefinition() const;
PROJ_DLL const util::optional<common::DateTime> &publicationDate() const;
PROJ_DLL const common::IdentifiedObjectPtr &conventionalRS() const;
//! @cond Doxygen_Suppress
PROJ_INTERNAL bool _isEquivalentTo(
const util::IComparable *other,
util::IComparable::Criterion criterion =
util::IComparable::Criterion::STRICT,
const io::DatabaseContextPtr &dbContext = nullptr) const override;
//! @endcond
protected:
PROJ_INTERNAL Datum();
#ifdef DOXYGEN_ENABLED
std::string *anchorDefinition_;
Date *publicationDate_;
common::IdentifiedObject *conventionalRS_;
#endif
protected:
PROJ_INTERNAL void setAnchor(const util::optional<std::string> &anchor);
PROJ_INTERNAL void
setProperties(const util::PropertyMap
&properties); // throw(InvalidValueTypeException)
private:
PROJ_OPAQUE_PRIVATE_DATA
Datum &operator=(const Datum &other) = delete;
Datum(const Datum &other) = delete;
};
/** Shared pointer of Datum */
using DatumPtr = std::shared_ptr<Datum>;
/** Non-null shared pointer of Datum */
using DatumNNPtr = util::nn<DatumPtr>;
// ---------------------------------------------------------------------------
class DatumEnsemble;
/** Shared pointer of DatumEnsemble */
using DatumEnsemblePtr = std::shared_ptr<DatumEnsemble>;
/** Non-null shared pointer of DatumEnsemble */
using DatumEnsembleNNPtr = util::nn<DatumEnsemblePtr>;
/** \brief 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 \ref ISO_19111_2019
*/
class PROJ_GCC_DLL DatumEnsemble final : public common::IdentifiedObject,
public io::IJSONExportable {
public:
//! @cond Doxygen_Suppress
PROJ_DLL ~DatumEnsemble() override;
//! @endcond
PROJ_DLL const std::vector<DatumNNPtr> &datums() const;
PROJ_DLL const metadata::PositionalAccuracyNNPtr &
positionalAccuracy() const;
PROJ_DLL static DatumEnsembleNNPtr create(
const util::PropertyMap &properties,
const std::vector<DatumNNPtr> &datumsIn,
const metadata::PositionalAccuracyNNPtr &accuracy); // throw(Exception)
//! @cond Doxygen_Suppress
PROJ_INTERNAL void _exportToWKT(io::WKTFormatter *formatter)
const override; // throw(io::FormattingException)
PROJ_INTERNAL void _exportToJSON(io::JSONFormatter *formatter)
const override; // throw(io::FormattingException)
//! @endcond
protected:
#ifdef DOXYGEN_ENABLED
Datum datums_[];
PositionalAccuracy positionalAccuracy_;
#endif
PROJ_INTERNAL
DatumEnsemble(const std::vector<DatumNNPtr> &datumsIn,
const metadata::PositionalAccuracyNNPtr &accuracy);
INLINED_MAKE_SHARED
private:
PROJ_OPAQUE_PRIVATE_DATA
DatumEnsemble(const DatumEnsemble &other) = delete;
DatumEnsemble &operator=(const DatumEnsemble &other) = delete;
};
// ---------------------------------------------------------------------------
class PrimeMeridian;
/** Shared pointer of PrimeMeridian */
using PrimeMeridianPtr = std::shared_ptr<PrimeMeridian>;
/** Non-null shared pointer of PrimeMeridian */
using PrimeMeridianNNPtr = util::nn<PrimeMeridianPtr>;
/** \brief The origin meridian from which longitude values are determined.
*
* \note The default value for prime meridian name is "Greenwich". When the
* default applies, the value for the longitude shall be 0 (degrees).
*
* \remark Implements PrimeMeridian from \ref ISO_19111_2019
*/
class PROJ_GCC_DLL PrimeMeridian final : public common::IdentifiedObject,
public io::IPROJStringExportable,
public io::IJSONExportable {
public:
//! @cond Doxygen_Suppress
PROJ_DLL ~PrimeMeridian() override;
//! @endcond
PROJ_DLL const common::Angle &longitude() PROJ_PURE_DECL;
// non-standard
PROJ_DLL static PrimeMeridianNNPtr
create(const util::PropertyMap &properties,
const common::Angle &longitudeIn);
PROJ_DLL static const PrimeMeridianNNPtr GREENWICH;
PROJ_DLL static const PrimeMeridianNNPtr REFERENCE_MERIDIAN;
PROJ_DLL static const PrimeMeridianNNPtr PARIS;
PROJ_PRIVATE :
//! @cond Doxygen_Suppress
PROJ_INTERNAL void
_exportToPROJString(io::PROJStringFormatter *formatter)
const override; // throw(FormattingException)
PROJ_INTERNAL void _exportToWKT(io::WKTFormatter *formatter)
const override; // throw(io::FormattingException)
PROJ_INTERNAL void _exportToJSON(io::JSONFormatter *formatter)
const override; // throw(io::FormattingException)
PROJ_INTERNAL bool _isEquivalentTo(
const util::IComparable *other,
util::IComparable::Criterion criterion =
util::IComparable::Criterion::STRICT,
const io::DatabaseContextPtr &dbContext = nullptr) const override;
PROJ_INTERNAL static std::string
getPROJStringWellKnownName(const common::Angle &angle);
//! @endcond
protected:
#ifdef DOXYGEN_ENABLED
Angle greenwichLongitude_;
#endif
PROJ_INTERNAL explicit PrimeMeridian(
const common::Angle &angle = common::Angle());
INLINED_MAKE_SHARED
private:
PROJ_OPAQUE_PRIVATE_DATA
PrimeMeridian(const PrimeMeridian &other) = delete;
PrimeMeridian &operator=(const PrimeMeridian &other) = delete;
PROJ_INTERNAL static const PrimeMeridianNNPtr createGREENWICH();
PROJ_INTERNAL static const PrimeMeridianNNPtr createREFERENCE_MERIDIAN();
PROJ_INTERNAL static const PrimeMeridianNNPtr createPARIS();
};
// ---------------------------------------------------------------------------
class Ellipsoid;
/** Shared pointer of Ellipsoid */
using EllipsoidPtr = std::shared_ptr<Ellipsoid>;
/** Non-null shared pointer of Ellipsoid */
using EllipsoidNNPtr = util::nn<EllipsoidPtr>;
/** \brief 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 \ref ISO_19111_2019
*/
class PROJ_GCC_DLL Ellipsoid final : public common::IdentifiedObject,
public io::IPROJStringExportable,
public io::IJSONExportable {
public:
//! @cond Doxygen_Suppress
PROJ_DLL ~Ellipsoid() override;
//! @endcond
PROJ_DLL const common::Length &semiMajorAxis() PROJ_PURE_DECL;
// Inlined from SecondDefiningParameter union
PROJ_DLL const util::optional<common::Scale> &
inverseFlattening() PROJ_PURE_DECL;
PROJ_DLL const util::optional<common::Length> &
semiMinorAxis() PROJ_PURE_DECL;
PROJ_DLL bool isSphere() PROJ_PURE_DECL;
PROJ_DLL const util::optional<common::Length> &
semiMedianAxis() PROJ_PURE_DECL;
// non-standard
PROJ_DLL double computedInverseFlattening() PROJ_PURE_DECL;
PROJ_DLL double squaredEccentricity() PROJ_PURE_DECL;
PROJ_DLL common::Length computeSemiMinorAxis() const;
PROJ_DLL const std::string &celestialBody() PROJ_PURE_DECL;
PROJ_DLL static const std::string EARTH;
PROJ_DLL static EllipsoidNNPtr
createSphere(const util::PropertyMap &properties,
const common::Length &radius,
const std::string &celestialBody = EARTH);
PROJ_DLL static EllipsoidNNPtr
createFlattenedSphere(const util::PropertyMap &properties,
const common::Length &semiMajorAxisIn,
const common::Scale &invFlattening,
const std::string &celestialBody = EARTH);
PROJ_DLL static EllipsoidNNPtr
createTwoAxis(const util::PropertyMap &properties,
const common::Length &semiMajorAxisIn,
const common::Length &semiMinorAxisIn,
const std::string &celestialBody = EARTH);
PROJ_DLL EllipsoidNNPtr identify() const;
PROJ_DLL static const EllipsoidNNPtr CLARKE_1866;
PROJ_DLL static const EllipsoidNNPtr WGS84;
PROJ_DLL static const EllipsoidNNPtr GRS1980;
PROJ_PRIVATE :
//! @cond Doxygen_Suppress
PROJ_INTERNAL void
_exportToWKT(io::WKTFormatter *formatter)
const override; // throw(io::FormattingException)
PROJ_INTERNAL void _exportToJSON(io::JSONFormatter *formatter)
const override; // throw(io::FormattingException)
PROJ_INTERNAL bool _isEquivalentTo(
const util::IComparable *other,
util::IComparable::Criterion criterion =
util::IComparable::Criterion::STRICT,
const io::DatabaseContextPtr &dbContext = nullptr) const override;
PROJ_INTERNAL void _exportToPROJString(io::PROJStringFormatter *formatter)
const override; // throw(FormattingException)
//! @endcond
PROJ_INTERNAL static std::string
guessBodyName(const io::DatabaseContextPtr &dbContext, double a);
PROJ_INTERNAL bool lookForProjWellKnownEllps(std::string &projEllpsName,
std::string &ellpsName) const;
protected:
#ifdef DOXYGEN_ENABLED
common::Length semiMajorAxis_;
common::Scale *inverseFlattening_;
common::Length *semiMinorAxis_;
bool isSphere_;
common::Length *semiMedianAxis_;
#endif
PROJ_INTERNAL explicit Ellipsoid(const common::Length &radius,
const std::string &celestialBody);
PROJ_INTERNAL Ellipsoid(const common::Length &semiMajorAxisIn,
const common::Scale &invFlattening,
const std::string &celestialBody);
PROJ_INTERNAL Ellipsoid(const common::Length &semiMajorAxisIn,
const common::Length &semiMinorAxisIn,
const std::string &celestialBody);
PROJ_INTERNAL Ellipsoid(const Ellipsoid &other);
INLINED_MAKE_SHARED
PROJ_INTERNAL static const EllipsoidNNPtr createCLARKE_1866();
PROJ_INTERNAL static const EllipsoidNNPtr createWGS84();
PROJ_INTERNAL static const EllipsoidNNPtr createGRS1980();
private:
PROJ_OPAQUE_PRIVATE_DATA
Ellipsoid &operator=(const Ellipsoid &other) = delete;
};
// ---------------------------------------------------------------------------
class GeodeticReferenceFrame;
/** Shared pointer of GeodeticReferenceFrame */
using GeodeticReferenceFramePtr = std::shared_ptr<GeodeticReferenceFrame>;
/** Non-null shared pointer of GeodeticReferenceFrame */
using GeodeticReferenceFrameNNPtr = util::nn<GeodeticReferenceFramePtr>;
/** \brief 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.
*
* \note The terminology "Datum" is often used to mean a GeodeticReferenceFrame.
*
* \note In \ref ISO_19111_2007, this class was called GeodeticDatum.
*
* \remark Implements GeodeticReferenceFrame from \ref ISO_19111_2019
*/
class PROJ_GCC_DLL GeodeticReferenceFrame : public Datum {
public:
//! @cond Doxygen_Suppress
PROJ_DLL ~GeodeticReferenceFrame() override;
//! @endcond
PROJ_DLL const PrimeMeridianNNPtr &primeMeridian() PROJ_PURE_DECL;
// We constraint more than the standard into which the ellipsoid might
// be omitted for a CRS with a non-ellipsoidal CS
PROJ_DLL const EllipsoidNNPtr &ellipsoid() PROJ_PURE_DECL;
// non-standard
PROJ_DLL static GeodeticReferenceFrameNNPtr
create(const util::PropertyMap &properties, const EllipsoidNNPtr &ellipsoid,
const util::optional<std::string> &anchor,
const PrimeMeridianNNPtr &primeMeridian);
PROJ_DLL static const GeodeticReferenceFrameNNPtr
EPSG_6267; // North American Datum 1927
PROJ_DLL static const GeodeticReferenceFrameNNPtr
EPSG_6269; // North American Datum 1983
PROJ_DLL static const GeodeticReferenceFrameNNPtr EPSG_6326; // WGS 84
//! @cond Doxygen_Suppress
PROJ_INTERNAL void _exportToWKT(io::WKTFormatter *formatter)
const override; // throw(io::FormattingException)
PROJ_INTERNAL void _exportToJSON(io::JSONFormatter *formatter)
const override; // throw(FormattingException)
PROJ_INTERNAL bool _isEquivalentTo(
const util::IComparable *other,
util::IComparable::Criterion criterion =
util::IComparable::Criterion::STRICT,
const io::DatabaseContextPtr &dbContext = nullptr) const override;
//! @endcond
protected:
#ifdef DOXYGEN_ENABLED
PrimeMeridian primeMeridian_;
Ellipsoid *ellipsoid_;
#endif
PROJ_INTERNAL
GeodeticReferenceFrame(const EllipsoidNNPtr &ellipsoidIn,
const PrimeMeridianNNPtr &primeMeridianIn);
INLINED_MAKE_SHARED
PROJ_INTERNAL static const GeodeticReferenceFrameNNPtr createEPSG_6267();
PROJ_INTERNAL static const GeodeticReferenceFrameNNPtr createEPSG_6269();
PROJ_INTERNAL static const GeodeticReferenceFrameNNPtr createEPSG_6326();
bool hasEquivalentNameToUsingAlias(
const IdentifiedObject *other,
const io::DatabaseContextPtr &dbContext) const override;
private:
PROJ_OPAQUE_PRIVATE_DATA
GeodeticReferenceFrame(const GeodeticReferenceFrame &other) = delete;
GeodeticReferenceFrame &
operator=(const GeodeticReferenceFrame &other) = delete;
};
// ---------------------------------------------------------------------------
class DynamicGeodeticReferenceFrame;
/** Shared pointer of DynamicGeodeticReferenceFrame */
using DynamicGeodeticReferenceFramePtr =
std::shared_ptr<DynamicGeodeticReferenceFrame>;
/** Non-null shared pointer of DynamicGeodeticReferenceFrame */
using DynamicGeodeticReferenceFrameNNPtr =
util::nn<DynamicGeodeticReferenceFramePtr>;
/** \brief 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 \ref ISO_19111_2019
*/
class PROJ_GCC_DLL DynamicGeodeticReferenceFrame final
: public GeodeticReferenceFrame {
public:
//! @cond Doxygen_Suppress
PROJ_DLL ~DynamicGeodeticReferenceFrame() override;
//! @endcond
PROJ_DLL const common::Measure &frameReferenceEpoch() const;
PROJ_DLL const util::optional<std::string> &deformationModelName() const;
// non-standard
PROJ_DLL 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);
//! @cond Doxygen_Suppress
PROJ_INTERNAL bool _isEquivalentTo(
const util::IComparable *other,
util::IComparable::Criterion criterion =
util::IComparable::Criterion::STRICT,
const io::DatabaseContextPtr &dbContext = nullptr) const override;
PROJ_INTERNAL void _exportToWKT(io::WKTFormatter *formatter)
const override; // throw(io::FormattingException)
//! @endcond
protected:
#ifdef DOXYGEN_ENABLED
Measure frameReferenceEpoch_;
#endif
PROJ_INTERNAL DynamicGeodeticReferenceFrame(
const EllipsoidNNPtr &ellipsoidIn,
const PrimeMeridianNNPtr &primeMeridianIn,
const common::Measure &frameReferenceEpochIn,
const util::optional<std::string> &deformationModelNameIn);
INLINED_MAKE_SHARED
private:
PROJ_OPAQUE_PRIVATE_DATA
DynamicGeodeticReferenceFrame(const DynamicGeodeticReferenceFrame &other) =
delete;
DynamicGeodeticReferenceFrame &
operator=(const DynamicGeodeticReferenceFrame &other) = delete;
};
// ---------------------------------------------------------------------------
/** \brief The specification of the method by which the vertical reference frame
* is realized.
*
* \remark Implements RealizationMethod from \ref ISO_19111_2019
*/
class PROJ_GCC_DLL RealizationMethod : public util::CodeList {
public:
PROJ_DLL static const RealizationMethod LEVELLING;
PROJ_DLL static const RealizationMethod GEOID;
PROJ_DLL static const RealizationMethod TIDAL;
private:
PROJ_FRIEND_OPTIONAL(RealizationMethod);
PROJ_DLL explicit RealizationMethod(
const std::string &nameIn = std::string());
PROJ_DLL RealizationMethod(const RealizationMethod &other);
PROJ_DLL RealizationMethod &operator=(const RealizationMethod &other);
};
// ---------------------------------------------------------------------------
class VerticalReferenceFrame;
/** Shared pointer of VerticalReferenceFrame */
using VerticalReferenceFramePtr = std::shared_ptr<VerticalReferenceFrame>;
/** Non-null shared pointer of VerticalReferenceFrame */
using VerticalReferenceFrameNNPtr = util::nn<VerticalReferenceFramePtr>;
/** \brief 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.
*
* \note In \ref ISO_19111_2007, this class was called VerticalDatum.
* \remark Implements VerticalReferenceFrame from \ref ISO_19111_2019
*/
class PROJ_GCC_DLL VerticalReferenceFrame : public Datum {
public:
//! @cond Doxygen_Suppress
PROJ_DLL ~VerticalReferenceFrame() override;
//! @endcond
PROJ_DLL const util::optional<RealizationMethod> &realizationMethod() const;
// non-standard
PROJ_DLL 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>());
//! @cond Doxygen_Suppress
PROJ_INTERNAL bool _isEquivalentTo(
const util::IComparable *other,
util::IComparable::Criterion criterion =
util::IComparable::Criterion::STRICT,
const io::DatabaseContextPtr &dbContext = nullptr) const override;
PROJ_INTERNAL void _exportToWKT(io::WKTFormatter *formatter)
const override; // throw(io::FormattingException)
PROJ_INTERNAL void _exportToJSON(io::JSONFormatter *formatter)
const override; // throw(FormattingException)
//! @endcond
protected:
#ifdef DOXYGEN_ENABLED
RealizationMethod realizationMethod_;
#endif
PROJ_INTERNAL explicit VerticalReferenceFrame(
const util::optional<RealizationMethod> &realizationMethodIn);
INLINED_MAKE_SHARED
private:
PROJ_OPAQUE_PRIVATE_DATA
};
// ---------------------------------------------------------------------------
class DynamicVerticalReferenceFrame;
/** Shared pointer of DynamicVerticalReferenceFrame */
using DynamicVerticalReferenceFramePtr =
std::shared_ptr<DynamicVerticalReferenceFrame>;
/** Non-null shared pointer of DynamicVerticalReferenceFrame */
using DynamicVerticalReferenceFrameNNPtr =
util::nn<DynamicVerticalReferenceFramePtr>;
/** \brief 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 \ref ISO_19111_2019
*/
class PROJ_GCC_DLL DynamicVerticalReferenceFrame final
: public VerticalReferenceFrame {
public:
//! @cond Doxygen_Suppress
PROJ_DLL ~DynamicVerticalReferenceFrame() override;
//! @endcond
PROJ_DLL const common::Measure &frameReferenceEpoch() const;
PROJ_DLL const util::optional<std::string> &deformationModelName() const;
// non-standard
PROJ_DLL 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);
//! @cond Doxygen_Suppress
PROJ_INTERNAL bool _isEquivalentTo(
const util::IComparable *other,
util::IComparable::Criterion criterion =
util::IComparable::Criterion::STRICT,
const io::DatabaseContextPtr &dbContext = nullptr) const override;
PROJ_INTERNAL void _exportToWKT(io::WKTFormatter *formatter)
const override; // throw(io::FormattingException)
//! @endcond
protected:
#ifdef DOXYGEN_ENABLED
Measure frameReferenceEpoch_;
#endif
PROJ_INTERNAL DynamicVerticalReferenceFrame(
const util::optional<RealizationMethod> &realizationMethodIn,
const common::Measure &frameReferenceEpochIn,
const util::optional<std::string> &deformationModelNameIn);
INLINED_MAKE_SHARED
private:
PROJ_OPAQUE_PRIVATE_DATA
DynamicVerticalReferenceFrame(const DynamicVerticalReferenceFrame &other) =
delete;
DynamicVerticalReferenceFrame &
operator=(const DynamicVerticalReferenceFrame &other) = delete;
};
// ---------------------------------------------------------------------------
class TemporalDatum;
/** Shared pointer of TemporalDatum */
using TemporalDatumPtr = std::shared_ptr<TemporalDatum>;
/** Non-null shared pointer of TemporalDatum */
using TemporalDatumNNPtr = util::nn<TemporalDatumPtr>;
/** \brief 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 \ref ISO_19111_2019
*/
class PROJ_GCC_DLL TemporalDatum final : public Datum {
public:
//! @cond Doxygen_Suppress
PROJ_DLL ~TemporalDatum() override;
//! @endcond
PROJ_DLL const common::DateTime &temporalOrigin() const;
PROJ_DLL const std::string &calendar() const;
PROJ_DLL static const std::string CALENDAR_PROLEPTIC_GREGORIAN;
// non-standard
PROJ_DLL static TemporalDatumNNPtr
create(const util::PropertyMap &properties,
const common::DateTime &temporalOriginIn,
const std::string &calendarIn);
//! @cond Doxygen_Suppress
PROJ_INTERNAL void _exportToWKT(io::WKTFormatter *formatter)
const override; // throw(io::FormattingException)
PROJ_INTERNAL void _exportToJSON(io::JSONFormatter *formatter)
const override; // throw(FormattingException)
PROJ_INTERNAL bool _isEquivalentTo(
const util::IComparable *other,
util::IComparable::Criterion criterion =
util::IComparable::Criterion::STRICT,
const io::DatabaseContextPtr &dbContext = nullptr) const override;
//! @endcond
protected:
PROJ_INTERNAL TemporalDatum(const common::DateTime &temporalOriginIn,
const std::string &calendarIn);
INLINED_MAKE_SHARED
private:
PROJ_OPAQUE_PRIVATE_DATA
};
// ---------------------------------------------------------------------------
class EngineeringDatum;
/** Shared pointer of EngineeringDatum */
using EngineeringDatumPtr = std::shared_ptr<EngineeringDatum>;
/** Non-null shared pointer of EngineeringDatum */
using EngineeringDatumNNPtr = util::nn<EngineeringDatumPtr>;
/** \brief The definition of the origin and orientation of an engineering
* coordinate reference system.
*
* \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.
*
* \remark Implements EngineeringDatum from \ref ISO_19111_2019
*/
class PROJ_GCC_DLL EngineeringDatum final : public Datum {
public:
//! @cond Doxygen_Suppress
PROJ_DLL ~EngineeringDatum() override;
//! @endcond
// non-standard
PROJ_DLL static EngineeringDatumNNPtr
create(const util::PropertyMap &properties,
const util::optional<std::string> &anchor =
util::optional<std::string>());
//! @cond Doxygen_Suppress
PROJ_INTERNAL void _exportToWKT(io::WKTFormatter *formatter)
const override; // throw(io::FormattingException)
PROJ_INTERNAL void _exportToJSON(io::JSONFormatter *formatter)
const override; // throw(FormattingException)
PROJ_INTERNAL bool _isEquivalentTo(
const util::IComparable *other,
util::IComparable::Criterion criterion =
util::IComparable::Criterion::STRICT,
const io::DatabaseContextPtr &dbContext = nullptr) const override;
//! @endcond
protected:
PROJ_INTERNAL EngineeringDatum();
INLINED_MAKE_SHARED
private:
PROJ_OPAQUE_PRIVATE_DATA
};
// ---------------------------------------------------------------------------
class ParametricDatum;
/** Shared pointer of ParametricDatum */
using ParametricDatumPtr = std::shared_ptr<ParametricDatum>;
/** Non-null shared pointer of ParametricDatum */
using ParametricDatumNNPtr = util::nn<ParametricDatumPtr>;
/** \brief 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 \ref ISO_19111_2019
*/
class PROJ_GCC_DLL ParametricDatum final : public Datum {
public:
//! @cond Doxygen_Suppress
PROJ_DLL ~ParametricDatum() override;
//! @endcond
// non-standard
PROJ_DLL static ParametricDatumNNPtr
create(const util::PropertyMap &properties,
const util::optional<std::string> &anchor =
util::optional<std::string>());
//! @cond Doxygen_Suppress
PROJ_INTERNAL void _exportToWKT(io::WKTFormatter *formatter)
const override; // throw(io::FormattingException)
PROJ_INTERNAL void _exportToJSON(io::JSONFormatter *formatter)
const override; // throw(FormattingException)
PROJ_INTERNAL bool _isEquivalentTo(
const util::IComparable *other,
util::IComparable::Criterion criterion =
util::IComparable::Criterion::STRICT,
const io::DatabaseContextPtr &dbContext = nullptr) const override;
//! @endcond
protected:
PROJ_INTERNAL ParametricDatum();
INLINED_MAKE_SHARED
private:
PROJ_OPAQUE_PRIVATE_DATA
};
} // namespace datum
NS_PROJ_END
#endif // DATUM_HH_INCLUDED
|