Skip to content
Snippets Groups Projects
Commit e0dcc2a6 authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

BUG: Mantis-942: pixel convention consistency between GDAL and OTB

parent eb146025
No related branches found
No related tags found
No related merge requests found
......@@ -174,8 +174,8 @@ RasterizeVectorDataFilter<TVectorData, TInputImage, TOutputImage>::GenerateData(
InputIndexType bufferIndexOrigin = bufferedRegion.GetIndex();
InputPointType bufferOrigin;
this->GetOutput()->TransformIndexToPhysicalPoint(bufferIndexOrigin, bufferOrigin);
geoTransform[0] = bufferOrigin[0];
geoTransform[3] = bufferOrigin[1];
geoTransform[0] = bufferOrigin[0] - 0.5 * this->GetOutput()->GetSpacing()[0];
geoTransform[3] = bufferOrigin[1] - 0.5 * this->GetOutput()->GetSpacing()[1];
geoTransform[1] = this->GetOutput()->GetSpacing()[0];
geoTransform[5] = this->GetOutput()->GetSpacing()[1];
......
......@@ -186,8 +186,8 @@ LabelImageToOGRDataSourceFilter<TInputImage>
IndexType bufferIndexOrigin = this->GetInput()->GetBufferedRegion().GetIndex();
OriginType bufferOrigin;
this->GetInput()->TransformIndexToPhysicalPoint(bufferIndexOrigin, bufferOrigin);
geoTransform[0] = bufferOrigin[0];
geoTransform[3] = bufferOrigin[1];
geoTransform[0] = bufferOrigin[0] - 0.5 * this->GetInput()->GetSpacing()[0];
geoTransform[3] = bufferOrigin[1] - 0.5 * this->GetInput()->GetSpacing()[1];
geoTransform[1] = this->GetInput()->GetSpacing()[0];
geoTransform[5] = this->GetInput()->GetSpacing()[1];
// FIXME: Here component 1 and 4 should be replaced by the orientation parameters
......@@ -256,8 +256,8 @@ LabelImageToOGRDataSourceFilter<TInputImage>
// the spacing is unchanged, the origin is relative to the buffered region
bufferIndexOrigin = this->GetInputMask()->GetBufferedRegion().GetIndex();
this->GetInputMask()->TransformIndexToPhysicalPoint(bufferIndexOrigin, bufferOrigin);
geoTransform[0] = bufferOrigin[0];
geoTransform[3] = bufferOrigin[1];
geoTransform[0] = bufferOrigin[0] - 0.5 * this->GetInputMask()->GetSpacing()[0];
geoTransform[3] = bufferOrigin[1] - 0.5 * this->GetInputMask()->GetSpacing()[1];
geoTransform[1] = this->GetInputMask()->GetSpacing()[0];
geoTransform[5] = this->GetInputMask()->GetSpacing()[1];
// FIXME: Here component 1 and 4 should be replaced by the orientation parameters
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment