Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Main Repositories
otb
Commits
037fb1e3
Commit
037fb1e3
authored
Dec 03, 2021
by
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
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
SuperBuild/patches/GDAL/gdal-2-enviRotation-
all
.diff
→
SuperBuild/patches/GDAL/gdal-2-enviRotation-
linux
.diff
View file @
037fb1e3
File moved
SuperBuild/patches/GDAL/gdal-2-enviRotation-macx.diff
0 → 100644
View file @
037fb1e3
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.
SuperBuild/patches/GDAL/gdal-2-enviRotation-win.diff
0 → 100644
View file @
037fb1e3
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.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment