diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-11-27 13:15:28 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-27 13:15:28 +0100 |
| commit | a24c02199fbab7d25c5e9586677c89aff9c5cb6c (patch) | |
| tree | 50e0da28c99b38c124138e9c4203e48bebca597b /src/iso19111/datum.cpp | |
| parent | f5b4060847bf780c12b399b98e06ebc56e3ae8e3 (diff) | |
| parent | b27efedef0b3deb488d322d42b3d5b652ab55662 (diff) | |
| download | PROJ-a24c02199fbab7d25c5e9586677c89aff9c5cb6c.tar.gz PROJ-a24c02199fbab7d25c5e9586677c89aff9c5cb6c.zip | |
Merge pull request #2455 from rouault/primem_fixes
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()) { |
