diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-11-26 18:49:25 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-11-27 00:39:18 +0100 |
| commit | b27efedef0b3deb488d322d42b3d5b652ab55662 (patch) | |
| tree | 91668f9be07276aa42903e2778a81805ce5fac89 /src/iso19111/datum.cpp | |
| parent | 968b06fbb6cb96e8e4400d9c93c6778eaccb96fa (diff) | |
| download | PROJ-b27efedef0b3deb488d322d42b3d5b652ab55662.tar.gz PROJ-b27efedef0b3deb488d322d42b3d5b652ab55662.zip | |
PRIMEM WKT handling: fixes on import for 'sexagesimal DMS' or from WKT1:GDAL/ESRI when GEOGCS UNIT != Degree; morph to ESRI the PRIMEM name on export
Diffstat (limited to 'src/iso19111/datum.cpp')
| -rw-r--r-- | src/iso19111/datum.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/iso19111/datum.cpp b/src/iso19111/datum.cpp index 60244779..8e1b8257 100644 --- a/src/iso19111/datum.cpp +++ b/src/iso19111/datum.cpp @@ -351,6 +351,23 @@ void PrimeMeridian::_exportToWKT( if (!(isWKT2 && formatter->primeMeridianOmittedIfGreenwich() && l_name == "Greenwich")) { formatter->startNode(io::WKTConstants::PRIMEM, !identifiers().empty()); + + if (formatter->useESRIDialect()) { + bool aliasFound = false; + const auto &dbContext = formatter->databaseContext(); + if (dbContext) { + auto l_alias = dbContext->getAliasFromOfficialName( + l_name, "prime_meridian", "ESRI"); + if (!l_alias.empty()) { + l_name = l_alias; + aliasFound = true; + } + } + if (!aliasFound) { + l_name = io::WKTFormatter::morphNameToESRI(l_name); + } + } + formatter->addQuotedString(l_name); const auto &l_long = longitude(); if (formatter->primeMeridianInDegree()) { |
