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
eeb74b05
Commit
eeb74b05
authored
10 years ago
by
Guillaume Pasero
Browse files
Options
Downloads
Patches
Plain Diff
DOC: Mantis-942: explain the origin of the problem
parent
bbfc8b45
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/IO/otbGDALImageIO.cxx
+5
-1
5 additions, 1 deletion
Code/IO/otbGDALImageIO.cxx
Code/IO/otbJPEG2000ImageIO.cxx
+2
-0
2 additions, 0 deletions
Code/IO/otbJPEG2000ImageIO.cxx
with
7 additions
and
1 deletion
Code/IO/otbGDALImageIO.cxx
+
5
−
1
View file @
eeb74b05
...
...
@@ -138,7 +138,7 @@ GDALImageIO::GDALImageIO()
// Set default spacing to one
m_Spacing
[
0
]
=
1.0
;
m_Spacing
[
1
]
=
1.0
;
// Set default origin to
zero
// Set default origin to
half a pixel (centered pixel convention)
m_Origin
[
0
]
=
0.5
;
m_Origin
[
1
]
=
0.5
;
...
...
@@ -1035,6 +1035,8 @@ void GDALImageIO::InternalReadImageInformation()
}
}
// Geotransforms with a non-null rotation are not supported
// Beware : GDAL origin is at the corner of the top-left pixel
// whereas OTB/ITK origin is at the centre of the top-left pixel
m_Origin
[
0
]
=
VadfGeoTransform
[
0
]
+
0.5
*
m_Spacing
[
0
];
m_Origin
[
1
]
=
VadfGeoTransform
[
3
]
+
0.5
*
m_Spacing
[
1
];
}
...
...
@@ -1678,6 +1680,8 @@ void GDALImageIO::InternalWriteImageInformation(const void* buffer)
/* -------------------------------------------------------------------- */
itk
::
VariableLengthVector
<
double
>
geoTransform
(
6
);
/// Reporting origin and spacing
// Beware : GDAL origin is at the corner of the top-left pixel
// whereas OTB/ITK origin is at the centre of the top-left pixel
geoTransform
[
0
]
=
m_Origin
[
0
]
-
0.5
*
m_Spacing
[
0
];
geoTransform
[
3
]
=
m_Origin
[
1
]
-
0.5
*
m_Spacing
[
1
];
geoTransform
[
1
]
=
m_Spacing
[
0
];
...
...
This diff is collapsed.
Click to expand it.
Code/IO/otbJPEG2000ImageIO.cxx
+
2
−
0
View file @
eeb74b05
...
...
@@ -1274,6 +1274,8 @@ void JPEG2000ImageIO::ReadImageInformation()
}
}
// Geotransforms with a non-null rotation are not supported
// Beware : GDAL origin is at the corner of the top-left pixel
// whereas OTB/ITK origin is at the centre of the top-left pixel
m_Origin
[
0
]
=
geoTransform
[
0
]
+
0.5
*
m_Spacing
[
0
];
m_Origin
[
1
]
=
geoTransform
[
3
]
+
0.5
*
m_Spacing
[
1
];
}
...
...
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