diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-01-23 19:04:31 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-23 19:04:31 +0100 |
| commit | 1ca02b5659bced7036f345803a1c981c5ced9690 (patch) | |
| tree | 6a49b1132015c17cb5caae47ac9235240bfd0b12 /src | |
| parent | ef20438a3af9a507806eefdeae69ce0914847c70 (diff) | |
| parent | 00dd98457af1f32e7bb2b9677f6319f72fcfacf9 (diff) | |
| download | PROJ-1ca02b5659bced7036f345803a1c981c5ced9690.tar.gz PROJ-1ca02b5659bced7036f345803a1c981c5ced9690.zip | |
Merge pull request #1869 from rouault/update_to_epsg_9_8_6
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 a1650046..a8c7c902 100644 --- a/src/iso19111/coordinateoperation.cpp +++ b/src/iso19111/coordinateoperation.cpp @@ -8495,6 +8495,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) @@ -8647,7 +8648,10 @@ TransformationNNPtr Transformation::substitutePROJAlternativeGridNames( inverseDirection)) { if (horizontalGridName == projFilename) { - assert(!inverseDirection); + if (inverseDirection) { + throw util::UnsupportedOperationException( + "Inverse direction for " + projFilename + " not supported"); + } return self; } @@ -8704,33 +8708,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, @@ -8741,14 +8718,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), @@ -8758,7 +8741,9 @@ TransformationNNPtr Transformation::substitutePROJAlternativeGridNames( projFilename)}, coordinateOperationAccuracies()) ->inverseAsTransformation(); - } else { + } else +#endif + { return create( createSimilarPropertiesTransformation(self), sourceCRS(), targetCRS(), nullptr, @@ -8771,7 +8756,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); @@ -8783,7 +8769,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; } @@ -9405,17 +9395,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(); } @@ -9445,7 +9426,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 |
