OTB  6.7.0
Orfeo Toolbox
Public Member Functions | List of all members
otb::FieldCopyTransformation Struct Reference

#include <otbGeometriesToGeometriesFilter.h>

+ Collaboration diagram for otb::FieldCopyTransformation:

Public Member Functions

void DefineFields (ogr::Layer const &source, ogr::Layer &dest) const
 
void fieldsTransform (ogr::Feature const &) const
 
void fieldsTransform (ogr::Feature const &inFeature, ogr::Feature &outFeature) const
 
OGRFeatureDefn & getDefinition (ogr::Layer &outLayer) const
 

Private Attributes

std::map< int, int > m_SourceToDestFieldIndicesMap
 

Detailed Description

Helper class to operate an exact copy of the fields from a source layer.

Since
OTB v 3.14.0

Definition at line 187 of file otbGeometriesToGeometriesFilter.h.

Member Function Documentation

void otb::FieldCopyTransformation::DefineFields ( ogr::Layer const &  source,
ogr::Layer dest 
) const

Defines the fields in the destination layer. The default action is to copy all fields from one layer to another.

Parameters
[in]sourcesource Layer
[in,out]destdestination Layer
Exceptions
itk::ExceptionObjectin case the operation cannot succeed.
void otb::FieldCopyTransformation::fieldsTransform ( ogr::Feature const &  ) const
inline

In-place transformation: does nothing.

Exceptions
Nothing

Definition at line 198 of file otbGeometriesToGeometriesFilter.h.

void otb::FieldCopyTransformation::fieldsTransform ( ogr::Feature const &  inFeature,
ogr::Feature outFeature 
) const

By-Copy transformation: copies all fields.

Parameters
[in]inFeatureinput Feature
[in,out]outFeatureoutput Feature
Exceptions
itk::ExceptionObjectif the fields cannot be copied.
OGRFeatureDefn& otb::FieldCopyTransformation::getDefinition ( ogr::Layer outLayer) const
inline

Member Data Documentation

std::map<int,int> otb::FieldCopyTransformation::m_SourceToDestFieldIndicesMap
mutableprivate

Associative table to know how fields are mapped from one layer to another. This table is necessary as:

  • some data source drivers add their own fields (as a consequence, the number of fields differ between two layers).
  • other data source drivers truncate the name of the fields (as a consequence, we can't rely on field names).
    Todo:
    std::map may not be the fastest structure available => use a (sorted?) vector of pairs of ints, and search with a simple std::find (as we can expect the number of fields to be quite low).

Definition at line 232 of file otbGeometriesToGeometriesFilter.h.


The documentation for this struct was generated from the following file: