Skip to content
Snippets Groups Projects
Commit 492432a4 authored by Cédric Traizet's avatar Cédric Traizet
Browse files

BUG: update the GenericRSResampleImageFilter test to check that the output projection is correct

parent 0a8bc22e
No related branches found
No related tags found
No related merge requests found
...@@ -113,10 +113,9 @@ int otbGenericRSResampleImageFilter(int argc, char* argv[]) ...@@ -113,10 +113,9 @@ int otbGenericRSResampleImageFilter(int argc, char* argv[])
origin[1] = strtod(argv[4], nullptr); // Origin northing origin[1] = strtod(argv[4], nullptr); // Origin northing
orthoRectifFilter->SetOutputOrigin(origin); orthoRectifFilter->SetOutputOrigin(origin);
std::string wkt = auto inputSpatialRef = otb::SpatialReference::FromUTM(atoi(argv[9]), atoi(argv[10]) ? otb::SpatialReference::hemisphere::north : otb::SpatialReference::hemisphere::south);
otb::SpatialReference::FromUTM(atoi(argv[9]), atoi(argv[10]) ? otb::SpatialReference::hemisphere::north : otb::SpatialReference::hemisphere::south)
.ToWkt(); orthoRectifFilter->SetOutputProjectionRef(inputSpatialRef.ToWkt());
orthoRectifFilter->SetOutputProjectionRef(wkt);
// Displacement Field spacing // Displacement Field spacing
VectorImageType::SpacingType gridSpacing; VectorImageType::SpacingType gridSpacing;
...@@ -138,5 +137,15 @@ int otbGenericRSResampleImageFilter(int argc, char* argv[]) ...@@ -138,5 +137,15 @@ int otbGenericRSResampleImageFilter(int argc, char* argv[])
writer->SetNumberOfDivisionsTiledStreaming(4); writer->SetNumberOfDivisionsTiledStreaming(4);
writer->Update(); writer->Update();
auto outputProjectionRef = orthoRectifFilter->GetOutput()->GetProjectionRef();
if (outputProjectionRef.empty() ||
otb::SpatialReference::FromDescription(outputProjectionRef) != inputSpatialRef)
{
std::cout << "Input and output projection don't match. "
<< "The output projection is: "
<< outputProjectionRef
<< std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
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