![]() |
Orfeo Toolbox
3.16
|
Geometric objet with descriptive fields. More...
#include <otbOGRFeatureWrapper.h>
Public Member Functions | |
| OGRFeature const * | addr () const |
| OGRFeatureDefn & | GetDefn () const |
| long | GetFID () const |
| OGRFeature & | ogr () const |
| OGRFeature & | ogr () |
| | |
| void | PrintSelf (std::ostream &os, itk::Indent indent) const |
| void | SetFID (long fid) |
| boost::shared_ptr< OGRFeature > & | sptr () |
| boost::shared_ptr< OGRFeature > const & | sptr () const |
| | |
Construction, copy and destruction | |
| Feature (OGRFeatureDefn &definition) | |
| Feature (OGRFeature *feature) | |
| ~Feature () | |
| Feature | Clone () const |
| void | SetFrom (Feature const &rhs, int *map, bool mustForgive=true) |
| void | SetFrom (Feature const &rhs, bool mustForgive=true) |
| ; | |
Fields | |
| vcl_size_t | GetSize () const |
| Field | operator[] (vcl_size_t index) |
| Field const | operator[] (vcl_size_t index) const |
| Field | operator[] (std::string const &name) |
| Field const | operator[] (std::string const &name) const |
| FieldDefn | GetFieldDefn (vcl_size_t index) const |
| FieldDefn | GetFieldDefn (std::string const &name) const |
Geometries | |
| |
| void | SetGeometry (OGRGeometry const *geometry) |
| OGRGeometry const * | GetGeometry () const |
| void | SetGeometryDirectly (UniqueGeometryPtr geometry) |
| UniqueGeometryPtr | StealGeometry () |
Private Member Functions | |
| void | CheckInvariants () const |
| int | GetFieldIndex (std::string const &name) const |
Unchecked definitions | |
All the definitions that follow do the real work. However, they are not the exposed public functions. The design of this class follows the principle behind the NVI (Non-Virtual Interface) pattern:
| |
| Feature | UncheckedClone () const |
| void | UncheckedSetFrom (Feature const &rhs, int *map, bool mustForgive=true) |
| void | UncheckedSetFrom (Feature const &rhs, bool mustForgive=true) |
| void | UncheckedPrintSelf (std::ostream &os, itk::Indent indent) const |
| Field | UncheckedGetElement (vcl_size_t index) |
| Field | UncheckedGetElement (std::string const &name) |
| FieldDefn | UncheckedGetFieldDefn (vcl_size_t index) const |
| FieldDefn | UncheckedGetFieldDefn (std::string const &name) const |
| int | UncheckedGetFieldIndex (std::string const &name) const |
| long | UncheckedGetFID () const |
| void | UncheckedSetFID (long fid) |
| OGRFeatureDefn & | UncheckedGetDefn () const |
| void | UncheckedSetGeometryDirectly (UniqueGeometryPtr geometry) |
| UniqueGeometryPtr | UncheckedStealGeometry () |
| OGRGeometry const * | UncheckedGetGeometry () const |
| void | UncheckedSetGeometry (OGRGeometry const *geometry) |
Private Attributes | |
| boost::shared_ptr< OGRFeature > | m_Feature |
Friends | |
| bool | otb::ogr::operator== (Feature const &lhs, Feature const &rhs) |
Geometric objet with descriptive fields.
It provides an encapsulation of OGR classes. In that particular case, it's an encapsulation of OGRFeature.
OGRLayer. OGRLayer: Feature assignment will just make one Feature proxy point to another OGRFeature. In order to truly assign from one to another, use SetFrom, or Clone in order to duplicate the current feature. m_Feature != 0 Actually, this isn't a true invariant per se, as it may be null in some cases, for instance to define mark the Layer::end() iterator. Definition at line 55 of file otbOGRFeatureWrapper.h.
| otb::ogr::Feature::Feature | ( | OGRFeatureDefn & | definition | ) |
Construction from a definition.
| [in] | definition | definition of the fields of the feature. |
| None |
m_Feature != 0 definition internal reference count is incremented Definition at line 33 of file otbOGRFeatureWrapper.cxx.
References CheckInvariants().
| otb::ogr::Feature::Feature | ( | OGRFeature * | feature | ) |
Construction from a pre-existing OGRFeature.
| [in,out] | feature | pre-existing feature that will be owned by the wrapper. |
| None |
Definition at line 41 of file otbOGRFeatureWrapper.cxx.
| otb::ogr::Feature::~Feature | ( | ) |
|
inline |
Definition at line 301 of file otbOGRFeatureWrapper.h.
References m_Feature.
|
inlineprivate |
Checks whether the internal OGRFeature is non null. Fires an assertion otherwise.
Definition at line 201 of file otbOGRFeatureWrapper.txx.
|
inline |
Duplicates the current feature.
*this. | None |
m_Feature != 0As Feature is a proxy class that shares its underlying OGRFeature, this function represents the only way to duplicate a feature.
OGRFeature::Clone() Definition at line 45 of file otbOGRFeatureWrapper.txx.
References CheckInvariants(), and UncheckedClone().
|
inline |
Feature definition accessor.
| None |
m_Feature != 0 OGRFeature::GetDefnRef() Definition at line 133 of file otbOGRFeatureWrapper.txx.
|
inline |
Obtains feature ID..
OGRNullFID if none has been assigned. | None |
m_Feature != 0 OGRFeature::GetFID() Definition at line 119 of file otbOGRFeatureWrapper.txx.
Referenced by otb::OGRLayerStreamStitchingFilter< TInputImage >::ProcessStreamingLine().
|
inline |
Accessor to the definition of the i-th field.
m_Feature != 0 index < GetSize() | None |
OGRFeature::GetFieldDefnRef() Definition at line 95 of file otbOGRFeatureWrapper.txx.
|
inline |
Accessor to the definition of a field gven its name.
m_Feature != 0 | itk::ExceptionObject | if no field named name exists. |
OGRFeature::GetFieldDefnRef() Definition at line 102 of file otbOGRFeatureWrapper.txx.
|
inlineprivate |
Searches the index of a field given a name.
m_Feature != 0 | itk::ExceptionObject | if no field named name exists. |
Definition at line 109 of file otbOGRFeatureWrapper.txx.
|
inline |
Accessor to the internal OGRGeometry stored.
| None |
m_Feature != 0 OGRFeature::GetGeometryRef() Definition at line 169 of file otbOGRFeatureWrapper.txx.
Referenced by main(), otb::TransformationFunctorDispatcher< TransformationFunctor, OGRGeometry, FieldTransformationPolicy >::operator()(), and otb::OGRLayerStreamStitchingFilter< TInputImage >::ProcessStreamingLine().
| vcl_size_t otb::ogr::Feature::GetSize | ( | ) | const |
Returns the number of fields.
m_Feature != 0 OGRFeature::GetFieldCount() Definition at line 118 of file otbOGRFeatureWrapper.cxx.
Referenced by otb::FieldCopyTransformation::fieldsTransform(), and pushFieldsToFieldLists().
|
inline |
Access to raw OGRFeature. This function provides an abstraction leak in case deeper control on the underlying OGRFeature is required.
OGRFeature must be valid, i.e. m_DataSource != 0, an assertion is fired otherwise. OGRFeature obtained this way. Definition at line 179 of file otbOGRFeatureWrapper.txx.
Referenced by otb::ogr::Layer::CreateFeature(), otb::ogr::Layer::SetFeature(), and UncheckedSetFrom().
|
inline |
Access to raw OGRFeature. This function provides an abstraction leak in case deeper control on the underlying OGRFeature is required.
OGRFeature must be valid, i.e. m_DataSource != 0, an assertion is fired otherwise. OGRFeature obtained this way. Definition at line 186 of file otbOGRFeatureWrapper.txx.
|
inline |
Read-Write access to the i-th field.
m_Feature != 0 index < GetSize() | None |
Definition at line 69 of file otbOGRFeatureWrapper.txx.
|
inline |
Read-only access to the i-th field.
m_Feature != 0 index < GetSize() | None |
Definition at line 76 of file otbOGRFeatureWrapper.txx.
|
inline |
Read-Write access to a field by name.
m_Feature != 0 | itk::ExceptionObject | if no field named name exists. |
Definition at line 82 of file otbOGRFeatureWrapper.txx.
|
inline |
Read-Only access to a field by name.
m_Feature != 0 | itk::ExceptionObject | if no field named name exists. |
Definition at line 89 of file otbOGRFeatureWrapper.txx.
|
inline |
Prints self into stream.
Definition at line 193 of file otbOGRFeatureWrapper.txx.
Referenced by otb::ogr::Layer::PrintSelf().
|
inline |
Feature ID setter.
| [in] | fid | new id. |
| itk::ExceptionObject | if it cannot be set. |
m_Feature != 0 OGRFeature::SetFID() Definition at line 126 of file otbOGRFeatureWrapper.txx.
|
inline |
Assigns a pre-existing feature to the current one.
| [in] | rhs | pre-existing feature to assign ourseleves from. |
| [in] | map | integer list of the fields to duplicated (default: all) |
| [in] | mustForgive | tells whether the operation should continue despite lacking output fields matching some of the source fields. |
| itk::ExceptionObject | if no value is transferred |
OGRFeature::SetFrom() Definition at line 59 of file otbOGRFeatureWrapper.txx.
Referenced by otb::PersistentImageToOGRLayerFilter< TImage >::GenerateData(), and otb::PersistentImageToOGRDataFilter< TImage >::GenerateData().
|
inline |
;
Assigns a pre-existing feature to the current one.
| [in] | rhs | pre-existing feature to assign ourseleves from. |
| [in] | map | integer list of the fields to duplicated (default: all) |
| [in] | mustForgive | tells whether the operation should continue despite lacking output fields matching some of the source fields. |
| itk::ExceptionObject | if no value is transferred |
OGRFeature::SetFrom() Definition at line 52 of file otbOGRFeatureWrapper.txx.
|
inline |
Changes the current geometry.
| [in] | geometry | Pointer to an existing geometry, null to dismiss any geometry. |
OGRGeometry is copied (cloned actually). | itk::ExceptionObject | on failure. |
m_Feature != 0 OGRFeature::SetGeometry() Definition at line 162 of file otbOGRFeatureWrapper.txx.
Referenced by main(), and otb::OGRLayerStreamStitchingFilter< TInputImage >::ProcessStreamingLine().
|
inline |
Changes the current geometry (transfers ownership).
| [in] | geometry | Unique-pointer to an existing geometry, null to dismiss any geometry. |
OGRGeometry is given to the feature. GetGeometry() == initial_geometry OGRGeometryFactory::destroyGeometry()). | itk::ExceptionObject | on failure. |
m_Feature != 0 OGRFeature::SetGeometryDirectly() Definition at line 143 of file otbOGRFeatureWrapper.txx.
Referenced by otb::TransformationFunctorDispatcher< TransformationFunctor, OGRGeometry, FieldTransformationPolicy >::operator()().
|
inline |
Abstraction leak to the internal shared OGRFeature.
| None |
Definition at line 145 of file otbOGRFeatureWrapper.h.
References m_Feature.
|
inline |
Abstraction leak to the internal shared OGRFeature.
| None |
Definition at line 147 of file otbOGRFeatureWrapper.h.
References m_Feature.
|
inline |
Steals the geometry stored..
OGRGeometry that is now of the responsibility of the caller. GetGeometry() == 0 | None |
m_Feature != 0 OGRFeature::StealGeometry() Definition at line 153 of file otbOGRFeatureWrapper.txx.
|
private |
Definition at line 54 of file otbOGRFeatureWrapper.cxx.
Referenced by Clone().
|
private |
Definition at line 176 of file otbOGRFeatureWrapper.cxx.
|
private |
Definition at line 122 of file otbOGRFeatureWrapper.cxx.
|
private |
Definition at line 128 of file otbOGRFeatureWrapper.cxx.
|
private |
Definition at line 162 of file otbOGRFeatureWrapper.cxx.
|
private |
Definition at line 134 of file otbOGRFeatureWrapper.cxx.
|
private |
Definition at line 139 of file otbOGRFeatureWrapper.cxx.
|
private |
Definition at line 149 of file otbOGRFeatureWrapper.cxx.
|
private |
Definition at line 212 of file otbOGRFeatureWrapper.cxx.
|
private |
Definition at line 86 of file otbOGRFeatureWrapper.cxx.
References itk::Indent::GetNextIndent(), and otb::ogr::Field::PrintSelf().
|
private |
Definition at line 167 of file otbOGRFeatureWrapper.cxx.
|
private |
Definition at line 69 of file otbOGRFeatureWrapper.cxx.
References ogr().
|
private |
Definition at line 60 of file otbOGRFeatureWrapper.cxx.
References ogr().
|
private |
Definition at line 202 of file otbOGRFeatureWrapper.cxx.
|
private |
Definition at line 185 of file otbOGRFeatureWrapper.cxx.
|
private |
Definition at line 196 of file otbOGRFeatureWrapper.cxx.
Tells whether two features are equal.
| None |
OGRFeature::Equals()
|
private |
Internal pointer to the shared OGRFeature.
Definition at line 347 of file otbOGRFeatureWrapper.h.
Referenced by addr(), otb::ogr::operator==(), and sptr().