aboutsummaryrefslogtreecommitdiff
path: root/include/proj/io.hpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-10-10 14:23:42 +0200
committerEven Rouault <even.rouault@spatialys.com>2020-10-10 14:23:50 +0200
commit5163741254088b7f3fbb651349463cd2942df4f6 (patch)
treef99750451df364d1410c6e17073d8b513cb6b82e /include/proj/io.hpp
parenta5dd7bbb8512a10280001491bd3fecc599fd4eca (diff)
downloadPROJ-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 'include/proj/io.hpp')
-rw-r--r--include/proj/io.hpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/proj/io.hpp b/include/proj/io.hpp
index 19ed292d..9bbacfe6 100644
--- a/include/proj/io.hpp
+++ b/include/proj/io.hpp
@@ -252,6 +252,8 @@ class PROJ_GCC_DLL WKTFormatter {
PROJ_INTERNAL void startNode(const std::string &keyword, bool hasId);
PROJ_INTERNAL void endNode();
+ PROJ_INTERNAL bool isAtTopLevel() const;
+
PROJ_DLL WKTFormatter &simulCurNodeHasId();
PROJ_INTERNAL void addQuotedString(const char *str);