[Git][debian-gis-team/otb][upstream] New upstream version 6.4.0+dfsg
Sebastiaan Couwenberg
gitlab at salsa.debian.org
Tue Jan 30 19:26:51 UTC 2018
Sebastiaan Couwenberg pushed to branch upstream at Debian GIS Project / otb
Commits:
fdb6dc50 by Bas Couwenberg at 2018-01-30T18:13:19+01:00
New upstream version 6.4.0+dfsg
- - - - -
9 changed files:
- Modules/Applications/AppImageUtils/app/otbExtractROI.cxx
- Modules/Applications/AppProjection/app/otbOrthoRectification.cxx
- Modules/Learning/Sampling/include/otbOGRDataToSamplePositionFilter.h
- Modules/Learning/Sampling/include/otbOGRDataToSamplePositionFilter.txx
- Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.h
- Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.txx
- Modules/Wrappers/SWIG/test/python/CMakeLists.txt
- Packaging/Files/selftester.sh
- RELEASE_NOTES.txt
Changes:
=====================================
Modules/Applications/AppImageUtils/app/otbExtractROI.cxx
=====================================
--- 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);
=====================================
Modules/Applications/AppProjection/app/otbOrthoRectification.cxx
=====================================
--- 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");
=====================================
Modules/Learning/Sampling/include/otbOGRDataToSamplePositionFilter.h
=====================================
--- 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
=====================================
Modules/Learning/Sampling/include/otbOGRDataToSamplePositionFilter.txx
=====================================
--- 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>
=====================================
Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.h
=====================================
--- 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);
=====================================
Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.txx
=====================================
--- 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>
=====================================
Modules/Wrappers/SWIG/test/python/CMakeLists.txt
=====================================
--- 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)
=====================================
Packaging/Files/selftester.sh
=====================================
--- 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 ))
=====================================
RELEASE_NOTES.txt
=====================================
--- 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
View it on GitLab: https://salsa.debian.org/debian-gis-team/otb/commit/fdb6dc50e96ccdcafe106d6a4b58fd164798dcd0
---
View it on GitLab: https://salsa.debian.org/debian-gis-team/otb/commit/fdb6dc50e96ccdcafe106d6a4b58fd164798dcd0
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-grass-devel/attachments/20180130/ab9b4d35/attachment-0001.html>
More information about the Pkg-grass-devel
mailing list