diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-11-21 13:55:11 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-11-21 15:25:41 +0100 |
| commit | c3a50e53841e0c4ecd5571fea826ab0e3e36e0e9 (patch) | |
| tree | 598f3b1059c2a9b443e5d23d52542749b8bfe1d5 /include | |
| parent | 03853d63aee498e79735551a480dfb7b9d71b22c (diff) | |
| download | PROJ-c3a50e53841e0c4ecd5571fea826ab0e3e36e0e9.tar.gz PROJ-c3a50e53841e0c4ecd5571fea826ab0e3e36e0e9.zip | |
Make GeographicCRS/GeodeticCRS::isEquivalentTo() work properly when comparing to a DerivedGeographicCRS/DerivedGeodeticCRS
Diffstat (limited to 'include')
| -rw-r--r-- | include/proj/crs.hpp | 5 | ||||
| -rw-r--r-- | include/proj/util.hpp | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/include/proj/crs.hpp b/include/proj/crs.hpp index ec755728..b921f4bb 100644 --- a/include/proj/crs.hpp +++ b/include/proj/crs.hpp @@ -340,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: 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 { |
