diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2022-03-16 00:15:16 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2022-03-16 00:15:24 +0100 |
| commit | fdf5111a9a790926aacec75a07d30508a8ed9c91 (patch) | |
| tree | a7765015f4f59914c71a596b985f0c6b8b73ee51 /include | |
| parent | 50ca95d01001710921ba36ce5deff712deec3f2e (diff) | |
| download | PROJ-fdf5111a9a790926aacec75a07d30508a8ed9c91.tar.gz PROJ-fdf5111a9a790926aacec75a07d30508a8ed9c91.zip | |
Fix comparison of GeodeticRefrenceFrame vs DynamicGeodeticReferenceFrame
If comparing a DynamicGeodeticReferenceFrame object and its export to
WKT1, which is a simple DATUM object, currently in non-strict comparison
mode, we'd consider the datum to be equivalent to the dynamic datum, but
not the reverse, which breaks the symmetric property of the
isEquivalentTo() operation. So fix this, to consider both equivalent
whatever the operand order.
(in strict mode, the objects will be considered different of course)
Spotted in the GDAL GeoTIFF CRS reader code:
https://github.com/OSGeo/gdal/blob/f9d48bdcc8c90df20e53b5af5785f1e5d78910db/frmts/gtiff/gt_wkt_srs.cpp#L832
Do same change for vertical datum vs dynamic vertical datum.
Diffstat (limited to 'include')
| -rw-r--r-- | include/proj/datum.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/proj/datum.hpp b/include/proj/datum.hpp index bf3dbcb7..ad388908 100644 --- a/include/proj/datum.hpp +++ b/include/proj/datum.hpp @@ -432,6 +432,10 @@ class PROJ_GCC_DLL GeodeticReferenceFrame : public Datum { util::IComparable::Criterion criterion = util::IComparable::Criterion::STRICT, const io::DatabaseContextPtr &dbContext = nullptr) const override; + + PROJ_INTERNAL bool isEquivalentToNoExactTypeCheck( + const util::IComparable *other, util::IComparable::Criterion criterion, + const io::DatabaseContextPtr &dbContext) const; //! @endcond protected: @@ -587,6 +591,10 @@ class PROJ_GCC_DLL VerticalReferenceFrame : public Datum { util::IComparable::Criterion::STRICT, const io::DatabaseContextPtr &dbContext = nullptr) const override; + PROJ_INTERNAL bool isEquivalentToNoExactTypeCheck( + const util::IComparable *other, util::IComparable::Criterion criterion, + const io::DatabaseContextPtr &dbContext) const; + PROJ_INTERNAL void _exportToWKT(io::WKTFormatter *formatter) const override; // throw(io::FormattingException) |
