![]() |
OTB
9.1.1
Orfeo Toolbox
|
#include <otbOGRFeatureWrapper.h>
Collaboration diagram for otb::ogr::Feature:Public Member Functions | |
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) |
| void | PrintSelf (std::ostream &os, itk::Indent indent) const |
| OGRFeature & | ogr () const |
| OGRFeature & | ogr () |
| std::shared_ptr< OGRFeature > & | sptr () |
| std::shared_ptr< OGRFeature > const & | sptr () const |
| long | GetFID () const |
| void | SetFID (long fid) |
| OGRFeatureDefn & | GetDefn () const |
Fields | |
| int | GetSize () const |
| Field | operator[] (int index) |
| const Field | operator[] (int index) const |
| Field | operator[] (std::string const &name) |
| const Field | operator[] (std::string const &name) const |
| FieldDefn | GetFieldDefn (int index) const |
| FieldDefn | GetFieldDefn (std::string const &name) const |
| int | GetFieldIndex (std::string const &name) const |
Geometries | |
| |
| void | SetGeometry (OGRGeometry const *geometry) |
| OGRGeometry const * | GetGeometry () const |
| void | SetGeometryDirectly (UniqueGeometryPtr geometry) |
| UniqueGeometryPtr | StealGeometry () |
| OGRFeature const * | addr () const |
| bool | otb::ogr::operator== (Feature const &lhs, Feature const &rhs) |
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:
| |
| std::shared_ptr< OGRFeature > | m_Feature |
| 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 (int index) |
| Field | UncheckedGetElement (std::string const &name) |
| FieldDefn | UncheckedGetFieldDefn (int 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) |
| void | CheckInvariants () const |
Geometric object 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 63 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 | 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 |
| otb::ogr::Feature::~Feature | ( | ) |
Destructor.
| None |
|
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 338 of file otbOGRFeatureWrapper.h.
Referenced by otb::Wrapper::TrainVectorBase< TInputValue, TOutputValue >::ExtractSamplesWithLabel().
|
inlineprivate |
Checks whether the internal OGRFeature is non null. Fires an assertion otherwise.
Definition at line 34 of file otbOGRFeatureWrapper.hxx.
References m_Feature.
|
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 39 of file otbOGRFeatureWrapper.hxx.
|
inline |
Feature definition accessor.
| None |
m_Feature != 0 OGRFeature::GetDefnRef() Definition at line 115 of file otbOGRFeatureWrapper.hxx.
|
inline |
Obtains feature ID..
OGRNullFID if none has been assigned. | None |
m_Feature != 0 OGRFeature::GetFID() Definition at line 103 of file otbOGRFeatureWrapper.hxx.
Referenced by otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::ProcessSample(), and 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 82 of file otbOGRFeatureWrapper.hxx.
|
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 88 of file otbOGRFeatureWrapper.hxx.
|
inline |
Searches the index of a field given a name.
m_Feature != 0 | itk::ExceptionObject | if no field named name exists. |
Definition at line 94 of file otbOGRFeatureWrapper.hxx.
|
inline |
Accessor to the internal OGRGeometry stored.
| None |
m_Feature != 0 OGRFeature::GetGeometryRef() Definition at line 149 of file otbOGRFeatureWrapper.hxx.
Referenced by otb::TransformationFunctorDispatcher< TransformationFunctor, OGRGeometry, FieldTransformationPolicy >::operator()(), and otb::OGRLayerStreamStitchingFilter< TInputImage >::ProcessStreamingLine().
| int otb::ogr::Feature::GetSize | ( | ) | const |
Returns the number of fields.
m_Feature != 0 OGRFeature::GetFieldCount() | OGRFeature& otb::ogr::Feature::ogr | ( | ) |
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.
|
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 158 of file otbOGRFeatureWrapper.hxx.
Referenced by otb::Wrapper::TrainVectorBase< TInputValue, TOutputValue >::DoUpdateParameters(), otb::Wrapper::TrainVectorBase< TInputValue, TOutputValue >::ExtractSamplesWithLabel(), otb::PersistentOGRDataToClassStatisticsFilter< TInputImage, TMaskImage >::PrepareFeature(), and otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::ProcessSample().
|
inline |
Read-Write access to the i-th field.
m_Feature != 0 index < GetSize() | None |
Definition at line 60 of file otbOGRFeatureWrapper.hxx.
|
inline |
Read-only access to the i-th field.
m_Feature != 0 index < GetSize() | None |
Definition at line 66 of file otbOGRFeatureWrapper.hxx.
|
inline |
Read-Write access to a field by name.
m_Feature != 0 | itk::ExceptionObject | if no field named name exists. |
Definition at line 71 of file otbOGRFeatureWrapper.hxx.
|
inline |
Read-Only access to a field by name.
m_Feature != 0 | itk::ExceptionObject | if no field named name exists. |
Definition at line 77 of file otbOGRFeatureWrapper.hxx.
|
inline |
Prints self into stream.
Definition at line 170 of file otbOGRFeatureWrapper.hxx.
|
inline |
Feature ID setter.
| [in] | fid | new id. |
| itk::ExceptionObject | if it cannot be set. |
m_Feature != 0 OGRFeature::SetFID() Definition at line 109 of file otbOGRFeatureWrapper.hxx.
Referenced by otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::DispatchInputVectors(), otb::PersistentSamplingFilterBase< TInputImage >::DispatchInputVectors(), otb::Wrapper::VectorPrediction< RegressionMode >::FillOutputLayer(), and otb::PersistentImageSampleExtractorFilter< TInputImage >::ThreadedGenerateVectorData().
|
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 45 of file otbOGRFeatureWrapper.hxx.
|
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 51 of file otbOGRFeatureWrapper.hxx.
Referenced by otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::DispatchInputVectors(), otb::PersistentSamplingFilterBase< TInputImage >::DispatchInputVectors(), otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::FillOneOutput(), otb::PersistentSamplingFilterBase< TInputImage >::FillOneOutput(), otb::Wrapper::VectorPrediction< RegressionMode >::FillOutputLayer(), otb::PersistentImageToOGRLayerFilter< TImageType >::GenerateData(), otb::PersistentImageToOGRDataFilter< TImage >::GenerateData(), otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::ProcessSample(), and otb::PersistentImageSampleExtractorFilter< TInputImage >::ThreadedGenerateVectorData().
|
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 143 of file otbOGRFeatureWrapper.hxx.
Referenced by otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::ProcessSample(), 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 124 of file otbOGRFeatureWrapper.hxx.
Referenced by otb::TransformationFunctorDispatcher< TransformationFunctor, OGRGeometry, FieldTransformationPolicy >::operator()().
|
inline |
Abstraction leak to the internal shared OGRFeature.
| None |
Definition at line 158 of file otbOGRFeatureWrapper.h.
|
inline |
Abstraction leak to the internal shared OGRFeature.
| None |
Definition at line 164 of file otbOGRFeatureWrapper.h.
|
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 135 of file otbOGRFeatureWrapper.hxx.
|
private |
Internal pointer to the shared OGRFeature.
|
private |
Internal pointer to the shared OGRFeature.
|
private |
Internal pointer to the shared OGRFeature.
|
private |
Internal pointer to the shared OGRFeature.
|
private |
Internal pointer to the shared OGRFeature.
|
private |
Internal pointer to the shared OGRFeature.
|
private |
Internal pointer to the shared OGRFeature.
|
private |
Internal pointer to the shared OGRFeature.
|
private |
Internal pointer to the shared OGRFeature.
|
private |
Internal pointer to the shared OGRFeature.
|
private |
Internal pointer to the shared OGRFeature.
|
private |
Internal pointer to the shared OGRFeature.
|
private |
Internal pointer to the shared OGRFeature.
|
private |
Internal pointer to the shared OGRFeature.
|
private |
Internal pointer to the shared OGRFeature.
|
private |
Internal pointer to the shared OGRFeature.
Tells whether two features are equal.
| None |
OGRFeature::Equals()
|
private |
Internal pointer to the shared OGRFeature.
Definition at line 385 of file otbOGRFeatureWrapper.h.
Referenced by CheckInvariants().
1.8.17