aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-01-23 13:08:23 +0100
committerEven Rouault <even.rouault@spatialys.com>2020-01-23 13:08:23 +0100
commit00dd98457af1f32e7bb2b9677f6319f72fcfacf9 (patch)
tree546017ea45eec491b107bf238f0efd45acc6264e /src
parentffcd6253bb6b275cfc8884eeb88aa2eeac75e3b6 (diff)
downloadPROJ-00dd98457af1f32e7bb2b9677f6319f72fcfacf9.tar.gz
PROJ-00dd98457af1f32e7bb2b9677f6319f72fcfacf9.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')
-rw-r--r--src/iso19111/coordinateoperation.cpp38
1 files changed, 21 insertions, 17 deletions
diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp
index 6b89b5f3..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)
@@ -8717,21 +8718,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,
@@ -9383,16 +9395,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();
}