diff --git a/Testing/Code/OBIA/CMakeLists.txt b/Testing/Code/OBIA/CMakeLists.txt index d2263fcda5497d98f5d68bb0f3da8b5b6f307422..54f91ccea42845170dcdd26621d9cd84b3c1c197 100644 --- a/Testing/Code/OBIA/CMakeLists.txt +++ b/Testing/Code/OBIA/CMakeLists.txt @@ -258,14 +258,13 @@ ADD_TEST(obTvStreamingVectorizedSegmentationOGR ${OBIA_TESTS1} ) # ------- otb::FusionOGRTileFilter ------------- -CONFIGURE_FILE(${INPUTDATA}/QB_Toulouse_Ortho_withTiles.sqlite - ${TEMP}/obTvFusionOGRTile.sqlite COPYONLY) -ADD_TEST(obTuFusionOGRTileFilterNew ${OBIA_TESTS1} +ADD_TEST(obTuFusionOGRTileFilter ${OBIA_TESTS1} --compare-ogr ${EPSILON_8} ${BASELINE_FILES}/obTvFusionOGRTile.sqlite ${TEMP}/obTvFusionOGRTile.sqlite otbFusionOGRTileFilter ${INPUTDATA}/QB_Toulouse_Ortho_PAN.tif + ${INPUTDATA}/QB_Toulouse_Ortho_withTiles.sqlite ${TEMP}/obTvFusionOGRTile.sqlite 112 ) diff --git a/Testing/Code/OBIA/otbFusionOGRTileFilter.cxx b/Testing/Code/OBIA/otbFusionOGRTileFilter.cxx index 5d05db1522b1e32471c32fd30994a883ad9bf876..28e8c7cab3b824b05835c429725729d305466dc2 100644 --- a/Testing/Code/OBIA/otbFusionOGRTileFilter.cxx +++ b/Testing/Code/OBIA/otbFusionOGRTileFilter.cxx @@ -19,12 +19,14 @@ #include "otbFusionOGRTileFilter.h" #include "otbImage.h" #include "otbImageFileReader.h" +#include "itksys/SystemTools.hxx" int otbFusionOGRTileFilter(int argc, char * argv[]) { const char * infname = argv[1]; const char * inOGRfname = argv[2]; - unsigned int size = atoi(argv[3]); + const char * tmpOGRfname = argv[3]; + unsigned int size = atoi(argv[4]); /** Typedefs */ const unsigned int Dimension = 2; @@ -37,6 +39,10 @@ int otbFusionOGRTileFilter(int argc, char * argv[]) ReaderType::Pointer reader = ReaderType::New(); FilterType::Pointer filter = FilterType::New(); + //first copy the input OGR file as it will be updated with the fusionned polygons + itksys::SystemTools::CopyAFile(inOGRfname,tmpOGRfname,true); + + reader->SetFileName(infname); reader->UpdateOutputInformation(); @@ -44,7 +50,7 @@ int otbFusionOGRTileFilter(int argc, char * argv[]) streamSize.Fill(size); filter->SetInput(reader->GetOutput()); - filter->SetInputFileName(inOGRfname); + filter->SetInputFileName(tmpOGRfname); filter->SetStreamSize(streamSize); filter->GenerateData();