te::vp::Feature Class Reference

A feature is a composition of a geometry and its attributes. More...

#include <Feature.h>

Inheritance diagram for te::vp::Feature:
te::mem::DataSetItem te::da::DataSetItem

Public Member Functions

virtual te::da::DataSetItemclone () const override
 Clones the feature. More...
 
void copyValuesFrom (const te::da::DataSetItem *source, bool copyGeometries=true)
 Copies the values from the source dataSet item to the destination dataSet item by matching the column names. If a column from the source does not exist in the destination, it will not be copied. More...
 
 Feature (const Feature &rhs)
 It creates a new feature by cloning the values in the source feature (rhs). More...
 
 Feature (const te::da::DataSet *dataSet)
 
 Feature (const te::da::DataSetItem &dataSetItem)
 Constructor. More...
 
 Feature (const te::da::DataSetType *dataSetType)
 
bool getBool (std::size_t i) const
 It returns the value of the i-th property. More...
 
std::unique_ptr< te::dt::ByteArraygetByteArray (std::size_t i) const
 It returns the value of the i-th property. More...
 
char getChar (std::size_t i) const
 It returns the value of the i-th property. More...
 
std::unique_ptr< te::dt::DateTimegetDateTime (std::size_t i) const
 It returns the value of the i-th property. More...
 
double getDouble (std::size_t i) const
 It returns the value of the i-th property. More...
 
std::unique_ptr< te::gm::GeometrygetFirstGeometry () const
 Gets the first geometry associated to this feature. The caller will take the ownership of the object. More...
 
te::gm::GeometrygetFirstGeometryPtr ()
 Gets the first geometry associated to this feature. The caller will NOT take the ownership of the object. More...
 
const te::gm::GeometrygetFirstGeometryPtr () const
 Gets the first geometry associated to this feature. The caller will NOT take the ownership of the object. More...
 
float getFloat (std::size_t i) const
 It returns the value of the i-th property. More...
 
std::unique_ptr< te::gm::GeometrygetGeometry (std::size_t i) const
 It returns the value of the i-th property. More...
 
boost::int16_t getInt16 (std::size_t i) const
 It returns the value of the i-th property. More...
 
boost::int32_t getInt32 (std::size_t i) const
 It returns the value of the i-th property. More...
 
boost::int64_t getInt64 (std::size_t i) const
 It returns the value of the i-th property. More...
 
std::string getNumeric (std::size_t i) const
 It returns the value of the i-th property. More...
 
std::size_t getNumProperties () const
 It returns the number of properties. More...
 
int getPropertyDataType (std::size_t pos) const
 It returns the type of the pos-th property. More...
 
const std::string & getPropertyName (std::size_t pos) const
 It returns the name of the pos-th property. More...
 
const std::vector< std::string > & getPropertyNames () const
 It returns the name of properties. More...
 
std::size_t getPropertyPos (const std::string &name) const
 It returns the name of the pos-th property. More...
 
const std::vector< int > & getPropertyTypes () const
 It returns the types of properties. More...
 
std::unique_ptr< te::rst::RastergetRaster (std::size_t i) const
 It returns the value of the i-th property. More...
 
std::string getString (std::size_t i) const
 It returns the value of the i-th property. More...
 
unsigned char getUChar (std::size_t i) const
 It returns the value of the i-th property. More...
 
std::unique_ptr< te::dt::AbstractDatagetValue (std::size_t i) const
 It returns the value of the i-th property. More...
 
bool isNull (std::size_t i) const
 Checks if the value in the given index is null. More...
 
void setBool (const std::string &name, bool value)
 It sets the value of the property, indicating its name. More...
 
void setBool (std::size_t i, bool value)
 It sets the value of the i-th property. More...
 
void setByteArray (const std::string &name, te::dt::ByteArray *value)
 It sets the value of the property, indicating its name. More...
 
void setByteArray (std::size_t i, te::dt::ByteArray *value)
 It sets the value of the i-th property. More...
 
void setChar (const std::string &name, char value)
 It sets the value of the property, indicating its name. More...
 
void setChar (std::size_t i, char value)
 It sets the value of the i-th property. More...
 
void setDateTime (const std::string &name, te::dt::DateTime *value)
 It sets the value of the property, indicating its name. More...
 
void setDateTime (std::size_t i, te::dt::DateTime *value)
 It sets the value of the i-th property. More...
 
