aboutsummaryrefslogtreecommitdiff
path: root/src/transform.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-12-10 14:36:07 +0100
committerEven Rouault <even.rouault@spatialys.com>2019-12-10 15:25:02 +0100
commit2c3a7c8bcc711cf34b79885edbf1e5dccacc5757 (patch)
tree62fad710df23f50d8c15ad7625e6f814488078af /src/transform.cpp
parent29474bd7fdac013841a4795e93f714bba7791c56 (diff)
downloadPROJ-2c3a7c8bcc711cf34b79885edbf1e5dccacc5757.tar.gz
PROJ-2c3a7c8bcc711cf34b79885edbf1e5dccacc5757.zip
ob_tran: restore traditional handling of +to_meter with pj_transform() and proj utility (fixes #1782)
Fixes side-effect of https://github.com/OSGeo/PROJ/issues/1525 that went in 6.1.1 The correction is horribly hacky. Sorry...
Diffstat (limited to 'src/transform.cpp')
-rw-r--r--src/transform.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/transform.cpp b/src/transform.cpp
index d111d835..781c0061 100644
--- a/src/transform.cpp
+++ b/src/transform.cpp
@@ -231,6 +231,14 @@ static int geographic_to_projected (PJ *P, long n, int dist, double *x, double *
return 0;
}
+ // Ugly hack. See https://github.com/OSGeo/PROJ/issues/1782
+ if( P->right == PJ_IO_UNITS_WHATEVER && P->descr &&
+ strncmp(P->descr, "General Oblique Transformation",
+ strlen("General Oblique Transformation")) == 0 )
+ {
+ P->right = PJ_IO_UNITS_PROJECTED;
+ }
+
for( i = 0; i <n; i++ )
{
PJ_XY projected_loc;
@@ -342,6 +350,14 @@ static int projected_to_geographic (PJ *P, long n, int dist, double *x, double *
return 0;
}
+ // Ugly hack. See https://github.com/OSGeo/PROJ/issues/1782
+ if( P->right == PJ_IO_UNITS_WHATEVER && P->descr &&
+ strncmp(P->descr, "General Oblique Transformation",
+ strlen("General Oblique Transformation")) == 0 )
+ {
+ P->right = PJ_IO_UNITS_PROJECTED;
+ }
+
/* Fallback to the original PROJ.4 API 2d inversion - inv */
for( i = 0; i < n; i++ ) {
PJ_XY projected_loc;