21 #ifndef otbOGRLayerWrapper_h
22 #define otbOGRLayerWrapper_h
25 #if defined(__GNUC__) || defined(__clang__)
26 #pragma GCC diagnostic push
27 #pragma GCC diagnostic ignored "-Wshadow"
28 #include <boost/iterator/iterator_facade.hpp>
29 #include <boost/utility/enable_if.hpp>
30 #pragma GCC diagnostic pop
32 #include <boost/iterator/iterator_facade.hpp>
33 #include <boost/utility/enable_if.hpp>
57 OTBGdalAdapters_EXPORT
bool operator==(Layer
const& lhs, Layer
const& rhs);
80 class OTBGdalAdapters_EXPORT
Layer
94 typedef itk::SmartPointer<DataSource> DataSourcePtr;
111 Layer(OGRLayer* layer,
bool modifiable);
127 Layer(OGRLayer* layer, GDALDataset& sourceInChargeOfLifeTime,
bool modifiable);
227 void GetExtent(
double& ulx,
double& uly,
double& lrx,
double& lry,
bool force =
false)
const;
230 void PrintSelf(std::ostream& os, itk::Indent indent)
const;
248 return m_Layer ? &boolean::i :
nullptr;
347 template <
class Value>
348 class feature_iter :
public boost::iterator_facade<feature_iter<Value>, Value, boost::single_pass_traversal_tag>
362 template <
class OtherValue>
364 : m_Layer(other.m_Layer), m_Crt(other.m_Crt)
369 friend class boost::iterator_core_access;
373 template <
class OtherValue>
376 return other.
m_Crt == m_Crt;
380 assert(m_Layer &&
"cannot increment end()");
381 m_Crt = m_Layer->GetNextFeature();
442 return cstart_at(index);
594 DataSourcePtr m_DataSource;
600 return !(lhs == rhs);
605 #ifndef OTB_MANUAL_INSTANTIATION
Geometric object with descriptive fields.
Encapsulation of OGRFieldDefn: field definition.
Implementation class for Feature iterator. This iterator is a single pass iterator....
bool equal(feature_iter< OtherValue > const &other) const
Value & dereference() const
otb::ogr::Layer * m_Layer
feature_iter(feature_iter< OtherValue > const &other, typename boost::enable_if< boost::is_convertible< OtherValue *, Value * >>::type *=nullptr)
feature_iter(otb::ogr::Layer &layer)
Layer of geometric objects.
void GetExtent(double &ulx, double &uly, double &lrx, double &lry, bool force=false) const
void SetSpatialFilterRect(double dfMinX, double dfMinY, double dfMaxX, double dfMaxY)
const_iterator end() const
std::string GetProjectionRef() const
const char * GetNameOfClass() const
OGRSpatialReference const * GetSpatialRef() const
OGRwkbGeometryType GetGeomType() const
int GetFeatureCount(bool doForceComputation) const
iterator start_at(GIntBig index)
Feature GetFeature(long nFID)
void SetFeature(Feature feature)
const_iterator begin() const
feature_iter< Feature > iterator
Features iterator.
void PrintSelf(std::ostream &os, itk::Indent indent) const
void SetSpatialFilter(OGRGeometry const *spatialFilter)
feature_iter< Feature const > const_iterator
Features const iterator.
std::shared_ptr< OGRLayer > m_Layer
const_iterator cend() const
void CreateFeature(Feature feature)
friend bool operator==(Layer const &lhs, Layer const &rhs)
void DeleteField(int fieldIndex)
const_iterator cbegin() const
Layer(OGRLayer *layer, bool modifiable)
void ReorderFields(int *map)
OGRGeometry const * GetSpatialFilter() const
std::string GetName() const
void CreateField(FieldDefn const &field, bool bApproxOK=true)
void ReorderField(vcl_size_t oldPos, vcl_size_t newPos)
const_iterator start_at(GIntBig index) const
OGREnvelope GetExtent(bool force=false) const
void SetIgnoredFields(char const **fieldNames)
OGRFeatureDefn & GetLayerDefn() const
void DeleteFeature(long nFID)
const_iterator cstart_at(GIntBig index) const
void AlterFieldDefn(vcl_size_t fieldIndex, FieldDefn const &newFieldDefn, int nFlags)
Layer(OGRLayer *layer, GDALDataset &sourceInChargeOfLifeTime, bool modifiable)
bool operator!=(Layer const &lhs, Layer const &rhs)
OTBGdalAdapters_EXPORT bool operator==(Feature const &lhs, Feature const &rhs)
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.