void setDouble (const std::string &name, double value)
 It sets the value of the property, indicating its name. More...
 
void setDouble (std::size_t i, double value)
 It sets the value of the i-th property. More...
 
void setFirstGeometry (te::gm::Geometry *geometry)
 Sets the first geometry value associated to this feature. This will take the ownership of the object. More...
 
void setFloat (const std::string &name, float value)
 It sets the value of the property, indicating its name. More...
 
void setFloat (std::size_t i, float value)
 It sets the value of the i-th property. More...
 
void setGeometry (const std::string &name, te::gm::Geometry *value)
 It sets the value of the property, indicating its name. More...
 
void setGeometry (std::size_t i, te::gm::Geometry *value)
 It sets the value of the i-th property. More...
 
void setInt16 (const std::string &name, boost::int16_t value)
 It sets the value of the property, indicating its name. More...
 
void setInt16 (std::size_t i, boost::int16_t value)
 It sets the value of the i-th property. More...
 
void setInt32 (const std::string &name, boost::int32_t value)
 It sets the value of the property, indicating its name. More...
 
void setInt32 (std::size_t i, boost::int32_t value)
 It sets the value of the i-th property. More...
 
void setInt64 (const std::string &name, boost::int64_t value)
 It sets the value of the property, indicating its name. More...
 
void setInt64 (std::size_t i, boost::int64_t value)
 It sets the value of the i-th property. More...
 
void setNumeric (const std::string &name, const std::string &value)
 It sets the value of the property, indicating its name. More...
 
void setNumeric (std::size_t i, const std::string &value)
 It sets the value of the i-th property. More...
 
void setRaster (const std::string &name, te::rst::Raster *value)
 It sets the value of the property, indicating its name. More...
 
void setRaster (std::size_t i, te::rst::Raster *value)
 It sets the value of the i-th property. More...
 
void setSRID (int srid)
 
void setString (const std::string &name, const std::string &value)
 It sets the value of the property, indicating its name. More...
 
void setString (std::size_t i, const std::string &value)
 It sets the value of the i-th property. More...
 
void setUChar (const std::string &name, unsigned char value)
 It sets the value of the property, indicating its name. More...
 
void setUChar (std::size_t i, unsigned char value)
 It sets the value of the i-th property. More...
 
void setValue (const std::string &name, te::dt::AbstractData *value)
 It sets the value of the property, indicating its name. More...
 
void setValue (std::size_t i, te::dt::AbstractData *value)
 It sets the value of the i-th property. More...
 
void transform (int srid)
 It converts the coordinate values of the feature to the new spatial reference system. More...
 
void transform (te::srs::Converter *converter)
 It converts the coordinate values of the feature to the new spatial reference system. More...
 
virtual ~Feature ()
 Destructor. More...
 

Static Public Member Functions

static te::vp::FeaturecreateFeatureFromCurrent (const te::da::DataSet *dataSet)
 Creates a Feature based on the current row of the givem DataSet. More...
 
static te::da::DataSetItemcreateFromCurrent (const te::da::DataSet *dataSet)
 Creates a dataSetItem based on the current row of the givem DataSet. More...
 

Protected Member Functions

std::size_t getFirstGeometryPropertyPos () const
 

Protected Attributes

boost::ptr_vector< boost::nullable< te::dt::AbstractData > > m_data
 The data values of the. More...
 
std::size_t m_firstGeometryPropertyPos
 
std::vector< std::string > m_vecNames
 Vector containing the names of the attributes of the dataSet item. More...
 
std::vector< int > m_vecTypes
 Vector containing the types of the attributes of the dataSet item. More...
 

Detailed Description

A feature is a composition of a geometry and its attributes.

Definition at line 69 of file Feature.h.

Constructor & Destructor Documentation

◆ Feature() [1/4]

te::vp::Feature::Feature ( const te::da::DataSet dataSet)
explicit

◆ Feature() [2/4]

te::vp::Feature::Feature ( const te::da::DataSetType dataSetType)
explicit

◆ Feature() [3/4]

te::vp::Feature::Feature ( const te::da::DataSetItem dataSetItem)
explicit

Constructor.

Parameters
dataSetItemThe dataset item to be associated with this feature. Feature will take the ownership of the given dataset item

◆ Feature() [4/4]

te::vp::Feature::Feature ( const Feature rhs)
explicit

