OTB  6.7.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 (OGRFieldDefn *fieldDefn, OGRField *field)
 
void AddField (const std::string &key, const std::string &value)
 
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 internaly 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

Definition at line 64 of file otbVectorDataKeywordlist.h.

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

Definition at line 63 of file otbVectorDataKeywordlist.h.

Smart pointer typedef support.

Definition at line 61 of file otbVectorDataKeywordlist.h.

Constructor & Destructor Documentation

otb::VectorDataKeywordlist::VectorDataKeywordlist ( )

Constructor

otb::VectorDataKeywordlist::~VectorDataKeywordlist ( )

Destructor

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

Constructor by copy (deep copy)

Member Function Documentation

void otb::VectorDataKeywordlist::AddField ( OGRFieldDefn *  fieldDefn,
OGRField *  field 
)
void otb::VectorDataKeywordlist::AddField ( const std::string &  key,
const std::string &  value 
)
Parameters
keyThe name of the field.
valueThe value of the field.
void otb::VectorDataKeywordlist::CopyFieldList ( const Self kwl)

Copy all the fields from another kwl

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

FieldType otb::VectorDataKeywordlist::CopyOgrField ( FieldType  field)
private
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().

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().

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().

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

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

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

Definition at line 66 of file otbVectorDataKeywordlist.h.

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.
unsigned int otb::VectorDataKeywordlist::GetNumberOfFields ( ) const
Returns
the number of fields in the node.
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().

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

Deep copy operator

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

Print the keyword list

std::string otb::VectorDataKeywordlist::PrintField ( FieldType  field) const
private
virtual void otb::VectorDataKeywordlist::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
protectedvirtual
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().

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().

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

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: