diff options
| author | Even Rouault <even.rouault@mines-paris.org> | 2019-03-26 12:08:09 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-26 12:08:09 +0100 |
| commit | a199edb807eea4439b98865d5cd33fa7e3fd0706 (patch) | |
| tree | d48ff95e98c2bdf89f009c225223b2b9d09b5cb2 /src | |
| parent | 1e575f4e18ac35c382207bbc7b732aa9f0d30d5e (diff) | |
| parent | 0721a0b55c86febcf4df8507c5a825ffa95ae51a (diff) | |
| download | PROJ-a199edb807eea4439b98865d5cd33fa7e3fd0706.tar.gz PROJ-a199edb807eea4439b98865d5cd33fa7e3fd0706.zip | |
Merge pull request #1369 from rouault/grid_fixes
Grid related fixes
Diffstat (limited to 'src')
| -rw-r--r-- | src/iso19111/coordinateoperation.cpp | 16 | ||||
| -rw-r--r-- | src/iso19111/factory.cpp | 2 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp index d7f138a4..50a6a003 100644 --- a/src/iso19111/coordinateoperation.cpp +++ b/src/iso19111/coordinateoperation.cpp @@ -8778,13 +8778,25 @@ void Transformation::_exportToPROJString( if (fileParameter && fileParameter->type() == ParameterValue::Type::FILENAME) { auto filename = fileParameter->valueFile(); - if (isMethodInverseOf) { + bool doInversion = isMethodInverseOf; + if (!identifiers().empty() && + *identifiers().front()->codeSpace() == + metadata::Identifier::EPSG && + method()->nameStr() == + "Geographic3D to GravityRelatedHeight (US .gtx)" && + ends_with(filename, ".gtx")) { + // gtx files, from straight EPSG definition, must be applied in + // reverse order for "Geographic3D to GravityRelatedHeight" + // method + doInversion = !doInversion; + } + if (doInversion) { formatter->startInversion(); } formatter->addStep("vgridshift"); formatter->addParam("grids", filename); formatter->addParam("multiplier", 1.0); - if (isMethodInverseOf) { + if (doInversion) { formatter->stopInversion(); } return; diff --git a/src/iso19111/factory.cpp b/src/iso19111/factory.cpp index b893faff..14421022 100644 --- a/src/iso19111/factory.cpp +++ b/src/iso19111/factory.cpp @@ -1024,8 +1024,8 @@ bool DatabaseContext::lookForGridInfo(const std::string &projFilename, info.url = url; info.directDownload = directDownload; info.openLicense = openLicense; - info.gridAvailable = gridAvailable; } + info.gridAvailable = gridAvailable; info.found = ret; d->cache(projFilename, info); return ret; |