It creates a new feature by cloning the values in the source feature (rhs).

Parameters
rhsThe right-hand-side object to copy its values.

◆ ~Feature()

virtual te::vp::Feature::~Feature ( )
virtual

Destructor.

Member Function Documentation

◆ clone()

virtual te::da::DataSetItem* te::vp::Feature::clone ( ) const
overridevirtual

Clones the feature.

Reimplemented from te::mem::DataSetItem.

◆ copyValuesFrom()

void te::mem::DataSetItem::copyValuesFrom ( const te::da::DataSetItem source,
bool  copyGeometries = true 
)
inherited

Copies the values from the source dataSet item to the destination dataSet item by matching the column names. If a column from the source does not exist in the destination, it will not be copied.

◆ createFeatureFromCurrent()

static te::vp::Feature* te::vp::Feature::createFeatureFromCurrent ( const te::da::DataSet dataSet)
static

Creates a Feature based on the current row of the givem DataSet.

◆ createFromCurrent()

static te::da::DataSetItem* te::da::DataSetItem::createFromCurrent ( const te::da::DataSet dataSet)
staticinherited

Creates a dataSetItem based on the current row of the givem DataSet.

◆ getBool()

bool te::da::DataSetItem::getBool ( std::size_t  i) const
inherited

It returns the value of the i-th property.

◆ getByteArray()

std::unique_ptr<te::dt::ByteArray> te::da::DataSetItem::getByteArray ( std::size_t  i) const
inherited

It returns the value of the i-th property.

◆ getChar()

char te::da::DataSetItem::getChar ( std::size_t  i) const
inherited

It returns the value of the i-th property.

◆ getDateTime()

std::unique_ptr<te::dt::DateTime> te::da::DataSetItem::getDateTime ( std::size_t  i) const
inherited

It returns the value of the i-th property.

◆ getDouble()

double te::da::DataSetItem::getDouble ( std::size_t  i) const
inherited

It returns the value of the i-th property.

◆ getFirstGeometry()

std::unique_ptr<te::gm::Geometry> te::vp::Feature::getFirstGeometry ( ) const

Gets the first geometry associated to this feature. The caller will take the ownership of the object.

Returns
The first geometry associated to this feature

◆ getFirstGeometryPropertyPos()

std::size_t te::vp::Feature::getFirstGeometryPropertyPos ( ) const
protected

◆ getFirstGeometryPtr() [1/2]

te::gm::Geometry* te::vp::Feature::getFirstGeometryPtr ( )

Gets the first geometry associated to this feature. The caller will NOT take the ownership of the object.

Returns
The first geometry associated to this feature

◆ getFirstGeometryPtr() [2/2]

const te::gm::Geometry* te::vp::Feature::getFirstGeometryPtr ( ) const

Gets the first geometry associated to this feature. The caller will NOT take the ownership of the object.

Returns
The first geometry associated to this feature

◆ getFloat()

float te::da::DataSetItem::getFloat ( std::size_t  i) const
inherited

It returns the value of the i-th property.

◆ getGeometry()

std::unique_ptr<te::gm::Geometry> te::da::DataSetItem::getGeometry ( std::size_t  i) const
inherited

It returns the value of the i-th property.

◆ getInt16()

boost::int16_t te::da::DataSetItem::getInt16 ( std::size_t  i) const
inherited

It returns the value of the i-th property.

◆ getInt32()

boost::int32_t te::da::DataSetItem::getInt32 ( std::size_t  i) const
inherited

It returns the value of the i-th property.

◆ getInt64()

boost::int64_t te::da::DataSetItem::getInt64 ( std::size_t  i) const
inherited

It returns the value of the i-th property.

◆ getNumeric()

std::string te::da::DataSetItem::getNumeric ( std::size_t  i) const
inherited

It returns the value of the i-th property.

◆ getNumProperties()

std::size_t te::da::DataSetItem::getNumProperties ( ) const
inherited

It returns the number of properties.

◆ getPropertyDataType()

int te::da::DataSetItem::getPropertyDataType ( std::size_t  pos) const
inherited

It returns the type of the pos-th property.

◆ getPropertyName()

const std::string& te::da::DataSetItem::getPropertyName ( std::size_t  pos) const
inherited

It returns the name of the pos-th property.

◆ getPropertyNames()

