Commit 037fb1e3 authored by Thibaut ROMAIN's avatar Thibaut ROMAIN
Browse files

BUG: Separate patches for gdal between windows and other platforms

parent 274c85f8
Pipeline #9255 failed with stages
in 90 minutes and 47 seconds
diff -burN gdal-2.4.1_orig/frmts/raw/envidataset.cpp gdal-2.4.1/frmts/raw/envidataset.cpp
--- gdal-2.4.1_orig/frmts/raw/envidataset.cpp 2019-03-29 14:48:15.444066736 +0100
+++ gdal-2.4.1/frmts/raw/envidataset.cpp 2019-03-29 14:48:49.556067582 +0100
@@ -618,10 +618,13 @@
adfGeoTransform[4] != 0.0 || adfGeoTransform[5] != 1.0;
if( bHasNonDefaultGT )
{
+ const double dfDet = adfGeoTransform[1] * adfGeoTransform[5] -
+ adfGeoTransform[2] * adfGeoTransform[4];
+ const double dfSign = (dfDet>0.0 ? 1.0 : -1.0);
const double dfRotation1 =
- -atan2(-adfGeoTransform[2], adfGeoTransform[1]) * kdfRadToDeg;
+ -atan2(dfSign * adfGeoTransform[2], adfGeoTransform[1]) * kdfRadToDeg;
const double dfRotation2 =
- -atan2(-adfGeoTransform[4], -adfGeoTransform[5]) * kdfRadToDeg;
+ -atan2(-adfGeoTransform[4], dfSign * adfGeoTransform[5]) * kdfRadToDeg;
const double dfRotation = (dfRotation1 + dfRotation2) / 2.0;
if( fabs(dfRotation1 - dfRotation2) > 1e-5 )
@@ -1530,7 +1533,12 @@
// Fallback to localcs if we don't recognise things.
if( oSRS.IsEmpty() )
+ {
oSRS.SetLocalCS(papszFields[0]);
+ // assume that the Y axis isn't flipped
+ adfGeoTransform[2] *= -1.0;
+ adfGeoTransform[5] *= -1.0;
+ }
// Try to set datum from projection info line if we have a
// projected coordinate system without a GEOGCS.
diff -burN gdal-2.4.1_orig/frmts/raw/envidataset.cpp gdal-2.4.1/frmts/raw/envidataset.cpp
--- gdal-2.4.1_orig/frmts/raw/envidataset.cpp 2019-03-29 14:48:15.444066736 +0100
+++ gdal-2.4.1/frmts/raw/envidataset.cpp 2019-03-29 14:48:49.556067582 +0100
@@ -618,10 +618,13 @@
adfGeoTransform[4] != 0.0 || adfGeoTransform[5] != 1.0;
if( bHasNonDefaultGT )
{
+ const double dfDet = adfGeoTransform[1] * adfGeoTransform[5] -
+ adfGeoTransform[2] * adfGeoTransform[4];
+ const double dfSign = (dfDet>0.0 ? 1.0 : -1.0);
const double dfRotation1 =
- -atan2(-adfGeoTransform[2], adfGeoTransform[1]) * kdfRadToDeg;
+ -atan2(dfSign * adfGeoTransform[2], adfGeoTransform[1]) * kdfRadToDeg;
const double dfRotation2 =
- -atan2(-adfGeoTransform[4], -adfGeoTransform[5]) * kdfRadToDeg;
+ -atan2(-adfGeoTransform[4], dfSign * adfGeoTransform[5]) * kdfRadToDeg;
const double dfRotation = (dfRotation1 + dfRotation2) / 2.0;
if( fabs(dfRotation1 - dfRotation2) > 1e-5 )
@@ -1530,7 +1533,12 @@
// Fallback to localcs if we don't recognise things.
if( oSRS.GetRoot() == nullptr )
+ {
oSRS.SetLocalCS(papszFields[0]);
+ // assume that the Y axis isn't flipped
+ adfGeoTransform[2] *= -1.0;
+ adfGeoTransform[5] *= -1.0;
+ }
// Try to set datum from projection info line if we have a
// projected coordinate system without a GEOGCS.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment