diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-08-09 17:10:20 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-08-09 17:41:23 +0200 |
| commit | f0d766e45640800412c08a7cb9ab4f8823d88d05 (patch) | |
| tree | 1973086c9f52043d61fb1a71cbbc1c3a794c3afc /include/proj | |
| parent | 81bd57dfd8cfae609288643d1b09a4805f1bcded (diff) | |
| download | PROJ-f0d766e45640800412c08a7cb9ab4f8823d88d05.tar.gz PROJ-f0d766e45640800412c08a7cb9ab4f8823d88d05.zip | |
PROJSJON: add import/export of VerticalCRS, CompoundCRS, BoundCRS, Transformation and ConcatenatedOperation
Diffstat (limited to 'include/proj')
| -rw-r--r-- | include/proj/coordinateoperation.hpp | 12 | ||||
| -rw-r--r-- | include/proj/crs.hpp | 103 | ||||
| -rw-r--r-- | include/proj/datum.hpp | 21 | ||||
| -rw-r--r-- | include/proj/internal/coordinateoperation_internal.hpp | 11 | ||||
| -rw-r--r-- | include/proj/io.hpp | 3 |
5 files changed, 124 insertions, 26 deletions
diff --git a/include/proj/coordinateoperation.hpp b/include/proj/coordinateoperation.hpp index 9b2dfe64..2f6095f7 100644 --- a/include/proj/coordinateoperation.hpp +++ b/include/proj/coordinateoperation.hpp @@ -116,7 +116,8 @@ using CoordinateOperationNNPtr = util::nn<CoordinateOperationPtr>; * \remark Implements CoordinateOperation from \ref ISO_19111_2019 */ class PROJ_GCC_DLL CoordinateOperation : public common::ObjectUsage, - public io::IPROJStringExportable { + public io::IPROJStringExportable, + public io::IJSONExportable { public: //! @cond Doxygen_Suppress PROJ_DLL ~CoordinateOperation() override; @@ -849,8 +850,7 @@ EPSG:8833 */ -class PROJ_GCC_DLL Conversion : public SingleOperation, - public io::IJSONExportable { +class PROJ_GCC_DLL Conversion : public SingleOperation { public: //! @cond Doxygen_Suppress PROJ_DLL ~Conversion() override; @@ -1550,6 +1550,9 @@ class PROJ_GCC_DLL Transformation : public SingleOperation { 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 TransformationNNPtr shallowClone() const; //! @endcond @@ -1655,6 +1658,9 @@ class PROJ_GCC_DLL ConcatenatedOperation final : public CoordinateOperation { util::IComparable::Criterion criterion = util::IComparable::Criterion::STRICT) const override; + PROJ_INTERNAL void _exportToJSON(io::JSONFormatter *formatter) + const override; // throw(FormattingException) + PROJ_INTERNAL static void fixStepsDirection(const crs::CRSNNPtr &concatOpSourceCRS, const crs::CRSNNPtr &concatOpTargetCRS, diff --git a/include/proj/crs.hpp b/include/proj/crs.hpp index 702b2d36..b83e0a6b 100644 --- a/include/proj/crs.hpp +++ b/include/proj/crs.hpp @@ -81,7 +81,8 @@ using CRSNNPtr = util::nn<CRSPtr>; * * \remark Implements CRS from \ref ISO_19111_2019 */ -class PROJ_GCC_DLL CRS : public common::ObjectUsage { +class PROJ_GCC_DLL CRS : public common::ObjectUsage, + public io::IJSONExportable { public: //! @cond Doxygen_Suppress PROJ_DLL ~CRS() override; @@ -211,8 +212,7 @@ using GeodeticCRSNNPtr = util::nn<GeodeticCRSPtr>; * \remark Implements GeodeticCRS from \ref ISO_19111_2019 */ class PROJ_GCC_DLL GeodeticCRS : virtual public SingleCRS, - public io::IPROJStringExportable, - public io::IJSONExportable { + public io::IPROJStringExportable { public: //! @cond Doxygen_Suppress PROJ_DLL ~GeodeticCRS() override; @@ -447,6 +447,12 @@ class PROJ_GCC_DLL VerticalCRS : virtual public SingleCRS, PROJ_INTERNAL void _exportToWKT(io::WKTFormatter *formatter) const override; // throw(io::FormattingException) + PROJ_INTERNAL void _exportToPROJString(io::PROJStringFormatter *formatter) + const override; // throw(FormattingException) + + PROJ_INTERNAL void _exportToJSON(io::JSONFormatter *formatter) + const override; // throw(FormattingException) + PROJ_INTERNAL bool _isEquivalentTo(const util::IComparable *other, util::IComparable::Criterion criterion = @@ -460,9 +466,6 @@ class PROJ_GCC_DLL VerticalCRS : virtual public SingleCRS, const cs::VerticalCSNNPtr &csIn); PROJ_INTERNAL VerticalCRS(const VerticalCRS &other); - PROJ_INTERNAL void _exportToPROJString(io::PROJStringFormatter *formatter) - const override; // throw(FormattingException) - PROJ_INTERNAL std::list<std::pair<CRSNNPtr, int>> _identify(const io::AuthorityFactoryPtr &authorityFactory) const override; @@ -502,6 +505,10 @@ class PROJ_GCC_DLL DerivedCRS : virtual public SingleCRS { //! @cond Doxygen_Suppress PROJ_INTERNAL const operation::ConversionNNPtr & derivingConversionRef() PROJ_PURE_DECL; + + PROJ_INTERNAL void _exportToJSON(io::JSONFormatter *formatter) + const override; // throw(FormattingException) + //! @endcond protected: @@ -522,6 +529,8 @@ class PROJ_GCC_DLL DerivedCRS : virtual public SingleCRS { util::IComparable::Criterion criterion = util::IComparable::Criterion::STRICT) const override; + PROJ_INTERNAL virtual const char *className() const = 0; + private: PROJ_OPAQUE_PRIVATE_DATA DerivedCRS &operator=(const DerivedCRS &other) = delete; @@ -553,8 +562,7 @@ using ProjectedCRSNNPtr = util::nn<ProjectedCRSPtr>; * \remark Implements ProjectedCRS from \ref ISO_19111_2019 */ class PROJ_GCC_DLL ProjectedCRS final : public DerivedCRS, - public io::IPROJStringExportable, - public io::IJSONExportable { + public io::IPROJStringExportable { public: //! @cond Doxygen_Suppress PROJ_DLL ~ProjectedCRS() override; @@ -607,6 +615,10 @@ class PROJ_GCC_DLL ProjectedCRS final : public DerivedCRS, PROJ_INTERNAL std::list<std::pair<CRSNNPtr, int>> _identify(const io::AuthorityFactoryPtr &authorityFactory) const override; + PROJ_INTERNAL const char *className() const override { + return "ProjectedCRS"; + } + INLINED_MAKE_SHARED PROJ_INTERNAL CRSNNPtr _shallowClone() const override; @@ -647,7 +659,11 @@ class PROJ_GCC_DLL TemporalCRS : virtual public SingleCRS { //! @cond Doxygen_Suppress PROJ_INTERNAL void _exportToWKT(io::WKTFormatter *formatter) const override; // throw(io::FormattingException) - //! @endcond + + PROJ_INTERNAL void _exportToJSON(io::JSONFormatter *formatter) + const override; // throw(FormattingException) + + //! @endcond protected: PROJ_INTERNAL TemporalCRS(const datum::TemporalDatumNNPtr &datumIn, @@ -704,7 +720,11 @@ class PROJ_GCC_DLL EngineeringCRS : virtual public SingleCRS { //! @cond Doxygen_Suppress PROJ_INTERNAL void _exportToWKT(io::WKTFormatter *formatter) const override; // throw(io::FormattingException) - //! @endcond + + PROJ_INTERNAL void _exportToJSON(io::JSONFormatter *formatter) + const override; // throw(FormattingException) + + //! @endcond protected: PROJ_INTERNAL EngineeringCRS(const datum::EngineeringDatumNNPtr &datumIn, @@ -760,7 +780,11 @@ class PROJ_GCC_DLL ParametricCRS : virtual public SingleCRS { //! @cond Doxygen_Suppress PROJ_INTERNAL void _exportToWKT(io::WKTFormatter *formatter) const override; // throw(io::FormattingException) - //! @endcond + + PROJ_INTERNAL void _exportToJSON(io::JSONFormatter *formatter) + const override; // throw(FormattingException) + + //! @endcond protected: PROJ_INTERNAL ParametricCRS(const datum::ParametricDatumNNPtr &datumIn, @@ -832,6 +856,9 @@ class PROJ_GCC_DLL CompoundCRS final : public CRS, PROJ_INTERNAL void _exportToPROJString(io::PROJStringFormatter *formatter) const override; // throw(FormattingException) + PROJ_INTERNAL void _exportToJSON(io::JSONFormatter *formatter) + const override; // throw(FormattingException) + PROJ_INTERNAL CRSNNPtr _shallowClone() const override; PROJ_INTERNAL bool @@ -917,6 +944,9 @@ class PROJ_GCC_DLL BoundCRS final : public CRS, PROJ_INTERNAL void _exportToPROJString(io::PROJStringFormatter *formatter) const override; // throw(FormattingException) + PROJ_INTERNAL void _exportToJSON(io::JSONFormatter *formatter) + const override; // throw(FormattingException) + PROJ_INTERNAL bool _isEquivalentTo(const util::IComparable *other, util::IComparable::Criterion criterion = @@ -977,9 +1007,12 @@ class PROJ_GCC_DLL DerivedGeodeticCRS final : public GeodeticCRS, void _exportToWKT(io::WKTFormatter *formatter) const override; // throw(io::FormattingException) - PROJ_INTERNAL void _exportToJSON(io::JSONFormatter *formatter) - const override; // throw(FormattingException) - //! @endcond + PROJ_INTERNAL void + _exportToJSON(io::JSONFormatter *formatter) const override { + return DerivedCRS::_exportToJSON(formatter); + } + + //! @endcond protected: PROJ_INTERNAL @@ -1006,6 +1039,10 @@ class PROJ_GCC_DLL DerivedGeodeticCRS final : public GeodeticCRS, PROJ_INTERNAL void _exportToPROJString(io::PROJStringFormatter *formatter) const override; // throw(FormattingException) + PROJ_INTERNAL const char *className() const override { + return "DerivedGeodeticCRS"; + } + INLINED_MAKE_SHARED private: @@ -1049,9 +1086,12 @@ class PROJ_GCC_DLL DerivedGeographicCRS final : public GeographicCRS, PROJ_INTERNAL void _exportToWKT(io::WKTFormatter *formatter) const override; // throw(io::FormattingException) - PROJ_INTERNAL void _exportToJSON(io::JSONFormatter *formatter) - const override; // throw(FormattingException) - //! @endcond + PROJ_INTERNAL void + _exportToJSON(io::JSONFormatter *formatter) const override { + return DerivedCRS::_exportToJSON(formatter); + } + + //! @endcond protected: PROJ_INTERNAL @@ -1070,6 +1110,10 @@ class PROJ_GCC_DLL DerivedGeographicCRS final : public GeographicCRS, PROJ_INTERNAL std::list<std::pair<CRSNNPtr, int>> _identify(const io::AuthorityFactoryPtr &authorityFactory) const override; + PROJ_INTERNAL const char *className() const override { + return "DerivedGeographicCRS"; + } + // cppcheck-suppress functionStatic PROJ_INTERNAL void _exportToPROJString(io::PROJStringFormatter *formatter) const override; // throw(FormattingException) @@ -1131,6 +1175,10 @@ class PROJ_GCC_DLL DerivedProjectedCRS final : public DerivedCRS { util::IComparable::Criterion criterion = util::IComparable::Criterion::STRICT) const override; + PROJ_INTERNAL const char *className() const override { + return "DerivedProjectedCRS"; + } + INLINED_MAKE_SHARED private: @@ -1170,7 +1218,13 @@ class PROJ_GCC_DLL DerivedVerticalCRS final : public VerticalCRS, //! @cond Doxygen_Suppress PROJ_INTERNAL void _exportToWKT(io::WKTFormatter *formatter) const override; // throw(io::FormattingException) - //! @endcond + + PROJ_INTERNAL void + _exportToJSON(io::JSONFormatter *formatter) const override { + return DerivedCRS::_exportToJSON(formatter); + } + + //! @endcond protected: PROJ_INTERNAL @@ -1189,6 +1243,10 @@ class PROJ_GCC_DLL DerivedVerticalCRS final : public VerticalCRS, PROJ_INTERNAL std::list<std::pair<CRSNNPtr, int>> _identify(const io::AuthorityFactoryPtr &authorityFactory) const override; + PROJ_INTERNAL const char *className() const override { + return "DerivedVerticalCRS"; + } + // cppcheck-suppress functionStatic PROJ_INTERNAL void _exportToPROJString(io::PROJStringFormatter *formatter) const override; // throw(FormattingException) @@ -1251,7 +1309,12 @@ class PROJ_GCC_DLL DerivedCRSTemplate final : public DerivedCRSTraits::BaseType, //! @cond Doxygen_Suppress PROJ_INTERNAL void _exportToWKT(io::WKTFormatter *formatter) const override; // throw(io::FormattingException) - //! @endcond + + PROJ_INTERNAL void + _exportToJSON(io::JSONFormatter *formatter) const override { + return DerivedCRS::_exportToJSON(formatter); + } + //! @endcond protected: PROJ_INTERNAL @@ -1267,6 +1330,8 @@ class PROJ_GCC_DLL DerivedCRSTemplate final : public DerivedCRSTraits::BaseType, util::IComparable::Criterion criterion = util::IComparable::Criterion::STRICT) const override; + PROJ_INTERNAL const char *className() const override; + INLINED_MAKE_SHARED private: diff --git a/include/proj/datum.hpp b/include/proj/datum.hpp index 00e56a1c..3724bfb1 100644 --- a/include/proj/datum.hpp +++ b/include/proj/datum.hpp @@ -61,7 +61,8 @@ namespace datum { * * \remark Implements Datum from \ref ISO_19111_2019 */ -class PROJ_GCC_DLL Datum : public common::ObjectUsage { +class PROJ_GCC_DLL Datum : public common::ObjectUsage, + public io::IJSONExportable { public: //! @cond Doxygen_Suppress PROJ_DLL ~Datum() override; @@ -379,8 +380,7 @@ using GeodeticReferenceFrameNNPtr = util::nn<GeodeticReferenceFramePtr>; * * \remark Implements GeodeticReferenceFrame from \ref ISO_19111_2019 */ -class PROJ_GCC_DLL GeodeticReferenceFrame : public Datum, - public io::IJSONExportable { +class PROJ_GCC_DLL GeodeticReferenceFrame : public Datum { public: //! @cond Doxygen_Suppress PROJ_DLL ~GeodeticReferenceFrame() override; @@ -566,7 +566,11 @@ class PROJ_GCC_DLL VerticalReferenceFrame : public Datum { PROJ_INTERNAL void _exportToWKT(io::WKTFormatter *formatter) const override; // throw(io::FormattingException) - //! @endcond + + PROJ_INTERNAL void _exportToJSON(io::JSONFormatter *formatter) + const override; // throw(FormattingException) + + //! @endcond protected: #ifdef DOXYGEN_ENABLED @@ -680,6 +684,9 @@ class PROJ_GCC_DLL TemporalDatum final : public Datum { 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 = @@ -728,6 +735,9 @@ class PROJ_GCC_DLL EngineeringDatum final : public Datum { 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 = @@ -772,6 +782,9 @@ class PROJ_GCC_DLL ParametricDatum final : public Datum { 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 = diff --git a/include/proj/internal/coordinateoperation_internal.hpp b/include/proj/internal/coordinateoperation_internal.hpp index 207c20b4..7ae2cd78 100644 --- a/include/proj/internal/coordinateoperation_internal.hpp +++ b/include/proj/internal/coordinateoperation_internal.hpp @@ -149,6 +149,10 @@ class InverseConversion : public Conversion, public InverseCoordinateOperation { Conversion::_exportToWKT(formatter); } + void _exportToJSON(io::JSONFormatter *formatter) const override { + Conversion::_exportToJSON(formatter); + } + void _exportToPROJString(io::PROJStringFormatter *formatter) const override { InverseCoordinateOperation::_exportToPROJString(formatter); @@ -200,6 +204,10 @@ class InverseTransformation : public Transformation, return InverseCoordinateOperation::_exportToPROJString(formatter); } + void _exportToJSON(io::JSONFormatter *formatter) const override { + Transformation::_exportToJSON(formatter); + } + bool _isEquivalentTo(const util::IComparable *other, util::IComparable::Criterion criterion = @@ -270,6 +278,9 @@ class PROJBasedOperation : public SingleOperation { void _exportToPROJString(io::PROJStringFormatter *formatter) const override; // throw(FormattingException) + void _exportToJSON(io::JSONFormatter *formatter) + const override; // throw(FormattingException) + CoordinateOperationNNPtr _shallowClone() const override; INLINED_MAKE_SHARED diff --git a/include/proj/io.hpp b/include/proj/io.hpp index 043b4c4b..66c1a4cd 100644 --- a/include/proj/io.hpp +++ b/include/proj/io.hpp @@ -505,6 +505,9 @@ class PROJ_GCC_DLL JSONFormatter { PROJ_INTERNAL void setOmitTypeInImmediateChild(); + PROJ_INTERNAL void setAbridgedTransformation(bool abriged); + PROJ_INTERNAL bool abridgedTransformation() const; + // cppcheck-suppress functionStatic PROJ_INTERNAL bool outputId() const; |
