This is an automated email from the git hooks/post-receive script. sebastic pushed a commit to branch master in repository otb.
commit fdb6dc50e96ccdcafe106d6a4b58fd164798dcd0 Author: Bas Couwenberg <sebas...@xs4all.nl> Date: Tue Jan 30 18:13:19 2018 +0100 New upstream version 6.4.0+dfsg --- .../AppImageUtils/app/otbExtractROI.cxx | 110 +++++++++++---------- .../AppProjection/app/otbOrthoRectification.cxx | 2 +- .../include/otbOGRDataToSamplePositionFilter.h | 3 + .../include/otbOGRDataToSamplePositionFilter.txx | 49 +++++++++ .../include/otbPersistentSamplingFilterBase.h | 3 + .../include/otbPersistentSamplingFilterBase.txx | 97 +++++++++--------- Modules/Wrappers/SWIG/test/python/CMakeLists.txt | 2 - Packaging/Files/selftester.sh | 11 ++- RELEASE_NOTES.txt | 13 ++- 9 files changed, 182 insertions(+), 108 deletions(-) diff --git a/Modules/Applications/AppImageUtils/app/otbExtractROI.cxx b/Modules/Applications/AppImageUtils/app/otbExtractROI.cxx index 1f0221e..bd6a8d1 100644 --- a/Modules/Applications/AppImageUtils/app/otbExtractROI.cxx +++ b/Modules/Applications/AppImageUtils/app/otbExtractROI.cxx @@ -252,6 +252,7 @@ private: if ( HasValue("in") ) { ImageType* inImage = GetParameterImage("in"); + inImage->UpdateOutputInformation(); ImageType::RegionType largestRegion = inImage->GetLargestPossibleRegion(); bool userExtent = !HasUserValue( "mode.extent.ulx" ) \ @@ -385,7 +386,9 @@ private: region.SetIndex(1, GetParameterInt("starty")); if ( HasValue("in") ) { - if (region.Crop(GetParameterImage("in")->GetLargestPossibleRegion())) + ImageType* inImage = GetParameterImage("in"); + inImage->UpdateOutputInformation(); + if (region.Crop(inImage->GetLargestPossibleRegion())) { SetParameterInt("sizex",region.GetSize(0), HasUserValue("sizex")); SetParameterInt("sizey",region.GetSize(1), HasUserValue("sizey")); @@ -426,19 +429,15 @@ private: ImageType * inImage = GetParameterImage("in"); FloatVectorImageType::IndexType uli , lri; - bool startin = inImage->TransformPhysicalPointToIndex(ulp,uli); - bool sizein = inImage->TransformPhysicalPointToIndex(lrp,lri); - if ( startin ) - { - SetParameterInt( "startx", uli[0] , true ); - SetParameterInt( "starty", uli[1] , true ); - } - - if( startin && sizein ) - { - SetParameterInt( "sizex", lri[0] - uli[0] + 1, true ); - SetParameterInt( "sizey", lri[1] - uli[1] + 1, true ); - } + inImage->TransformPhysicalPointToIndex(ulp,uli); + inImage->TransformPhysicalPointToIndex(lrp,lri); + + SetParameterInt( "startx", uli[0] , true ); + SetParameterInt( "starty", uli[1] , true ); + + SetParameterInt( "sizex", lri[0] - uli[0] + 1, true ); + SetParameterInt( "sizey", lri[1] - uli[1] + 1, true ); + } else if( GetParameterString( "mode.extent.unit" ) == "lonlat" ) { @@ -456,21 +455,16 @@ private: lrp_out = rsTransform->TransformPoint(lrp_in); FloatVectorImageType::IndexType uli_out , lri_out; - bool startin = inImage->TransformPhysicalPointToIndex(ulp_out,uli_out); - bool sizein = inImage->TransformPhysicalPointToIndex(lrp_out,lri_out); + inImage->TransformPhysicalPointToIndex(ulp_out,uli_out); + inImage->TransformPhysicalPointToIndex(lrp_out,lri_out); - if ( startin ) - { - SetParameterInt( "startx", uli_out[0] , true ); - SetParameterInt( "starty", uli_out[1] , true ); - } - - if( startin && sizein ) - { - SetParameterInt( "sizex", lri_out[0] - uli_out[0] + 1, true ); - SetParameterInt( "sizey", lri_out[1] - uli_out[1] + 1, true ); - } - } + SetParameterInt( "startx", uli_out[0] , true ); + SetParameterInt( "starty", uli_out[1] , true ); + + SetParameterInt( "sizex", lri_out[0] - uli_out[0] + 1, true ); + SetParameterInt( "sizey", lri_out[1] - uli_out[1] + 1, true ); + } + this->CropRegionOfInterest(); } void @@ -685,10 +679,10 @@ private: ImageType* inImage = GetParameterImage("in"); inImage->UpdateOutputInformation(); - if ( HasValue( "mode.fit.vect" ) && GetParameterString("mode") == "fit" ) + if ( HasValue( "mode.fit.vect" ) && GetParameterString("mode") == "fit") { otb::ogr::DataSource::Pointer ogrDS; - ogrDS = otb::ogr::DataSource::New(GetParameterString("in") , + ogrDS = otb::ogr::DataSource::New(GetParameterString("mode.fit.vect") , otb::ogr::DataSource::Modes::Read); double ulx, uly, lrx, lry; bool extentAvailable = true; @@ -724,40 +718,50 @@ private: if (extentAvailable) { RSTransformType::Pointer rsTransform = RSTransformType::New(); - rsTransform->SetInputProjectionRef(inputProjectionRef); + rsTransform->SetInputProjectionRef( inputProjectionRef ); rsTransform->SetOutputKeywordList( inImage->GetImageKeywordlist() ); rsTransform->SetOutputProjectionRef( inImage->GetProjectionRef() ); rsTransform->InstantiateTransform(); - - itk::Point<float, 2> ulp_in, lrp_in , ulp_out , lrp_out; + itk::Point<float, 2> ulp_in , urp_in , llp_in , lrp_in , + ulp_out , urp_out , llp_out , lrp_out; ulp_in[ 0 ] = ulx ; ulp_in[ 1 ] = uly ; + urp_in[ 0 ] = ulx ; + urp_in[ 1 ] = lry ; + llp_in[ 0 ] = lrx ; + llp_in[ 1 ] = uly ; lrp_in[ 0 ] = lrx ; lrp_in[ 1 ] = lry ; ulp_out = rsTransform->TransformPoint(ulp_in); + urp_out = rsTransform->TransformPoint(urp_in); + llp_out = rsTransform->TransformPoint(llp_in); lrp_out = rsTransform->TransformPoint(lrp_in); + FloatVectorImageType::IndexType uli_out , uri_out , lli_out , lri_out; - FloatVectorImageType::IndexType uli_out , lri_out; - bool startin , sizein ; - startin = inImage->TransformPhysicalPointToIndex(ulp_out,uli_out); - sizein = inImage->TransformPhysicalPointToIndex(lrp_out,lri_out); - - if ( startin ) - { - SetParameterInt( "startx", uli_out[0] , false ); - SetParameterInt( "starty", uli_out[1] , false ); - } - - if( startin && sizein ) - { - SetParameterInt( "sizey", lri_out[1] - uli_out[1] + 1 , false ); - SetParameterInt( "sizex", lri_out[0] - uli_out[0] + 1 , false ); - } - } + inImage->TransformPhysicalPointToIndex(ulp_out,uli_out); + inImage->TransformPhysicalPointToIndex(urp_out,uri_out); + inImage->TransformPhysicalPointToIndex(llp_out,lli_out); + inImage->TransformPhysicalPointToIndex(lrp_out,lri_out); + FloatVectorImageType::IndexType uli, lri; + + uli[0] = std::min( std::min( uli_out[0] , uri_out[0] ) , + std::min( lli_out[0] , lri_out[0] ) ); + uli[1] = std::min( std::min( uli_out[1] , uri_out[1] ) , + std::min( lli_out[1] , lri_out[1] ) ); + + lri[0] = std::max( std::max( uli_out[0] , uri_out[0] ) , + std::max( lli_out[0] , lri_out[0] ) ); + lri[1] = std::max( std::max( uli_out[1] , uri_out[1] ) , + std::max( lli_out[1] , lri_out[1] ) ); + + SetParameterInt( "startx", uli[0] , false ); + SetParameterInt( "starty", uli[1] , false ); + SetParameterInt( "sizex", lri[0] - uli[0] , false ); + SetParameterInt( "sizey", lri[1] - uli[1] , false ); + } } - - if( HasValue( "mode.fit.im" ) && GetParameterString( "mode" ) == "fit" ) + else if( HasValue( "mode.fit.im" ) && GetParameterString( "mode" ) == "fit" ) { // Setup the DEM Handler otb::Wrapper::ElevationParametersHandler::SetupDEMHandlerFromElevationParameters(this,"elev"); @@ -820,9 +824,9 @@ private: SetParameterInt("sizex",lri[0]-uli[0]); SetParameterInt("sizey",lri[1]-uli[1]); - this->CropRegionOfInterest(); } + this->CropRegionOfInterest(); m_ExtractROIFilter = ExtractROIFilterType::New(); m_ExtractROIFilter->SetInput(inImage); diff --git a/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx b/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx index 4d3c9cb..3c91403 100644 --- a/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx +++ b/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx @@ -91,7 +91,7 @@ private: { SetName("OrthoRectification"); std::ostringstream oss; - oss << "This application allows to ortho-rectify optical and radar images from supported sensors." << std::endl; + oss << "This application allows ortho-rectifying optical and radar images from supported sensors." << std::endl; SetDescription(oss.str()); // Documentation SetDocName("Ortho-rectification"); diff --git a/Modules/Learning/Sampling/include/otbOGRDataToSamplePositionFilter.h b/Modules/Learning/Sampling/include/otbOGRDataToSamplePositionFilter.h index 77388ff..8393766 100644 --- a/Modules/Learning/Sampling/include/otbOGRDataToSamplePositionFilter.h +++ b/Modules/Learning/Sampling/include/otbOGRDataToSamplePositionFilter.h @@ -139,6 +139,9 @@ protected: */ void DispatchInputVectors(void) ITK_OVERRIDE; + /** Fill the output vectors with a special ordering (class partition) */ + void FillOneOutput(unsigned int outIdx, ogr::DataSource* outDS, bool update) ITK_OVERRIDE; + private: PersistentOGRDataToSamplePositionFilter(const Self &); //purposely not implemented void operator =(const Self&); //purposely not implemented diff --git a/Modules/Learning/Sampling/include/otbOGRDataToSamplePositionFilter.txx b/Modules/Learning/Sampling/include/otbOGRDataToSamplePositionFilter.txx index e2d8a40..cc70bcb 100644 --- a/Modules/Learning/Sampling/include/otbOGRDataToSamplePositionFilter.txx +++ b/Modules/Learning/Sampling/include/otbOGRDataToSamplePositionFilter.txx @@ -308,6 +308,55 @@ PersistentOGRDataToSamplePositionFilter<TInputImage,TMaskImage,TSampler> } } +template<class TInputImage, class TMaskImage, class TSampler> +void +PersistentOGRDataToSamplePositionFilter<TInputImage,TMaskImage,TSampler> +::FillOneOutput(unsigned int outIdx, ogr::DataSource* outDS, bool update) +{ + ogr::Layer outLayer = outDS->GetLayersCount() == 1 + ? outDS->GetLayer(0) + : outDS->GetLayer(this->GetOutLayerName()); + + OGRErr err = outLayer.ogr().StartTransaction(); + if (err != OGRERR_NONE) + { + itkExceptionMacro(<< "Unable to start transaction for OGR layer " << outLayer.ogr().GetName() << "."); + } + + // output vectors sorted by class + for (auto& label : m_ClassPartition) + { + ogr::Layer inLayer = this->GetInMemoryOutput(label.second,outIdx); + if (!inLayer) + { + continue; + } + + // This test only uses 1 input, not compatible with multiple OGRData inputs + for(auto tmpIt = inLayer.begin(); tmpIt!=inLayer.end(); ++tmpIt) + { + if( label.first.compare(tmpIt->ogr().GetFieldAsString(this->GetFieldIndex())) != 0 ) + continue; + if(update) + { + outLayer.SetFeature( *tmpIt ); + } + else + { + ogr::Feature dstFeature(outLayer.GetLayerDefn()); + dstFeature.SetFrom( *tmpIt, TRUE ); + outLayer.CreateFeature( dstFeature ); + } + } + } + + err = outLayer.ogr().CommitTransaction(); + if (err != OGRERR_NONE) + { + itkExceptionMacro(<< "Unable to commit transaction for OGR layer " << outLayer.ogr().GetName() << "."); + } +} + // -------------- otb::OGRDataToSamplePositionFilter -------------------------- template<class TInputImage, class TMaskImage, class TSampler> diff --git a/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.h b/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.h index 8e80fb9..bb3b0ac 100644 --- a/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.h +++ b/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.h @@ -165,6 +165,9 @@ protected: /** Gather the content of in-memory output layer into the filter outputs */ virtual void GatherOutputVectors(void); + /** Fill output vectors for a particular output */ + virtual void FillOneOutput(unsigned int outIdx, ogr::DataSource* outDS, bool update); + /** Utility method to add new fields on an output layer */ virtual void InitializeOutputDataSource(ogr::DataSource* inputDS, ogr::DataSource* outputDS); diff --git a/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.txx b/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.txx index f10ace9..2973a7a 100644 --- a/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.txx +++ b/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.txx @@ -275,8 +275,6 @@ PersistentSamplingFilterBase<TInputImage,TMaskImage> // clean temporary inputs this->m_InMemoryInputs.clear(); - unsigned int numberOfThreads = this->GetNumberOfThreads(); - // gather temporary outputs and write to output const otb::ogr::DataSource* vectors = this->GetOGRData(); otb::Stopwatch chrono = otb::Stopwatch::StartNew(); @@ -287,58 +285,67 @@ PersistentSamplingFilterBase<TInputImage,TMaskImage> this->itk::ProcessObject::GetOutput(k)); if (realOutput) { - ogr::Layer outLayer = realOutput->GetLayersCount() == 1 - ? realOutput->GetLayer(0) - : realOutput->GetLayer(m_OutLayerName); + this->FillOneOutput(count, realOutput, bool(vectors == realOutput)); + count++; + } + } - OGRErr err = outLayer.ogr().StartTransaction(); - if (err != OGRERR_NONE) - { - itkExceptionMacro(<< "Unable to start transaction for OGR layer " << outLayer.ogr().GetName() << "."); - } + chrono.Stop(); + otbMsgDebugMacro(<< "Writing OGR points took " << chrono.GetElapsedMilliseconds() << " ms"); + this->m_InMemoryOutputs.clear(); +} - for (unsigned int thread=0 ; thread < numberOfThreads ; thread++) - { - ogr::Layer inLayer = this->m_InMemoryOutputs[thread][count]->GetLayerChecked(0); - if (!inLayer) - { - continue; - } +template <class TInputImage, class TMaskImage> +void +PersistentSamplingFilterBase<TInputImage,TMaskImage> +::FillOneOutput(unsigned int outIdx, ogr::DataSource* outDS, bool update) +{ + ogr::Layer outLayer = outDS->GetLayersCount() == 1 + ? outDS->GetLayer(0) + : outDS->GetLayer(m_OutLayerName); - ogr::Layer::const_iterator tmpIt = inLayer.begin(); - // This test only uses 1 input, not compatible with multiple OGRData inputs - if (vectors == realOutput) - { - // Update mode - for(; tmpIt!=inLayer.end(); ++tmpIt) - { - outLayer.SetFeature( *tmpIt ); - } - } - else - { - // Copy mode - for(; tmpIt!=inLayer.end(); ++tmpIt) - { - ogr::Feature dstFeature(outLayer.GetLayerDefn()); - dstFeature.SetFrom( *tmpIt, TRUE ); - outLayer.CreateFeature( dstFeature ); - } - } - } + OGRErr err = outLayer.ogr().StartTransaction(); + if (err != OGRERR_NONE) + { + itkExceptionMacro(<< "Unable to start transaction for OGR layer " << outLayer.ogr().GetName() << "."); + } - err = outLayer.ogr().CommitTransaction(); - if (err != OGRERR_NONE) + unsigned int numberOfThreads = this->GetNumberOfThreads(); + for (unsigned int thread=0 ; thread < numberOfThreads ; thread++) + { + ogr::Layer inLayer = this->m_InMemoryOutputs[thread][outIdx]->GetLayerChecked(0); + if (!inLayer) + { + continue; + } + + ogr::Layer::const_iterator tmpIt = inLayer.begin(); + // This test only uses 1 input, not compatible with multiple OGRData inputs + if (update) + { + // Update mode + for(; tmpIt!=inLayer.end(); ++tmpIt) { - itkExceptionMacro(<< "Unable to commit transaction for OGR layer " << outLayer.ogr().GetName() << "."); + outLayer.SetFeature( *tmpIt ); + } + } + else + { + // Copy mode + for(; tmpIt!=inLayer.end(); ++tmpIt) + { + ogr::Feature dstFeature(outLayer.GetLayerDefn()); + dstFeature.SetFrom( *tmpIt, TRUE ); + outLayer.CreateFeature( dstFeature ); } - count++; } } - chrono.Stop(); - otbMsgDebugMacro(<< "Writing OGR points took " << chrono.GetElapsedMilliseconds() << " ms"); - this->m_InMemoryOutputs.clear(); + err = outLayer.ogr().CommitTransaction(); + if (err != OGRERR_NONE) + { + itkExceptionMacro(<< "Unable to commit transaction for OGR layer " << outLayer.ogr().GetName() << "."); + } } template <class TInputImage, class TMaskImage> diff --git a/Modules/Wrappers/SWIG/test/python/CMakeLists.txt b/Modules/Wrappers/SWIG/test/python/CMakeLists.txt index d1e4a50..b0e0ac4 100644 --- a/Modules/Wrappers/SWIG/test/python/CMakeLists.txt +++ b/Modules/Wrappers/SWIG/test/python/CMakeLists.txt @@ -19,7 +19,6 @@ # set(TEST_DRIVER otbTestDriver - --add-before-env PYTHONPATH "${OTBSWIGWrapper_BINARY_DIR}/src" --add-before-env PYTHONPATH $<TARGET_FILE_DIR:_otbApplication> --add-before-env OTB_APPLICATION_PATH $<TARGET_FILE_DIR:otbapp_Smoothing> ) @@ -27,7 +26,6 @@ if(WIN32) # on windows, loading the module _otbApplication requires the otbossimplugins*.dll # which is in the 'bin/<CMAKE_BUILD_TYPE>' folder set(TEST_DRIVER ${TEST_DRIVER} - --add-before-env PATH ${CMAKE_BINARY_DIR}/bin --add-before-env PATH $<TARGET_FILE_DIR:OTBCommon>) endif(WIN32) diff --git a/Packaging/Files/selftester.sh b/Packaging/Files/selftester.sh index 8137cfa..830fbf8 100755 --- a/Packaging/Files/selftester.sh +++ b/Packaging/Files/selftester.sh @@ -31,6 +31,11 @@ ps_children () { ps -e -o pid -o command=COMMAND-WIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIDE-COLUMN -o ppid | grep " $1$" | grep -v -e ' grep ' -e ' ps -e ' } +# get the pid field from the output line of ps_children +get_pid() { + echo "$1" | grep -E -o '[0-9]+' | head -n 1 +} + # nb_report_lines( ) : get number of lines in report nb_report_lines () { report_lines="$(wc -l selftest_report.log)" @@ -127,12 +132,12 @@ for app in $OTB_APPS; do nb_try=0 while [ -z "$NEXT_CHILD_PID" -a $nb_try -lt 10 ]; do sleep 1s - CHILD_PROC=$(ps_children $GUI_PID | grep "bin/otbgui $app") + CHILD_PROC=$(ps_children $GUI_PID | grep " bin/otbgui $app") if [ -n "$CHILD_PROC" ]; then - CHILD_PID=$(echo "$CHILD_PROC" | cut -d ' ' -f 1) + CHILD_PID=$(get_pid "$CHILD_PROC") NEXT_CHILD_PROC=$(ps_children "$CHILD_PID" | grep 'otbApplicationLauncherQt') if [ -n "$NEXT_CHILD_PROC" ]; then - NEXT_CHILD_PID=$(echo "$NEXT_CHILD_PROC" | cut -d ' ' -f 1) + NEXT_CHILD_PID=$(get_pid "$NEXT_CHILD_PROC") fi fi nb_try=$(( nb_try + 1 )) diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index 2421280..42bd370 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -1,4 +1,4 @@ -OTB-v.6.4.0 - Changes since version 6.2.0 (January 17th, 2018) +OTB-v.6.4.0 - Changes since version 6.2.0 (January 30th, 2018) ---------------------------------------------------------- * Request for Changes (http://wiki.orfeo-toolbox.org/index.php/Requests_for_Changes): @@ -16,6 +16,11 @@ OTB-v.6.4.0 - Changes since version 6.2.0 (January 17th, 2018) * Bugfixes: * Orfeo Toolbox (OTB) + * 0001508: ExtractROI does not work with mode.fit.vect + * 0001509: Patch to fix spelling errors in 6.4.0-rc1 + * 0001482: In 6.2, otbcli_Convert with MPI produces invalid tiff files + * 0001507: Segmentation segfault + * 0001488: OTB apps sometime do not appear in the widget * 0001501: Does Java wrapping works on Windows? * 0001495: Crash when setting Orthorectification input field * 0001489: BandMath and BandMathX are missing important documentation on expression syntax @@ -25,12 +30,12 @@ OTB-v.6.4.0 - Changes since version 6.2.0 (January 17th, 2018) * 0001483: Monteverdi shows a pop up terminal on windows * 0001496: Monteverdi 'build overviews' pop-up trigger condition is unclear or incorrect * 0001494: Segmentation app shows 'Select parameters' instead of 'Running' - * 0001504: OTB does not compile with ITK last stable release 4.13 * 0001492: Monteverdi 6.2 is missing some French translations - * 0001503: Fix new coverity issues in release 6.4 * 0001499: OSSIMAdapters fails to build with OSSIM 2.2.0 (error: 'class ossimRpcSolver' has no member named 'createRpcProjection') * 0001498: ExtractROI Channel list empty when application is chained in memory - * 0001476: Python wrapping not working with Python >= 3.4 + * 0001476: Python wrapping not working with Python >= 3. + * 0001504: OTB does not compile with ITK last stable release 4.13 + * 0001503: Fix new coverity issues in release 6.4 * Documentation * 0001500: Application example in OTB software guide is confusing -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/otb.git _______________________________________________ Pkg-grass-devel mailing list Pkg-grass-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel