diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-03-25 19:51:56 +0000 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-03-25 19:51:56 +0000 |
| commit | fb029ef8c296f37094991aade77d8bf92eebe40f (patch) | |
| tree | 84c223aaf72066afdd0240106384a243150de8d6 /src | |
| parent | 136e6748d955edb2bfb8e826c8a28972ae4f6cff (diff) | |
| download | PROJ-fb029ef8c296f37094991aade77d8bf92eebe40f.tar.gz PROJ-fb029ef8c296f37094991aade77d8bf92eebe40f.zip | |
lookForGridInfo(): correctly return that a grid is present, if present on the file system, but not in the database
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 80c1a572..a8a25a6a 100644 --- a/src/iso19111/coordinateoperation.cpp +++ b/src/iso19111/coordinateoperation.cpp @@ -8742,13 +8742,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 3530f5d8..2e18c885 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; |