const std::vector<std::string>& te::da::DataSetItem::getPropertyNames ( ) const
inherited

It returns the name of properties.

◆ getPropertyPos()

std::size_t te::da::DataSetItem::getPropertyPos ( const std::string &  name) const
inherited

It returns the name of the pos-th property.

◆ getPropertyTypes()

const std::vector<int>& te::da::DataSetItem::getPropertyTypes ( ) const
inherited

It returns the types of properties.

◆ getRaster()

std::unique_ptr<te::rst::Raster> te::da::DataSetItem::getRaster ( std::size_t  i) const
inherited

It returns the value of the i-th property.

◆ getString()

std::string te::da::DataSetItem::getString ( std::size_t  i) const
inherited

It returns the value of the i-th property.

◆ getUChar()

unsigned char te::da::DataSetItem::getUChar ( std::size_t  i) const
inherited

It returns the value of the i-th property.

◆ getValue()

std::unique_ptr<te::dt::AbstractData> te::da::DataSetItem::getValue ( std::size_t  i) const
inherited

It returns the value of the i-th property.

◆ isNull()

bool te::da::DataSetItem::isNull ( std::size_t  i) const
inherited

Checks if the value in the given index is null.

◆ setBool() [1/2]

void te::mem::DataSetItem::setBool ( const std::string &  name,
bool  value 
)
inherited

It sets the value of the property, indicating its name.

◆ setBool() [2/2]

void te::mem::DataSetItem::setBool ( std::size_t  i,
bool  value 
)
inherited

It sets the value of the i-th property.

◆ setByteArray() [1/2]

void te::mem::DataSetItem::setByteArray ( const std::string &  name,
te::dt::ByteArray value 
)
inherited

It sets the value of the property, indicating its name.

Note
It will take the ownership of the given pointer.

◆ setByteArray() [2/2]

void te::mem::DataSetItem::setByteArray ( std::size_t  i,
te::dt::ByteArray value 
)
inherited

It sets the value of the i-th property.

Note
It will take the ownership of the given pointer.

◆ setChar() [1/2]

void te::mem::DataSetItem::setChar ( const std::string &  name,
char  value 
)
inherited

It sets the value of the property, indicating its name.

◆ setChar() [2/2]

void te::mem::DataSetItem::setChar ( std::size_t  i,
char  value 
)
inherited

It sets the value of the i-th property.

◆ setDateTime() [1/2]

void te::mem::DataSetItem::setDateTime ( const std::string &  name,
te::dt::DateTime value 
)
inherited

It sets the value of the property, indicating its name.

Note
It will take the ownership of the given pointer.

◆ setDateTime() [2/2]

void te::mem::DataSetItem::setDateTime ( std::size_t  i,
te::dt::DateTime value 
)
inherited

It sets the value of the i-th property.

Note
It will take the ownership of the given pointer.

◆ setDouble() [1/2]

void te::mem::DataSetItem::setDouble ( const std::string &  name,
double  value 
)
inherited

It sets the value of the property, indicating its name.

◆ setDouble() [2/2]

void te::mem::DataSetItem::setDouble ( std::size_t  i,
double  value 
)
inherited

It sets the value of the i-th property.

◆ setFirstGeometry()

void te::vp::Feature::setFirstGeometry ( te::gm::Geometry geometry)

Sets the first geometry value associated to this feature. This will take the ownership of the object.

Parameters
Thegeometry to be associated to this feature

◆ setFloat() [1/2]

void te::mem::DataSetItem::setFloat ( const std::string &  name,
float  value 
)
inherited

It sets the value of the property, indicating its name.

◆ setFloat() [2/2]

void te::mem::DataSetItem::setFloat ( std::size_t  i,
float  value 
)
inherited

It sets the value of the i-th property.

◆ setGeometry() [1/2]

void te::mem::DataSetItem::setGeometry ( const std::string &  name,
te::gm::Geometry value 
)
inherited

It sets the value of the property, indicating its name.

Note
It will take the ownership of the given pointer.

◆ setGeometry() [2/2]

void te::mem::DataSetItem::setGeometry ( std::size_t  i,
te::gm::Geometry value 
)
inherited

It sets the value of the i-th property.

Note
It will take the ownership of the given pointer.

◆ setInt16() [1/2]

void te::mem::DataSetItem::setInt16 ( const std::string &  name,
boost::int16_t  value 
)
inherited

