Commit f9e98d08 authored by Luc Hermitte's avatar Luc Hermitte

COMP: fixing various issues found in nightly build for OTB-134/OGR

parent 51ae8d3d
......@@ -306,4 +306,3 @@ void otb::ogr::DataSource::SyncToDisk()
<< m_DataSource->GetName() << ">.");
}
}
......@@ -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);
//@}
......
......@@ -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
}
......@@ -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 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment