diff --git a/Code/Projections/otbGenericRSResampleImageFilter.h b/Code/Projections/otbGenericRSResampleImageFilter.h index 8e030bfbc1494c3e4edb2a2314564ae5d1491a95..2063f98153af1d86c8b3fb694d8c86ec24f288d1 100644 --- a/Code/Projections/otbGenericRSResampleImageFilter.h +++ b/Code/Projections/otbGenericRSResampleImageFilter.h @@ -219,7 +219,7 @@ public: void SetOutputParametersFromImage(const ImageBaseType * image); /** Useful to set the output parameters from an existing image*/ - void SetOutputParametersFromMap(const std::string map); + void SetOutputParametersFromMap(const std::string map, const SpacingType& spacing); /** Set/Get the grid size for rpc estimator*/ void SetInputRpcGridSize(const SizeType& gridSize) diff --git a/Code/Projections/otbGenericRSResampleImageFilter.txx b/Code/Projections/otbGenericRSResampleImageFilter.txx index 1f983440ce68a7bb6d60c1ef6d168b0a3a189203..589a2e0f673c2d467c04e20f0118c69c1f308193 100644 --- a/Code/Projections/otbGenericRSResampleImageFilter.txx +++ b/Code/Projections/otbGenericRSResampleImageFilter.txx @@ -241,7 +241,7 @@ GenericRSResampleImageFilter<TInputImage, TOutputImage> template <class TInputImage, class TOutputImage> void GenericRSResampleImageFilter<TInputImage, TOutputImage> -::SetOutputParametersFromMap(const std::string map) +::SetOutputParametersFromMap(const std::string map, const SpacingType& spacing) { // Get the input Image const InputImageType* input = this->GetInput(); @@ -291,6 +291,7 @@ GenericRSResampleImageFilter<TInputImage, TOutputImage> // Update the transform this->SetOutputProjectionRef(utmRef); + this->SetOutputSpacing(spacing); this->UpdateTransform(); // Get the inverse transform again : used later diff --git a/Testing/Code/Projections/otbGenericRSResampleImageFilter.cxx b/Testing/Code/Projections/otbGenericRSResampleImageFilter.cxx index 572d9ade998f70326b354dfe03e70da8c8bbd16b..d18c3ee225eda665e3ed5fd1954e027ba2a29772 100644 --- a/Testing/Code/Projections/otbGenericRSResampleImageFilter.cxx +++ b/Testing/Code/Projections/otbGenericRSResampleImageFilter.cxx @@ -186,8 +186,7 @@ int otbGenericRSResampleImageFilterFromMap(int argc, char* argv[]) // Set the Resampler Parameters resampler->SetInput(extractor->GetOutput()); resampler->SetDeformationFieldSpacing(gridSpacing); - resampler->SetOutputSpacing(spacing); - resampler->SetOutputParametersFromMap("UTM"); + resampler->SetOutputParametersFromMap("UTM",spacing); if (useInRpc) {