diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/proj/crs.hpp | 11 | ||||
| -rw-r--r-- | include/proj/internal/coordinateoperation_constants.hpp | 41 | ||||
| -rw-r--r-- | include/proj/io.hpp | 18 | ||||
| -rw-r--r-- | include/proj/util.hpp | 8 |
4 files changed, 78 insertions, 0 deletions
diff --git a/include/proj/crs.hpp b/include/proj/crs.hpp index b607ff9d..8c1f9f6f 100644 --- a/include/proj/crs.hpp +++ b/include/proj/crs.hpp @@ -155,6 +155,11 @@ class PROJ_GCC_DLL CRS : public common::ObjectUsage, const; PROJ_INTERNAL bool hasImplicitCS() const; + + PROJ_INTERNAL static CRSNNPtr + getResolvedCRS(const CRSNNPtr &crs, + const io::AuthorityFactoryPtr &authFactory, + metadata::ExtentPtr &extentOut); //! @endcond protected: @@ -335,6 +340,11 @@ class PROJ_GCC_DLL GeodeticCRS : virtual public SingleCRS, PROJ_INTERNAL std::list<std::pair<CRSNNPtr, int>> _identify(const io::AuthorityFactoryPtr &authorityFactory) const override; + PROJ_INTERNAL bool + _isEquivalentToNoTypeCheck(const util::IComparable *other, + util::IComparable::Criterion criterion, + const io::DatabaseContextPtr &dbContext) const; + INLINED_MAKE_SHARED private: @@ -1400,6 +1410,7 @@ class PROJ_GCC_DLL DerivedCRSTemplate final : public DerivedCRSTraits::BaseType, DerivedCRSTemplate(const BaseNNPtr &baseCRSIn, const operation::ConversionNNPtr &derivingConversionIn, const CSNNPtr &csIn); + // cppcheck-suppress noExplicitConstructor PROJ_INTERNAL DerivedCRSTemplate(const DerivedCRSTemplate &other); PROJ_INTERNAL CRSNNPtr _shallowClone() const override; diff --git a/include/proj/internal/coordinateoperation_constants.hpp b/include/proj/internal/coordinateoperation_constants.hpp index 592f6263..0ed3a027 100644 --- a/include/proj/internal/coordinateoperation_constants.hpp +++ b/include/proj/internal/coordinateoperation_constants.hpp @@ -532,6 +532,34 @@ static const ParamMapping *const paramsColombiaUrban[] = { ¶mProjectionPlaneOriginHeight, nullptr}; +static const ParamMapping paramGeocentricXTopocentricOrigin = { + EPSG_NAME_PARAMETER_GEOCENTRIC_X_TOPOCENTRIC_ORIGIN, + EPSG_CODE_PARAMETER_GEOCENTRIC_X_TOPOCENTRIC_ORIGIN, nullptr, + common::UnitOfMeasure::Type::LINEAR, "X_0"}; + +static const ParamMapping paramGeocentricYTopocentricOrigin = { + EPSG_NAME_PARAMETER_GEOCENTRIC_Y_TOPOCENTRIC_ORIGIN, + EPSG_CODE_PARAMETER_GEOCENTRIC_Y_TOPOCENTRIC_ORIGIN, nullptr, + common::UnitOfMeasure::Type::LINEAR, "Y_0"}; + +static const ParamMapping paramGeocentricZTopocentricOrigin = { + EPSG_NAME_PARAMETER_GEOCENTRIC_Z_TOPOCENTRIC_ORIGIN, + EPSG_CODE_PARAMETER_GEOCENTRIC_Z_TOPOCENTRIC_ORIGIN, nullptr, + common::UnitOfMeasure::Type::LINEAR, "Z_0"}; + +static const ParamMapping *const paramsGeocentricTopocentric[] = { + ¶mGeocentricXTopocentricOrigin, ¶mGeocentricYTopocentricOrigin, + ¶mGeocentricZTopocentricOrigin, nullptr}; + +static const ParamMapping paramHeightTopoOriginWithH0 = { + EPSG_NAME_PARAMETER_ELLIPSOIDAL_HEIGHT_TOPOCENTRIC_ORIGIN, + EPSG_CODE_PARAMETER_ELLIPSOIDAL_HEIGHT_TOPOCENTRIC_ORIGIN, nullptr, + common::UnitOfMeasure::Type::LINEAR, "h_0"}; + +static const ParamMapping *const paramsGeographicTopocentric[] = { + ¶mLatTopoOrigin, ¶mLonTopoOrigin, ¶mHeightTopoOriginWithH0, + nullptr}; + static const MethodMapping projectionMethodMappings[] = { {EPSG_NAME_METHOD_TRANSVERSE_MERCATOR, EPSG_CODE_METHOD_TRANSVERSE_MERCATOR, "Transverse_Mercator", "tmerc", nullptr, paramsNatOriginScaleK}, @@ -836,6 +864,14 @@ static const MethodMapping projectionMethodMappings[] = { {EPSG_NAME_METHOD_COLOMBIA_URBAN, EPSG_CODE_METHOD_COLOMBIA_URBAN, nullptr, "col_urban", nullptr, paramsColombiaUrban}, + + {EPSG_NAME_METHOD_GEOCENTRIC_TOPOCENTRIC, + EPSG_CODE_METHOD_GEOCENTRIC_TOPOCENTRIC, nullptr, "topocentric", nullptr, + paramsGeocentricTopocentric}, + + {EPSG_NAME_METHOD_GEOGRAPHIC_TOPOCENTRIC, + EPSG_CODE_METHOD_GEOGRAPHIC_TOPOCENTRIC, nullptr, nullptr, nullptr, + paramsGeographicTopocentric}, }; #define METHOD_NAME_CODE(method) \ @@ -878,6 +914,8 @@ static const struct MethodNameCode { METHOD_NAME_CODE(AXIS_ORDER_REVERSAL_2D), METHOD_NAME_CODE(AXIS_ORDER_REVERSAL_3D), METHOD_NAME_CODE(GEOGRAPHIC_GEOCENTRIC), + METHOD_NAME_CODE(GEOCENTRIC_TOPOCENTRIC), + METHOD_NAME_CODE(GEOGRAPHIC_TOPOCENTRIC), // Transformations METHOD_NAME_CODE(LONGITUDE_ROTATION), METHOD_NAME_CODE(AFFINE_PARAMETRIC_TRANSFORMATION), @@ -943,6 +981,9 @@ static const struct ParamNameCode { PARAM_NAME_CODE(LONGITUDE_OF_ORIGIN), PARAM_NAME_CODE(ELLIPSOID_SCALE_FACTOR), PARAM_NAME_CODE(PROJECTION_PLANE_ORIGIN_HEIGHT), + PARAM_NAME_CODE(GEOCENTRIC_X_TOPOCENTRIC_ORIGIN), + PARAM_NAME_CODE(GEOCENTRIC_Y_TOPOCENTRIC_ORIGIN), + PARAM_NAME_CODE(GEOCENTRIC_Z_TOPOCENTRIC_ORIGIN), // Parameters of transformations PARAM_NAME_CODE(SEMI_MAJOR_AXIS_DIFFERENCE), PARAM_NAME_CODE(FLATTENING_DIFFERENCE), diff --git a/include/proj/io.hpp b/include/proj/io.hpp index 20dcedfe..bc11c220 100644 --- a/include/proj/io.hpp +++ b/include/proj/io.hpp @@ -243,6 +243,10 @@ class PROJ_GCC_DLL WKTFormatter { PROJ_DLL WKTFormatter &setStrict(bool strict) noexcept; PROJ_DLL bool isStrict() const noexcept; + PROJ_DLL WKTFormatter & + setAllowEllipsoidalHeightAsVerticalCRS(bool allow) noexcept; + PROJ_DLL bool isAllowedEllipsoidalHeightAsVerticalCRS() const noexcept; + PROJ_DLL const std::string &toString() const; PROJ_PRIVATE : @@ -1032,6 +1036,8 @@ class PROJ_GCC_DLL AuthorityFactory { DYNAMIC_GEODETIC_REFERENCE_FRAME, /** Object of type datum::DynamicVerticalReferenceFrame */ DYNAMIC_VERTICAL_REFERENCE_FRAME, + /** Object of type datum::DatumEnsemble */ + DATUM_ENSEMBLE, }; PROJ_DLL std::set<std::string> @@ -1225,6 +1231,18 @@ class PROJ_GCC_DLL AuthorityFactory { private: PROJ_OPAQUE_PRIVATE_DATA + + PROJ_INTERNAL void + createGeodeticDatumOrEnsemble(const std::string &code, + datum::GeodeticReferenceFramePtr &outDatum, + datum::DatumEnsemblePtr &outDatumEnsemble, + bool turnEnsembleAsDatum) const; + + PROJ_INTERNAL void + createVerticalDatumOrEnsemble(const std::string &code, + datum::VerticalReferenceFramePtr &outDatum, + datum::DatumEnsemblePtr &outDatumEnsemble, + bool turnEnsembleAsDatum) const; }; // --------------------------------------------------------------------------- diff --git a/include/proj/util.hpp b/include/proj/util.hpp index 3d85e579..2ada4f79 100644 --- a/include/proj/util.hpp +++ b/include/proj/util.hpp @@ -213,6 +213,14 @@ template <typename T> using nn_shared_ptr = nn<std::shared_ptr<T>>; // To avoid formatting differences between clang-format 3.8 and 7 #define PROJ_NOEXCEPT noexcept +//! @cond Doxygen_Suppress +// isOfExactType<MyType>(*p) checks that the type of *p is exactly MyType +template <typename TemplateT, typename ObjectT> +inline bool isOfExactType(const ObjectT &o) { + return typeid(TemplateT).hash_code() == typeid(o).hash_code(); +} +//! @endcond + /** \brief Loose transposition of [std::optional] * (https://en.cppreference.com/w/cpp/utility/optional) available from C++17. */ template <class T> class optional { |
