diff --git a/Code/BasicFilters/otbSpatialObjectToImageDrawingFilter.txx b/Code/BasicFilters/otbSpatialObjectToImageDrawingFilter.txx index cf832715e179113eb76b6b9f792b6844622d0558..7501ba32cbe0383192c269b420080160f5b5819d 100644 --- a/Code/BasicFilters/otbSpatialObjectToImageDrawingFilter.txx +++ b/Code/BasicFilters/otbSpatialObjectToImageDrawingFilter.txx @@ -370,6 +370,8 @@ SpatialObjectToImageDrawingFilter<TInputSpatialObject, TOutputImage> if (originspecified) { + origine[0] += 0.5 * m_Spacing[0]; + origine[1] += 0.5 * m_Spacing[1]; OutputImage->SetOrigin(origine); // and origin m_Origin[0] = OutputImage->GetOrigin()[0]; m_Origin[1] = OutputImage->GetOrigin()[1]; diff --git a/Code/BasicFilters/otbVectorDataToLabelImageFilter.txx b/Code/BasicFilters/otbVectorDataToLabelImageFilter.txx index 2c956acf3868340de7669776fe03d92277cf09a5..9e2eea4630b7ebc604ed0356c281247c2de0cf14 100644 --- a/Code/BasicFilters/otbVectorDataToLabelImageFilter.txx +++ b/Code/BasicFilters/otbVectorDataToLabelImageFilter.txx @@ -288,8 +288,8 @@ VectorDataToLabelImageFilter<TVectorData, TOutputImage>::GenerateData() OutputIndexType bufferIndexOrigin = bufferedRegion.GetIndex(); OutputOriginType 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];