Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main Repositories
otb
Commits
aefa3a64
Commit
aefa3a64
authored
7 years ago
by
Guillaume Pasero
Browse files
Options
Downloads
Patches
Plain Diff
SuperBuild: try patch on rotated ENVI files
parent
b500a74f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SuperBuild/patches/GDAL/gdal-2-enviRotation-all.diff
+33
-0
33 additions, 0 deletions
SuperBuild/patches/GDAL/gdal-2-enviRotation-all.diff
with
33 additions
and
0 deletions
SuperBuild/patches/GDAL/gdal-2-enviRotation-all.diff
0 → 100644
+
33
−
0
View file @
aefa3a64
diff -burN gdal-2.2.1-orig/frmts/raw/envidataset.cpp gdal-2.2.1/frmts/raw/envidataset.cpp
--- gdal-2.2.1-orig/frmts/raw/envidataset.cpp 2017-06-23 14:18:43.000000000 +0200
+++ gdal-2.2.1/frmts/raw/envidataset.cpp 2017-07-17 18:28:05.521732123 +0200
@@ -620,10 +620,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 )
@@ -1536,6 +1539,13 @@
if( oSRS.GetRoot() == NULL )
oSRS.SetLocalCS(papszFields[0]);
+ // Arbitrary : assume that the Y axis isn't flipped
+ if( STARTS_WITH_CI(papszFields[0], "Arbitrary" )
+ {
+ 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.
if( oSRS.IsProjected() && oSRS.GetAttrNode("GEOGCS") == NULL
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment