21 #ifndef otbOGRFeatureWrapper_hxx
22 #define otbOGRFeatureWrapper_hxx
36 assert(
m_Feature &&
"OGRFeature can't be null");
42 return UncheckedClone();
48 UncheckedSetFrom(rhs, mustForgive);
54 UncheckedSetFrom(rhs, map, mustForgive);
62 assert(index < GetSize() &&
"out of range field-index.");
63 return UncheckedGetElement(index);
68 return const_cast<Feature*
>(
this)->
operator[](index);
74 return UncheckedGetElement(name);
79 return const_cast<Feature*
>(
this)->
operator[](name);
84 assert(index < GetSize() &&
"out of range field-index.");
85 return UncheckedGetFieldDefn(index);
91 return UncheckedGetFieldDefn(name);
97 return UncheckedGetFieldIndex(name);
106 return UncheckedGetFID();
112 UncheckedSetFID(fid);
118 return UncheckedGetDefn();
128 OGRGeometry* g = geometry.get();
130 UncheckedSetGeometryDirectly(std::move(geometry));
131 assert((m_Feature->GetGeometryRef() == g) &&
"The new geometry hasn't been set as expected");
132 assert(!geometry &&
"UniqueGeometryPtr hasn't released its pointer");
139 itkAssertOrThrowMacro(!m_Feature->GetGeometryRef(),
"Geometry hasn't been properly stolen");
146 UncheckedSetGeometry(geometry);
152 return UncheckedGetGeometry();
173 UncheckedPrintSelf(os, indent);
Geometric object with descriptive fields.
std::shared_ptr< OGRFeature > m_Feature
void CheckInvariants() const
void SetFrom(Feature const &rhs, int *map, bool mustForgive=true)
void SetGeometryDirectly(UniqueGeometryPtr geometry)
void PrintSelf(std::ostream &os, itk::Indent indent) const
UniqueGeometryPtr StealGeometry()
OGRGeometry const * GetGeometry() const
OGRFeatureDefn & GetDefn() const
Field operator[](int index)
int GetFieldIndex(std::string const &name) const
void SetGeometry(OGRGeometry const *geometry)
FieldDefn GetFieldDefn(int index) const
Encapsulation of OGRFieldDefn: field definition.
Encapsulation of OGRField Instances of Field are expected to be built from an existing Feature with w...
boost::interprocess::unique_ptr< OGRGeometry, internal::GeometryDeleter > UniqueGeometryPtr