diff --git a/Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx b/Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx index 6203f876bcbeb8cce565ae14931ce8df7b1c540f..a19f14da310e87dca438c03ddbc94852f3a3a1df 100644 --- a/Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx +++ b/Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx @@ -306,4 +306,3 @@ void otb::ogr::DataSource::SyncToDisk() << m_DataSource->GetName() << ">."); } } - diff --git a/Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.h b/Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.h index d09d9795354e6caee9434a8278e53c4b0a5978e9..9f234ef5910cf84ec74c327c0072d6d2a57def93 100644 --- a/Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.h +++ b/Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.h @@ -433,13 +433,13 @@ namespace otb { namespace ogr { * \throw None even when there is an error -- OGR can not report errors, * neither this wrapping. * \note the returned \c Layer will be automatically collected on its - * destruction ; i.e. unlike OGR API, no need to explicitly call \c + * destruction; i.e. unlike OGR API, no need to explicitly call \c * OGRDataSource::ReleaseResultSet(). * \sa OGRDataSource::ExecuteSQL */ Layer ExecuteSQL( std::string const& statement, - OGRGeometry * poSpatialFilter, + OGRGeometry * poSpatialFilter, char const* pszDialect); //@} diff --git a/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.cxx b/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.cxx index d976c77130dd8f154f7cb4daf57af481b5eb5180..fe0ac9cb36f051993bdec946036ed5a0d004c310 100644 --- a/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.cxx +++ b/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.cxx @@ -22,7 +22,7 @@ #include "otbOGRLayerWrapper.h" #include <cassert> #include <boost/bind.hpp> -#include <boost/range/algorithm.hpp> +#include <boost/foreach.hpp> #include "ogrsf_frmts.h" // OGRDataSource & OGRLayer /*===========================================================================*/ @@ -97,7 +97,8 @@ void otb::ogr::Layer::DeleteFeature(long nFID) otb::ogr::Feature otb::ogr::Layer::GetFeature(long nFID) { assert(m_Layer && "OGRLayer not initialized"); - Feature feat = m_Layer->GetFeature(nFID); + const Feature feat = m_Layer->GetFeature(nFID); + return feat; } void otb::ogr::Layer::SetFeature(Feature feature) @@ -130,10 +131,15 @@ void otb::ogr::Layer::PrintSelf(std::ostream& os, itk::Indent indent) const os << indent << "+"; if (m_Layer) // in case for odd reason the layer that should exist can't be found { - os << "Layer <" << m_Layer->GetName() << ">\n"; - boost::for_each( // for each feature - *this, - boost::bind(&Feature::PrintSelf, _1, boost::ref(os), indent.GetNextIndent())); + os << "Layer <" << GetName() << ">\n"; + indent = indent.GetNextIndent(); + BOOST_FOREACH(Feature f, *this) + { + f.PrintSelf(os, indent); + } + // boost::for_each( // for each feature + // *this, + // boost::bind(&Feature::PrintSelf, _1, boost::ref(os), indent.GetNextIndent())); } else { @@ -243,4 +249,3 @@ void otb::ogr::Layer::ReorderFields(int * map) } #endif } - diff --git a/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.h b/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.h index dd4356f23f29f096e3483b3629609d53ab250968..443a28a9cf8bc127a527c1de1879f89c22bb3264 100644 --- a/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.h +++ b/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.h @@ -185,12 +185,12 @@ public: typedef feature_iter<Feature > iterator; typedef feature_iter<Feature const> const_iterator; - const_iterator begin() const { return cbegin(); } - const_iterator end () const { return cend (); } - const_iterator cbegin() const ; - const_iterator cend() const { return iterator(); } - iterator begin() ; - iterator end() { return iterator(); } + const_iterator begin () const { return cbegin(); } + const_iterator end () const { return cend (); } + const_iterator cbegin() const; + const_iterator cend () const { return iterator(); } + iterator begin (); + iterator end () { return iterator(); } //@} /**\name Features definition */