OTB  9.0.0
Orfeo Toolbox
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
otb::VectorDataKeywordlist Class Reference

#include <otbVectorDataKeywordlist.h>

+ Collaboration diagram for otb::VectorDataKeywordlist:

Public Types

typedef std::vector< FieldTypeFieldListType
 
typedef std::pair< OGRFieldDefn *, OGRField > FieldType
 
typedef VectorDataKeywordlist Self
 

Public Member Functions

void AddField (const std::string &key, const std::string &value)
 
void AddField (OGRFieldDefn *fieldDefn, OGRField *field)
 
void CopyFieldList (const Self &kwl)
 
double GetFieldAsDouble (const std::string &key) const
 
int GetFieldAsInt (const std::string &key) const
 
std::string GetFieldAsString (const std::string &key) const
 
std::vector< std::string > GetFieldList () const
 
virtual const char * GetNameOfClass () const
 
FieldType GetNthField (unsigned int index) const
 
unsigned int GetNumberOfFields () const
 
bool HasField (const std::string &key) const
 
void operator= (const Self &)
 
virtual void Print (std::ostream &os, itk::Indent indent=0) const
 
void SetFieldAsDouble (const std::string &key, double value)
 
void SetFieldAsInt (const std::string &key, int value)
 
void SetFieldAsString (const std::string &key, const std::string &value)
 
 VectorDataKeywordlist ()
 
 VectorDataKeywordlist (const Self &other)
 
 ~VectorDataKeywordlist ()
 

Protected Member Functions

virtual void PrintSelf (std::ostream &os, itk::Indent indent) const
 

Private Member Functions

FieldType CopyOgrField (FieldType field)
 
std::string PrintField (FieldType field) const
 

Private Attributes

FieldListType m_FieldList
 

Detailed Description

this class handle the metadata of vector data.

This class is used internally to handle the information associated with a vector object. This information is retrieved from the input file (a shapefile for example) and propagated along the pipeline with the object.

This is the equivalent of the otbImageKeywordlist class but for OGR information.

Todo:
add the accessor to enable modifying/updating the data.

Definition at line 57 of file otbVectorDataKeywordlist.h.

Member Typedef Documentation

◆ FieldListType

Definition at line 64 of file otbVectorDataKeywordlist.h.

◆ FieldType

typedef std::pair<OGRFieldDefn*, OGRField> otb::VectorDataKeywordlist::FieldType

Definition at line 63 of file otbVectorDataKeywordlist.h.

◆ Self

Smart pointer typedef support.

Definition at line 61 of file otbVectorDataKeywordlist.h.

Constructor & Destructor Documentation

◆ VectorDataKeywordlist() [1/2]

otb::VectorDataKeywordlist::VectorDataKeywordlist ( )

Constructor

◆ ~VectorDataKeywordlist()

otb::VectorDataKeywordlist::~VectorDataKeywordlist ( )

Destructor

◆ VectorDataKeywordlist() [2/2]

otb::VectorDataKeywordlist::VectorDataKeywordlist ( const Self other)

Constructor by copy (deep copy)

Member Function Documentation

◆ AddField() [1/2]

void otb::VectorDataKeywordlist::AddField ( const std::string &  key,
const std::string &  value 
)
Parameters
keyThe name of the field.
valueThe value of the field.

◆ AddField() [2/2]

void otb::VectorDataKeywordlist::AddField ( OGRFieldDefn *  fieldDefn,
OGRField *  field 
)

◆ CopyFieldList()

void otb::VectorDataKeywordlist::CopyFieldList ( const Self kwl)

Copy all the fields from another kwl

Referenced by otb::DataNode< TPrecision, VDimension, TValuePrecision >::CopyFieldList().

◆ CopyOgrField()

FieldType otb::VectorDataKeywordlist::CopyOgrField ( FieldType  field)
private

◆ GetFieldAsDouble()

double otb::VectorDataKeywordlist::GetFieldAsDouble ( const std::string &  key) const

Returns the value associated with a field name.

Parameters
keyThe name of the field.
Returns
The value of the field. A default value is returned if the key was not found.

Referenced by otb::DataNode< TPrecision, VDimension, TValuePrecision >::GetFieldAsDouble().

◆ GetFieldAsInt()

int otb::VectorDataKeywordlist::GetFieldAsInt ( const std::string &  key) const

Returns the value associated with a field name.

Parameters
keyThe name of the field.
Returns
The value of the field. A default value is returned if the key was not found.

Referenced by otb::DataNode< TPrecision, VDimension, TValuePrecision >::GetFieldAsInt().

◆ GetFieldAsString()

std::string otb::VectorDataKeywordlist::GetFieldAsString ( const std::string &  key) const

Returns the value associated with a field name.

Parameters
keyThe name of the field.
Returns
The value of the field. A default value is returned if the key was not found.

Referenced by otb::DataNode< TPrecision, VDimension, TValuePrecision >::GetFieldAsString().

◆ GetFieldList()

std::vector<std::string> otb::VectorDataKeywordlist::GetFieldList ( ) const
Returns
the name of fields in the node.

Referenced by otb::DataNode< TPrecision, VDimension, TValuePrecision >::GetFieldList().

◆ GetNameOfClass()

virtual const char* otb::VectorDataKeywordlist::GetNameOfClass ( ) const
inlinevirtual

Definition at line 66 of file otbVectorDataKeywordlist.h.

◆ GetNthField()

FieldType otb::VectorDataKeywordlist::GetNthField ( unsigned int  index) const
Returns
the nth field of the node as a std::pair of (key, value).
Parameters
indexthe index of the field to return.

◆ GetNumberOfFields()

unsigned int otb::VectorDataKeywordlist::GetNumberOfFields ( ) const
Returns
the number of fields in the node.

◆ HasField()

bool otb::VectorDataKeywordlist::HasField ( const std::string &  key) const
Returns
True if the node contains the field named after the given key.
Parameters
keyThe name of the field.

Referenced by otb::DataNode< TPrecision, VDimension, TValuePrecision >::HasField().

◆ operator=()

void otb::VectorDataKeywordlist::operator= ( const Self )

Deep copy operator

◆ Print()

virtual void otb::VectorDataKeywordlist::Print ( std::ostream &  os,
itk::Indent  indent = 0 
) const
virtual

Print the keyword list

◆ PrintField()

std::string otb::VectorDataKeywordlist::PrintField ( FieldType  field) const
private

◆ PrintSelf()

virtual void otb::VectorDataKeywordlist::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
protectedvirtual

◆ SetFieldAsDouble()

void otb::VectorDataKeywordlist::SetFieldAsDouble ( const std::string &  key,
double  value 
)
Parameters
keyThe name of the field.
valueThe value of the field.

Referenced by otb::DataNode< TPrecision, VDimension, TValuePrecision >::SetFieldAsDouble().

◆ SetFieldAsInt()

void otb::VectorDataKeywordlist::SetFieldAsInt ( const std::string &  key,
int  value 
)

Set the field as an integer

Parameters
keyThe name of the field.
valueThe value of the field.

Referenced by otb::DataNode< TPrecision, VDimension, TValuePrecision >::SetFieldAsInt().

◆ SetFieldAsString()

void otb::VectorDataKeywordlist::SetFieldAsString ( const std::string &  key,
const std::string &  value 
)
Parameters
keyThe name of the field.
valueThe value of the field.

Referenced by otb::DataNode< TPrecision, VDimension, TValuePrecision >::SetFieldAsString().

Member Data Documentation

◆ m_FieldList

FieldListType otb::VectorDataKeywordlist::m_FieldList
private

Definition at line 169 of file otbVectorDataKeywordlist.h.


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