diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-01-23 13:08:23 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-01-23 19:05:50 +0100 |
| commit | ba37cd70b299d8ea918f6bb219805713c9e6507a (patch) | |
| tree | ea50c891b9b6e10c186eefd122636d44d9405ae0 /src/iso19111/coordinateoperation.cpp | |
| parent | ae1a0324fb51c8a357b24991c3627d5c2414a784 (diff) | |
| download | PROJ-ba37cd70b299d8ea918f6bb219805713c9e6507a.tar.gz PROJ-ba37cd70b299d8ea918f6bb219805713c9e6507a.zip | |
Database: add a geoid_like value for proj_method column of grid_alternatives, fix related entries and simplify/robustify logic to deal with EPSG 'Geographic3D to GravityRelatedHeight' methods
Diffstat (limited to 'src/iso19111/coordinateoperation.cpp')
| -rw-r--r-- | src/iso19111/coordinateoperation.cpp | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp index 9b1d8dfb..d6a75df9 100644 --- a/src/iso19111/coordinateoperation.cpp +++ b/src/iso19111/coordinateoperation.cpp @@ -8492,6 +8492,7 @@ isGeographic3DToGravityRelatedHeight(const OperationMethodNNPtr &method, "1060", // Geographic3D to GravityRelatedHeight (CGG2013) "1072", // Geographic3D to GravityRelatedHeight (OSGM15-Ire) "1073", // Geographic3D to GravityRelatedHeight (IGN2009) + "1081", // Geographic3D to GravityRelatedHeight (BEV AT) "9661", // Geographic3D to GravityRelatedHeight (EGM) "9662", // Geographic3D to GravityRelatedHeight (Ausgeoid98) "9663", // Geographic3D to GravityRelatedHeight (OSGM-GB) @@ -8714,21 +8715,32 @@ TransformationNNPtr Transformation::substitutePROJAlternativeGridNames( if (databaseContext->lookForGridAlternative( filename, projFilename, projGridFormat, inverseDirection)) { - if (filename == projFilename && !inverseDirection) { + if (inverseDirection) { + throw util::UnsupportedOperationException( + "Inverse direction for " + "Geographic3DToGravityRelatedHeight not supported"); + } + + if (filename == projFilename) { return self; } auto parameters = std::vector<OperationParameterNNPtr>{ createOpParamNameEPSGCode( EPSG_CODE_PARAMETER_GEOID_CORRECTION_FILENAME)}; +#ifdef disabled_for_now if (inverseDirection) { - return createGravityRelatedHeightToGeographic3D( - createPropertiesForInverse( - self.as_nullable().get(), true, false), - targetCRS(), sourceCRS(), interpolationCRS(), - projFilename, coordinateOperationAccuracies()) + return create(createPropertiesForInverse( + self.as_nullable().get(), true, false), + targetCRS(), sourceCRS(), nullptr, + createSimilarPropertiesMethod(method()), + parameters, {ParameterValue::createFilename( + projFilename)}, + coordinateOperationAccuracies()) ->inverseAsTransformation(); - } else { + } else +#endif + { return create( createSimilarPropertiesTransformation(self), sourceCRS(), targetCRS(), nullptr, @@ -9380,16 +9392,8 @@ void Transformation::_exportToPROJString( fileParameter->type() == ParameterValue::Type::FILENAME) { auto filename = fileParameter->valueFile(); bool doInversion = isMethodInverseOf; - if ((method()->nameStr() == - "Geographic3D to GravityRelatedHeight (US .gtx)" || - method()->nameStr() == - "Geographic3D to GravityRelatedHeight (gtx)") && - ends_with(filename, ".gtx")) { - // gtx files must be applied in - // reverse order for "Geographic3D to GravityRelatedHeight" - // method - doInversion = !doInversion; - } + // The EPSG Geog3DToHeight is the reverse convention of PROJ ! + doInversion = !doInversion; if (doInversion) { formatter->startInversion(); } |
