aboutsummaryrefslogtreecommitdiff
path: root/src/grids.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-12-09 23:26:39 +0100
committerEven Rouault <even.rouault@spatialys.com>2019-12-09 23:26:51 +0100
commit9f908ae47cfa70d3cdb2709a8ab5d8eeb10034fc (patch)
tree4c90b67027dca753414621977a00225f047542f5 /src/grids.cpp
parent1b702a82f5e009745f5ca8bbed92579e33f598d4 (diff)
downloadPROJ-9f908ae47cfa70d3cdb2709a8ab5d8eeb10034fc.tar.gz
PROJ-9f908ae47cfa70d3cdb2709a8ab5d8eeb10034fc.zip
Horizontal shift grids: hide the 'positive longitude shift value = westward correction' in the CTable2/NTv1/NTv2 backends
Diffstat (limited to 'src/grids.cpp')
-rw-r--r--src/grids.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/grids.cpp b/src/grids.cpp
index 7d19b1f7..cc954542 100644
--- a/src/grids.cpp
+++ b/src/grids.cpp
@@ -469,7 +469,8 @@ bool NTv1Grid::valueAt(int x, int y, float &lonShift, float &latShift) const {
}
/* convert seconds to radians */
latShift = static_cast<float>(two_doubles[0] * ((M_PI / 180.0) / 3600.0));
- lonShift = static_cast<float>(two_doubles[1] * ((M_PI / 180.0) / 3600.0));
+ // west longitude positive convention !
+ lonShift = -static_cast<float>(two_doubles[1] * ((M_PI / 180.0) / 3600.0));
return true;
}
@@ -572,7 +573,8 @@ bool CTable2Grid::valueAt(int x, int y, float &lonShift,
}
latShift = two_floats[1];
- lonShift = two_floats[0];
+ // west longitude positive convention !
+ lonShift = -two_floats[0];
return true;
}
@@ -642,7 +644,8 @@ bool NTv2Grid::valueAt(int x, int y, float &lonShift, float &latShift) const {
}
/* convert seconds to radians */
latShift = static_cast<float>(two_float[0] * ((M_PI / 180.0) / 3600.0));
- lonShift = static_cast<float>(two_float[1] * ((M_PI / 180.0) / 3600.0));
+ // west longitude positive convention !
+ lonShift = -static_cast<float>(two_float[1] * ((M_PI / 180.0) / 3600.0));
return true;
}