diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-01-23 23:26:17 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-23 23:26:17 +0100 |
| commit | 9a4b8a6c21624192e111c7f1388ce4cbbd1d6fa7 (patch) | |
| tree | 2bc164d821cf6d54958d228a65b823354b9669db /src | |
| parent | 0bd886d8b26016d26fac3e1c1bb8ed6982f30c4e (diff) | |
| parent | ba37cd70b299d8ea918f6bb219805713c9e6507a (diff) | |
| download | PROJ-9a4b8a6c21624192e111c7f1388ce4cbbd1d6fa7.tar.gz PROJ-9a4b8a6c21624192e111c7f1388ce4cbbd1d6fa7.zip | |
Merge pull request #1874 from rouault/backport_epsg_9_8_6
[6.3 backport] Database: update to EPSG v9.8.6
Diffstat (limited to 'src')
| -rw-r--r-- | src/iso19111/coordinateoperation.cpp | 70 | ||||
| -rw-r--r-- | src/proj_constants.h | 6 |
2 files changed, 31 insertions, 45 deletions
diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp index aaa0c413..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) @@ -8644,7 +8645,10 @@ TransformationNNPtr Transformation::substitutePROJAlternativeGridNames( inverseDirection)) { if (horizontalGridName == projFilename) { - assert(!inverseDirection); + if (inverseDirection) { + throw util::UnsupportedOperationException( + "Inverse direction for " + projFilename + " not supported"); + } return self; } @@ -8701,33 +8705,6 @@ TransformationNNPtr Transformation::substitutePROJAlternativeGridNames( } } - const auto &heightFilename = getHeightToGeographic3DFilename(); - if (!heightFilename.empty() && !projFilename.empty()) { - if (databaseContext->lookForGridAlternative( - heightFilename, projFilename, projGridFormat, - inverseDirection)) { - - if (heightFilename == projFilename) { - assert(!inverseDirection); - return self; - } - - if (inverseDirection) { - return createGravityRelatedHeightToGeographic3D( - createPropertiesForInverse(self.as_nullable().get(), - true, false), - targetCRS(), sourceCRS(), interpolationCRS(), - projFilename, coordinateOperationAccuracies()) - ->inverseAsTransformation(); - } else { - return createGravityRelatedHeightToGeographic3D( - createSimilarPropertiesTransformation(self), sourceCRS(), - targetCRS(), interpolationCRS(), projFilename, - coordinateOperationAccuracies()); - } - } - } - if (isGeographic3DToGravityRelatedHeight(method(), false)) { const auto &fileParameter = parameterValue(EPSG_NAME_PARAMETER_GEOID_CORRECTION_FILENAME, @@ -8738,14 +8715,20 @@ TransformationNNPtr Transformation::substitutePROJAlternativeGridNames( if (databaseContext->lookForGridAlternative( filename, projFilename, projGridFormat, inverseDirection)) { + if (inverseDirection) { + throw util::UnsupportedOperationException( + "Inverse direction for " + "Geographic3DToGravityRelatedHeight not supported"); + } + if (filename == projFilename) { - assert(!inverseDirection); return self; } auto parameters = std::vector<OperationParameterNNPtr>{ createOpParamNameEPSGCode( EPSG_CODE_PARAMETER_GEOID_CORRECTION_FILENAME)}; +#ifdef disabled_for_now if (inverseDirection) { return create(createPropertiesForInverse( self.as_nullable().get(), true, false), @@ -8755,7 +8738,9 @@ TransformationNNPtr Transformation::substitutePROJAlternativeGridNames( projFilename)}, coordinateOperationAccuracies()) ->inverseAsTransformation(); - } else { + } else +#endif + { return create( createSimilarPropertiesTransformation(self), sourceCRS(), targetCRS(), nullptr, @@ -8768,7 +8753,8 @@ TransformationNNPtr Transformation::substitutePROJAlternativeGridNames( } if (methodEPSGCode == EPSG_CODE_METHOD_VERTCON || - methodEPSGCode == EPSG_CODE_METHOD_VERTICALGRID_NZLVD) { + methodEPSGCode == EPSG_CODE_METHOD_VERTICALGRID_NZLVD || + methodEPSGCode == EPSG_CODE_METHOD_VERTICALGRID_GTX) { auto fileParameter = parameterValue(EPSG_NAME_PARAMETER_VERTICAL_OFFSET_FILE, EPSG_CODE_PARAMETER_VERTICAL_OFFSET_FILE); @@ -8780,7 +8766,11 @@ TransformationNNPtr Transformation::substitutePROJAlternativeGridNames( filename, projFilename, projGridFormat, inverseDirection)) { if (filename == projFilename) { - assert(!inverseDirection); + if (inverseDirection) { + throw util::UnsupportedOperationException( + "Inverse direction for " + projFilename + + " not supported"); + } return self; } @@ -9402,17 +9392,8 @@ void Transformation::_exportToPROJString( fileParameter->type() == ParameterValue::Type::FILENAME) { auto filename = fileParameter->valueFile(); 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; - } + // The EPSG Geog3DToHeight is the reverse convention of PROJ ! + doInversion = !doInversion; if (doInversion) { formatter->startInversion(); } @@ -9442,7 +9423,8 @@ void Transformation::_exportToPROJString( } } - if (methodEPSGCode == EPSG_CODE_METHOD_VERTICALGRID_NZLVD) { + if (methodEPSGCode == EPSG_CODE_METHOD_VERTICALGRID_NZLVD || + methodEPSGCode == EPSG_CODE_METHOD_VERTICALGRID_GTX) { auto fileParameter = parameterValue(EPSG_NAME_PARAMETER_VERTICAL_OFFSET_FILE, EPSG_CODE_PARAMETER_VERTICAL_OFFSET_FILE); diff --git a/src/proj_constants.h b/src/proj_constants.h index 21cd87fb..d5b484c6 100644 --- a/src/proj_constants.h +++ b/src/proj_constants.h @@ -511,11 +511,15 @@ /* ------------------------------------------------------------------------ */ #define EPSG_CODE_METHOD_VERTCON 9658 -#define EPSG_NAME_METHOD_VERTCON "VERTCON" +#define EPSG_NAME_METHOD_VERTCON_OLDNAME "VERTCON" +#define EPSG_NAME_METHOD_VERTCON "Vertical Offset by Grid Interpolation (VERTCON)" #define EPSG_CODE_METHOD_VERTICALGRID_NZLVD 1071 #define EPSG_NAME_METHOD_VERTICALGRID_NZLVD "Vertical Offset by Grid Interpolation (NZLVD)" +#define EPSG_CODE_METHOD_VERTICALGRID_GTX 1084 +#define EPSG_NAME_METHOD_VERTICALGRID_GTX "Vertical Offset by Grid Interpolation (gtx)" + #define EPSG_NAME_PARAMETER_VERTICAL_OFFSET_FILE "Vertical offset file" #define EPSG_CODE_PARAMETER_VERTICAL_OFFSET_FILE 8732 |