It sets the value of the property, indicating its name.

◆ setInt16() [2/2]

void te::mem::DataSetItem::setInt16 ( std::size_t  i,
boost::int16_t  value 
)
inherited

It sets the value of the i-th property.

◆ setInt32() [1/2]

void te::mem::DataSetItem::setInt32 ( const std::string &  name,
boost::int32_t  value 
)
inherited

It sets the value of the property, indicating its name.

◆ setInt32() [2/2]

void te::mem::DataSetItem::setInt32 ( std::size_t  i,
boost::int32_t  value 
)
inherited

It sets the value of the i-th property.

◆ setInt64() [1/2]

void te::mem::DataSetItem::setInt64 ( const std::string &  name,
boost::int64_t  value 
)
inherited

It sets the value of the property, indicating its name.

◆ setInt64() [2/2]

void te::mem::DataSetItem::setInt64 ( std::size_t  i,
boost::int64_t  value 
)
inherited

It sets the value of the i-th property.

◆ setNumeric() [1/2]

void te::mem::DataSetItem::setNumeric ( const std::string &  name,
const std::string &  value 
)
inherited

It sets the value of the property, indicating its name.

◆ setNumeric() [2/2]

void te::mem::DataSetItem::setNumeric ( std::size_t  i,
const std::string &  value 
)
inherited

It sets the value of the i-th property.

◆ setRaster() [1/2]

void te::mem::DataSetItem::setRaster ( const std::string &  name,
te::rst::Raster value 
)
inherited

It sets the value of the property, indicating its name.

◆ setRaster() [2/2]

void te::mem::DataSetItem::setRaster ( std::size_t  i,
te::rst::Raster value 
)
inherited

It sets the value of the i-th property.

Note
It will take the ownership of the given pointer.

◆ setSRID()

void te::vp::Feature::setSRID ( int  srid)

◆ setString() [1/2]

void te::mem::DataSetItem::setString ( const std::string &  name,
const std::string &  value 
)
inherited

It sets the value of the property, indicating its name.

◆ setString() [2/2]

void te::mem::DataSetItem::setString ( std::size_t  i,
const std::string &  value 
)
inherited

It sets the value of the i-th property.

◆ setUChar() [1/2]

void te::mem::DataSetItem::setUChar ( const std::string &  name,
unsigned char  value 
)
inherited

It sets the value of the property, indicating its name.

◆ setUChar() [2/2]

void te::mem::DataSetItem::setUChar ( std::size_t  i,
unsigned char  value 
)
inherited

It sets the value of the i-th property.

◆ setValue() [1/2]

void te::mem::DataSetItem::setValue ( const std::string &  name,
te::dt::AbstractData value 
)
inherited

It sets the value of the property, indicating its name.

Note
It will take the ownership of the given pointer.

◆ setValue() [2/2]

void te::mem::DataSetItem::setValue ( std::size_t  i,
te::dt::AbstractData value 
)
inherited

It sets the value of the i-th property.

Note
It will take the ownership of the given pointer.

◆ transform() [1/2]

void te::vp::Feature::transform ( int  srid)

It converts the coordinate values of the feature to the new spatial reference system.

Parameters
Thenew Spatial Reference System ID used to transform the coordinates of the feature.

◆ transform() [2/2]

void te::vp::Feature::transform ( te::srs::Converter converter)

It converts the coordinate values of the feature to the new spatial reference system.

Parameters
Thenew Spatial Reference System ID used to transform the coordinates of the feature. Sets the srid of the feature. The given value will be applied to all geometries

Member Data Documentation

◆ m_data

boost::ptr_vector<boost::nullable<te::dt::AbstractData> > te::da::DataSetItem::m_data
protectedinherited

The data values of the.

Definition at line 236 of file DataSetItem.h.

◆ m_firstGeometryPropertyPos

std::size_t te::vp::Feature::m_firstGeometryPropertyPos
protected

Definition at line 156 of file Feature.h.

◆ m_vecNames

std::vector<std::string> te::da::DataSetItem::m_vecNames
protectedinherited

Vector containing the names of the attributes of the dataSet item.

Definition at line 234 of file DataSetItem.h.

◆ m_vecTypes

std::vector<int> te::da::DataSetItem::m_vecTypes
protectedinherited

Vector containing the types of the attributes of the dataSet item.

Definition at line 235 of file DataSetItem.h.


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