diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-10-10 14:23:42 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-10-10 14:23:50 +0200 |
| commit | 5163741254088b7f3fbb651349463cd2942df4f6 (patch) | |
| tree | f99750451df364d1410c6e17073d8b513cb6b82e /src/iso19111/datum.cpp | |
| parent | a5dd7bbb8512a10280001491bd3fecc599fd4eca (diff) | |
| download | PROJ-5163741254088b7f3fbb651349463cd2942df4f6.tar.gz PROJ-5163741254088b7f3fbb651349463cd2942df4f6.zip | |
WKT2:2019 import/export: handle DATUM (at top level object) with PRIMEM
This is a peculiarity of the WKT grammar. Despite ISO 19111 saying that the
prime meridian is a component of the datum, in WKT, they are placed at the
same level, for backward compatibility with earlier WKT versions. So handle
exporting and importing that. The fix is only for situation where DATUM is
the top level object (was working fine otherwise), which is a uncommon use
case. And to limit the amount of issue, on export emit the prime meridian only
if it is not Greenwich.
Diffstat (limited to 'src/iso19111/datum.cpp')
| -rw-r--r-- | src/iso19111/datum.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/iso19111/datum.cpp b/src/iso19111/datum.cpp index 83f615e9..fbd4fd2d 100644 --- a/src/iso19111/datum.cpp +++ b/src/iso19111/datum.cpp @@ -1300,6 +1300,13 @@ void GeodeticReferenceFrame::_exportToWKT( } // the PRIMEM is exported as a child of the CRS formatter->endNode(); + + if (formatter->isAtTopLevel()) { + const auto &l_primeMeridian(primeMeridian()); + if (l_primeMeridian->nameStr() != "Greenwich") { + l_primeMeridian->_exportToWKT(formatter); + } + } } //! @endcond |
