te::stmem::DataSet Class Reference

Implementation of a in-memory data set that contains spatiotemporal observations indexed by time and space. More...

#include <DataSet.h>

Inheritance diagram for te::stmem::DataSet:
te::da::DataSet

Public Member Functions

void add (const std::pair< te::dt::DateTime *, DateSetItemShrPtr > &item)
 It adds an existing item to the dataset. More...
 
void add (te::mem::DataSetItem *item)
 It adds a new item to the dataset and takes its ownership. More...
 
std::unique_ptr< DataSetclone () const
 It returns a clone of the DataSet. More...
 
void copy (te::da::DataSet *src, unsigned int limit=0)
 It copies up to limit items from the source dataset. More...
 
void copy (te::da::DataSet *src, const std::vector< std::size_t > &properties, unsigned int limit=0)
 It copies up to limit items from the source dataset (src). More...
 
 DataSet (const te::da::DataSetType *type, size_t tpPropIdx)
 It constructs an empty in-memory dataset indexed by time and space. More...
 
 DataSet (const te::da::DataSetType *type, size_t tpPropIdx, size_t gmPropIdx)
 It constructs an empty in-memory dataset indexed by time and space. More...
 
 DataSet (const te::da::DataSetType *type, size_t begTimePropIdx, size_t endTimePropIdx, size_t gmPropIdx)
 It constructs an empty in-memory dataset indexed by time and space. More...
 
 DataSet (const std::vector< std::string > &pnames, const std::vector< int > &ptyes, size_t begTimePropIdx, size_t endTimePropIdx, size_t gmPropIdx)
 It constructs an empty in-memory dataset indexed by time and space. More...
 
 DataSet (te::da::DataSet *ds, size_t tpPropIdx, size_t gmPropIdx=-1, unsigned int limit=0)
 It constructs an in-memory observation dataset from a given data set. More...
 
 DataSet (te::da::DataSet *ds, size_t begTimePropIdx, size_t endTimePropIdx, size_t gmPropIdx, unsigned int limit)
 It constructs an in-memory observation dataset from a given data set. More...
 
 DataSet (const DataSet &rhs, const bool deepCopy=false)
 Regular copy constructor. More...
 
std::unique_ptr< DataSetfilter (const te::gm::Envelope *e, te::gm::SpatialRelation r) const
 It returns a new DataSet, based on a given spatial filter. More...
 
std::unique_ptr< DataSetfilter (const te::gm::Geometry *g, te::gm::SpatialRelation r) const
 It returns a new DataSet, based on a given spatial filter. More...
 
std::unique_ptr< DataSetfilter (const te::dt::DateTime *dt, te::dt::TemporalRelation tr) const
 It returns a new DataSet, based on a given temporal filter. More...
 
std::unique_ptr< DataSetfilter (const te::gm::Envelope *e, te::gm::SpatialRelation r, const te::dt::DateTime *dt, te::dt::TemporalRelation tr) const
 It returns a new DataSet, based on a given spatial and temporal filter. More...
 
std::unique_ptr< DataSetfilter (const te::gm::Geometry *g, te::gm::SpatialRelation r, const te::dt::DateTime *dt, te::dt::TemporalRelation tr) const
 It returns a new DataSet, based on a given spatial filter. More...
 
int getBeginTimePropIdx () const
 It returns the index of the property that contains the beginning phenomenon time. More...
 
const TimeToDataSetItemMapgetData () const
 It returns a reference to the internal observation set. More...
 
int getEndTimePropIdx () const
 It returns the index of the property that contains the end phenomenon time. More...
 
int getGeomPropIdx () const
 It returns the index of the property that contains the observed geometries. More...
 
std::unique_ptr< te::dt::DateTimePeriodgetTemporalExtent () const
 It returns the temporal extent of the observations. More...
 
std::unique_ptr< te::stmem::DataSetnearestObservations (const te::dt::DateTime *time, int n) const
 It returns the n nearest observations to a given date and time. More...
 
DataSetoperator= (const DataSet &rhs)
 Assignment operator. More...
 
 ~DataSet ()
 Destructor. More...
 
DataSet inherited methods
te::common::TraverseType getTraverseType () const
 It returns the traverse type associated to the dataset. More...
 
te::common::AccessPolicy getAccessPolicy () const
 It returns the read and write permission associated to the dataset. More...
 
std::size_t getNumProperties () const
 It returns the number of properties that composes an item of the dataset. More...
 
int getPropertyDataType (std::size_t i) const
 It returns the underlying data type of the property at position pos. More...
 
std::string getPropertyName (std::size_t i) const
 It returns the property name at position pos. More...
 
std::string getDatasetNameOfProperty (std::size_t i) const
 It returns the underlying dataset name of the property at position pos. More...
 
bool isEmpty () const
 It returns true if the collection is empty. More...
 
bool isConnected () const
 It returns true if the dataset is connected and false if it is disconnected. A dataset can be connected or disconnected. A connected dataset, after its creation through the data source transactor, continues to depend on the connection given by its associated data source. Differently, a disconnected dataset, after its creation, no more depends of the connection given by the data source, and it continues to live after the connection has been released to the data source. More...
 
std::size_t size () const
 It returns the collection size, if it is known. More...
 
std::unique_ptr< te::gm::EnvelopegetExtent (std::size_t i)
 It computes the bounding rectangle for a spatial property of the dataset. More...
 
bool moveNext ()
 It moves the internal pointer to the next item of the collection. More...
 
bool movePrevious ()
 It moves the internal pointer to the previous item of the collection. More...
 
bool moveBeforeFirst ()
 It moves the internal pointer to a position before the first item in the collection. More...
 
bool moveFirst ()
 It moves the internal pointer to the first item in the collection. More...
 
bool moveLast ()
 It sets the dataset internal pointer to the last item in the collection. More...
 
bool move (std::size_t i)
 It moves the dataset internal pointer to a given position. More...
 
bool isAtBegin () const
 It tells if the dataset internal pointer is on the first element of the collection or not. More...
 
bool isBeforeBegin () const
 It tells if the dataset internal pointer is in a position before the first element of the collection or not. More...
 
bool isAtEnd () const
 It tells if the dataset internal pointer is on the last element of the collection. More...
 
bool isAfterEnd () const
 It tells if the dataset internal pointer is on the sentinel position after the last element of the collection or not. More...
 
bool isPositionValid () const
 It tells if the dataset internal pointer is on a valid position. More...
 
char getChar (std::size_t i) const
 Method for retrieving a signed character attribute value (1 byte long). More...
 
unsigned char getUChar (std::size_t i) const
 Method for retrieving an unsigned character attribute value (1 byte long). More...
 
boost::int16_t getInt16 (std::size_t i) const
 Method for retrieving a 16-bit integer attribute value (2 bytes long). More...
 
boost::int32_t getInt32 (std::size_t i) const
 Method for retrieving a 32-bit integer attribute value (4 bytes long). More...
 
boost::int64_t getInt64 (std::size_t i) const
 Method for retrieving a 64-bit integer attribute value (8 bytes long). More...
 
bool getBool (std::size_t i) const
 Method for retrieving a boolean attribute value. More...
 
float getFloat (std::size_t i) const
 Method for retrieving a float attribute value. More...
 
double getDouble (std::size_t i) const
 Method for retrieving a double attribute value. More...
 
std::string getNumeric (std::size_t i) const
 Method for retrieving a numeric attribute value. More...
 
std::string getString (std::size_t i) const
 Method for retrieving a string value attribute. More...
 
std::unique_ptr< te::dt::ByteArraygetByteArray (std::size_t i) const
 Method for retrieving a byte array. More...
 
std::unique_ptr< te::gm::GeometrygetGeometry (std::size_t i) const
 Method for retrieving a geometric attribute value. More...
 
std::unique_ptr< te::rst::RastergetRaster (std::size_t i) const
 Method for retrieving a raster attribute value. More...
 
std::unique_ptr< te::dt::DateTimegetDateTime (std::size_t i) const
 Method for retrieving a date and time attribute value. More...
 
std::unique_ptr< te::dt::ArraygetArray (std::size_t i) const
 Method for retrieving an array. More...
 
bool isNull (std::size_t i) const
 It checks if the attribute value is NULL. More...
 
std::unique_ptr< te::dt::AbstractDatagetValue (std::size_t i) const
 Method for retrieving any other type of data value stored in the data source. More...
 
Methods to set values to the DataSet
Note
These methods will take the ownership of the given pointers.
void setChar (std::size_t i, char value)
 
void setChar (const std::string &name, char value)
 
void setUChar (std::size_t i, unsigned char value)
 
void setUChar (const std::string &name, unsigned char value)
 
void setInt16 (std::size_t i, boost::int16_t value)
 
void setInt16 (const std::string &name, boost::int16_t value)
 
void setInt32 (std::size_t i, boost::int32_t value)
 
void setInt32 (const std::string &name, boost::int32_t value)
 
void setInt64 (std::size_t i, boost::int64_t value)
 
void setInt64 (const std::string &name, boost::int64_t value)
 
void setBool (std::size_t i, bool value)
 
void setBool (const std::string &name, bool value)
 
void setFloat (std::size_t i, float value)
 
void setFloat (const std::string &name, float value)
 
void setDouble (std::size_t i, double value)
 
void setDouble (const std::string &name, double value)
 
void setNumeric (std::size_t i, const std::string &value)
 
void setNumeric (const std::string &name, const std::string &value)
 
void setString (std::size_t i, const std::string &value)
 
void setString (const std::string &name, const std::string &value)
 
void setByteArray (std::size_t i, te::dt::ByteArray *value)
 
void setByteArray (const std::string &name, te::dt::ByteArray *value)
 
void setGeometry (std::size_t i, te::gm::Geometry *value)
 
void setGeometry (const std::string &name, te::gm::Geometry *value)
 
void setRaster (std::size_t i, te::rst::Raster *value)
 
void setRaster (const std::string &name, te::rst::Raster *value)
 
void setDateTime (std::size_t i, te::dt::DateTime *value)
 
void setDateTime (const std::string &name, te::dt::DateTime *value)
 
void setValue (std::size_t i, te::dt::AbstractData *value)
 
void setValue (const std::string &name, te::dt::AbstractData *ad)
 
DataSet Element Properties

Methods for retrieving/setting the dataset item component values without the need to explicitly instantiate an item via getItem method.

virtual char getChar (const std::string &name) const
 Method for retrieving a signed character attribute value (1 byte long). More...
 
virtual unsigned char getUChar (const std::string &name) const
 Method for retrieving an unsigned character attribute value (1 byte long). More...
 
virtual boost::int16_t getInt16 (const std::string &name) const
 Method for retrieving a 16-bit integer attribute value (2 bytes long). More...
 
virtual boost::int32_t getInt32 (const std::string &name) const
 Method for retrieving a 32-bit integer attribute value (4 bytes long). More...
 
virtual boost::int64_t getInt64 (const std::string &name) const
 Method for retrieving a 64-bit integer attribute value (8 bytes long). More...
 
virtual bool getBool (const std::string &name) const
 Method for retrieving a boolean attribute value. More...
 
virtual float getFloat (const std::string &name) const
 Method for retrieving a float attribute value. More...
 
virtual double getDouble (const std::string &name) const
 Method for retrieving a double attribute value. More...
 
virtual std::string getNumeric (const std::string &name) const
 Method for retrieving a numeric attribute value. More...
 
virtual std::string getString (const std::string &name) const
 Method for retrieving a string attribute value. More...
 
virtual std::unique_ptr< te::dt::ByteArraygetByteArray (const std::string &name) const
 Method for retrieving a byte array. More...
 
virtual std::unique_ptr< te::gm::GeometrygetGeometry (const std::string &name) const
 Method for retrieving a geometric attribute value. More...
 
virtual std::unique_ptr< te::rst::RastergetRaster (const std::string &name) const
 Method for retrieving a raster attribute value. More...
 
virtual std::unique_ptr< te::dt::DateTimegetDateTime (const std::string &name) const
 Method for retrieving a date and time attribute value. More...
 
virtual std::unique_ptr< te::dt::ArraygetArray (const std::string &name) const
 Method for retrieving an array. More...
 
virtual std::unique_ptr< te::dt::AbstractDatagetValue (const std::string &name) const
 Method for retrieving any other type of data value stored in the data source. More...
 
virtual std::string getAsString (std::size_t i, int precision=0) const
 Method for retrieving a data value as a string plain representation. More...
 
virtual std::string getAsString (const std::string &name, int precision=0) const
 Method for retrieving a data value as a string plain representation. More...
 
virtual bool isNull (const std::string &name) const
 It checks if the attribute value is NULL. More...
 

Protected Attributes

bool m_beforeFirst
 
int m_begTimePropIdx
 The property index of the DataSetType that contains the phenomenon beginning time. More...
 
int m_endTimePropIdx
 The property index of the DataSetType that contains the phenomenon end time. More...
 
int m_geomPropIdx
 The property index of the DataSetType that contains geometries. More...
 
TimeToDataSetItemMap m_items
 The list of dataset items, ordered by time. More...
 
TimeToDataSetItemMap::const_iterator m_iterator
 The pointer to the current item. More...
 
std::vector< std::string > m_pnames
 internal control More...
 
std::vector< intm_ptypes
 The list of property types. More...
 
std::unique_ptr< te::sam::rtree::Index< te::mem::DataSetItem * > > m_RTree
 A RTree index created over the default geometry property. More...
 

Detailed Description

Implementation of a in-memory data set that contains spatiotemporal observations indexed by time and space.

See also
te::da::DataSet

Definition at line 61 of file stmemory/DataSet.h.

Constructor & Destructor Documentation

te::stmem::DataSet::DataSet ( const te::da::DataSetType type,
size_t  tpPropIdx 
)

It constructs an empty in-memory dataset indexed by time and space.

Parameters
dtthe schema of the in-memory observation DataSet that will be created.
tpPropIdxthe property index of the DataSetType "dt" that contains the observation phenomenon time.
gmPropIdxthe property index of the DataSetType "dt" that contains geometries.
Note
DataSet will NOT take the ownership of the given pointer.

Definition at line 54 of file stmemory/DataSet.cpp.

References te::da::GetPropertyInfo(), m_pnames, m_ptypes, and m_RTree.

te::stmem::DataSet::DataSet ( const te::da::DataSetType type,
size_t  tpPropIdx,
size_t  gmPropIdx 
)

It constructs an empty in-memory dataset indexed by time and space.

Parameters
dtthe schema of the in-memory observation DataSet that will be created.
tpPropIdxthe property index of the DataSetType "dt" that contains the observation phenomenon time.
gmPropIdxthe property index of the DataSetType "dt" that contains geometries.
Note
DataSet will NOT take the ownership of the given pointer.

Definition at line 67 of file stmemory/DataSet.cpp.

References te::da::GetPropertyInfo(), m_pnames, m_ptypes, and m_RTree.

te::stmem::DataSet::DataSet ( const te::da::DataSetType type,
size_t  begTimePropIdx,
size_t  endTimePropIdx,
size_t  gmPropIdx 
)

It constructs an empty in-memory dataset indexed by time and space.

Parameters
dtthe schema of the in-memory observation DataSet that will be created.
begTimePropIdxthe property index of the DataSetType "dt" that contains the observation phenomenon beginning time.
endTimePropIdxthe property index of the DataSetType "dt" that contains the observation phenomenon end time.
gmPropIdxthe property index of the DataSetType "dt" that contains geometries.
Note
DataSet will NOT take the ownership of the given pointer.

Definition at line 81 of file stmemory/DataSet.cpp.

References te::da::GetPropertyInfo(), m_pnames, m_ptypes, and m_RTree.

te::stmem::DataSet::DataSet ( const std::vector< std::string > &  pnames,
const std::vector< int > &  ptyes,
size_t  begTimePropIdx,
size_t  endTimePropIdx,
size_t  gmPropIdx 
)

It constructs an empty in-memory dataset indexed by time and space.

Parameters
pnamesThe names of the properties.
ptypesThe types of the properties.
begTimePropIdxThe property index of the ptypes vector that contains the observation phenomenon beginning time.
endTimePropIdxThe property index of the ptypes vector that contains the observation phenomenon end time.
gmPropIdxThe property index of the ptypes vector that contains geometries.

Definition at line 96 of file stmemory/DataSet.cpp.

References m_RTree.

te::stmem::DataSet::DataSet ( te::da::DataSet ds,
size_t  tpPropIdx,
size_t  gmPropIdx = -1,
unsigned int  limit = 0 
)

It constructs an in-memory observation dataset from a given data set.

It creates a new in-memory observation dataset with the items from the given dataset.

Parameters
dsthe dataset which will provide the observations.
tpPropIdxthe property index of the DataSet "ds" that contains the observation phenomenon time
gmPropIdxthe property index of the DataSet "ds" that contains geometries
limitThe number of items to be copied. Use 0 to copy all items.
Precondition
You must assure that ds is a valid item to be read.
You must assure that ds has a valid type associated to it, that is, getType() is valid.
Note
This constructor will use the method "moveNext()" of the source dataset (ds) in order to read its items. It will start reading the given dataset in the current position. So, the caller is responsible for informing the dataset in the right position to start processing it.
DataSet will NOT take the ownership of the given ds pointer.
The new dataset will not have a transactor associated to it.

Definition at line 111 of file stmemory/DataSet.cpp.

References copy(), te::da::GetPropertyInfo(), m_pnames, m_ptypes, and m_RTree.

te::stmem::DataSet::DataSet ( te::da::DataSet ds,
size_t  begTimePropIdx,
size_t  endTimePropIdx,
size_t  gmPropIdx,
unsigned int  limit 
)

It constructs an in-memory observation dataset from a given data set.

It creates a new in-memory observation dataset with the items from the given dataset.

Parameters
dsthe dataset which will provide the observations.
begTimePropIdxthe property index of the DataSetType "dt" that contains the observation phenomenon beginning time.
endTimePropIdxthe property index of the DataSetType "dt" that contains the observation phenomenon end time.
gmPropIdxthe property index of the DataSet "ds" that contains geometries
limitThe number of items to be copied. Use 0 to copy all items.
Precondition
You must assure that ds is in a valid item to be read.
You must assure that ds has a valid type associated to it, that is, getType() is valid.
Note
This constructor will use the method "moveNext()" of the source dataset (ds) in order to read its items. It will start reading the given dataset in the current position. So, the caller is responsible for informing the dataset in the right position to start processing it.
DataSet will NOT take the ownership of the given ds pointer.
The new dataset will not have a transactor associated to it.

Definition at line 128 of file stmemory/DataSet.cpp.

References copy(), te::da::GetPropertyInfo(), m_pnames, m_ptypes, and m_RTree.

te::stmem::DataSet::DataSet ( const DataSet rhs,
const bool  deepCopy = false 
)

Regular copy constructor.

It creates a new in-memory observation dataset with the items from the rhs dataset.

Parameters
rhsThe dataset which will provide the items.
deepCopyIf true the new dataset instance will clone all dataset items from the source dataset (rhs), otherwise it will share all items.
Precondition
You must assure that rhs is in a valid item to be read.
You must assure that rhs has a valid type associated to it, that is, getType() is valid.
Note
This constructor will copy all items from the given DataSet rhs, independently on its current position.

Definition at line 146 of file stmemory/DataSet.cpp.

References add(), m_items, and m_RTree.

te::stmem::DataSet::~DataSet ( )
virtual

Destructor.

Reimplemented from te::da::DataSet.

Definition at line 193 of file stmemory/DataSet.cpp.

References m_items.

Member Function Documentation

void te::stmem::DataSet::add ( const std::pair< te::dt::DateTime *, DateSetItemShrPtr > &  item)

It adds an existing item to the dataset.

This method must be used when the user wants to share the same item among DataSets. After adding the item, it updates the internal RTree.

Parameters
itemAn existing item coming from another DataSet.
Precondition
The item schema must be compatible with the dataset items.
Note
The first element of the pair (DateTime*) will be cloned.
It will not take the ownership of the first element of the given pair.

Definition at line 270 of file stmemory/DataSet.cpp.

References dt, m_geomPropIdx, m_items, and m_RTree.

Referenced by add(), copy(), DataSet(), and operator=().

void te::stmem::DataSet::add ( te::mem::DataSetItem item)

It adds a new item to the dataset and takes its ownership.

Parameters
itemThe item to be added to the dataset.
Precondition
The item schema must be compatible with the dataset items.
Note
It will take the ownership of the item pointer.

Definition at line 288 of file stmemory/DataSet.cpp.

References add(), te::dt::GetTimePeriod(), m_begTimePropIdx, m_endTimePropIdx, and p.

std::unique_ptr< te::stmem::DataSet > te::stmem::DataSet::clone ( ) const

It returns a clone of the DataSet.

Returns
a clone of the DataSet
Note
The caller will take the ownership of the returned pointer.

Definition at line 332 of file stmemory/DataSet.cpp.

References DataSet().

void te::stmem::DataSet::copy ( te::da::DataSet src,
unsigned int  limit = 0 
)

It copies up to limit items from the source dataset.

Parameters
srcThe source dataset with the items that will be copied.
limitThe number of items to be copied. Use 0 to copy all items.
Precondition
The internal DataSetType and ObservationSetType must be already created and valid.
The internal DataSetType must be equal to the given DataSet src
Note
This method will call moveNext() for the source dataset in order to read its items. It will start reading the given dataset in the current position. So, the caller is responsible for informing the dataset in the right position to start processing it.

Definition at line 205 of file stmemory/DataSet.cpp.

References te::da::DataSet::getNumProperties().

Referenced by DataSet().

void te::stmem::DataSet::copy ( te::da::DataSet src,
const std::vector< std::size_t > &  properties,
unsigned int  limit = 0 
)

It copies up to limit items from the source dataset (src).

Parameters
srcThe source dataset with the items that will be copied.
propertiesThe list of properties which will be considered in the copy.
limitThe number of items to be copied. Use 0 to copy all items.
Precondition
The properties in the property vector must come from the source dataset (src) schema. In other words, they must be valid pointers in the src dataset type.
The internal DataSetType must be already created, using the given properties.
Note
This method will call moveNext() for the source dataset in order to read its items. It will start reading the given dataset in the current position. So, the caller is responsible for informing the dataset in the right position to start processing it.

Definition at line 217 of file stmemory/DataSet.cpp.

References add(), te::da::DataSet::getValue(), te::da::DataSet::isNull(), and te::da::DataSet::moveNext().

std::unique_ptr< te::stmem::DataSet > te::stmem::DataSet::filter ( const te::gm::Envelope e,
te::gm::SpatialRelation  r 
) const

It returns a new DataSet, based on a given spatial filter.

Parameters
eA given envelope
rA given spatial relation.
Returns
a new DataSet
Note
For while, it only works if the spatial relation is te::gm::INTERSECTS
The caller will take the ownership of the returned pointer.
The returned DataSet will NOT share the intenal observations. It will clone the internal observations.

Definition at line 337 of file stmemory/DataSet.cpp.

References te::da::DataSet::DataSet(), te::gm::INTERSECTS, m_begTimePropIdx, m_endTimePropIdx, m_geomPropIdx, m_pnames, m_ptypes, and m_RTree.

Referenced by filter(), and te::stmem::Transactor::getDataSet().

std::unique_ptr< te::stmem::DataSet > te::stmem::DataSet::filter ( const te::gm::Geometry g,
te::gm::SpatialRelation  r 
) const

It returns a new DataSet, based on a given spatial filter.

Parameters
gA given geometry
rA given spatial relation.
Returns
a new DataSet
Note
For while, it only works if the spatial relation is te::gm::INTERSECTS
The caller will take the ownership of the returned pointer.
The returned DataSet will NOT share the intenal observations. It will clone the internal observations.

Definition at line 354 of file stmemory/DataSet.cpp.

References te::da::DataSet::DataSet(), getGeometry(), te::gm::Geometry::getMBR(), te::gm::INTERSECTS, m_begTimePropIdx, m_endTimePropIdx, m_geomPropIdx, m_pnames, m_ptypes, and m_RTree.

std::unique_ptr< te::stmem::DataSet > te::stmem::DataSet::filter ( const te::dt::DateTime dt,
te::dt::TemporalRelation  tr 
) const

It returns a new DataSet, based on a given temporal filter.

Parameters
dtA given date time
trA given temporal relation.
Returns
a new DataSet
Note
The caller will take the ownership of the returned pointer.
The new DataSet will share the intenal observations.

Definition at line 374 of file stmemory/DataSet.cpp.

References te::dt::AFTER, te::dt::BEFORE, te::dt::AbstractData::clone(), te::da::DataSet::DataSet(), te::dt::DURING, te::dt::EQUALS, m_begTimePropIdx, m_endTimePropIdx, m_geomPropIdx, m_items, m_pnames, and m_ptypes.

std::unique_ptr< te::stmem::DataSet > te::stmem::DataSet::filter ( const te::gm::Envelope e,
te::gm::SpatialRelation  r,
const te::dt::DateTime dt,
te::dt::TemporalRelation  tr 
) const

It returns a new DataSet, based on a given spatial and temporal filter.

Parameters
eA given envelope
rA given spatial relation.
dtA given date time
trA given temporal relation.
Returns
a new DataSet
Note
The caller will take the ownership of the returned pointer.
The returned DataSet will NOT share the intenal observations. It will clone the internal observations.

Definition at line 430 of file stmemory/DataSet.cpp.

References filter().

std::unique_ptr< te::stmem::DataSet > te::stmem::DataSet::filter ( const te::gm::Geometry g,
te::gm::SpatialRelation  r,
const te::dt::DateTime dt,
te::dt::TemporalRelation  tr 
) const

It returns a new DataSet, based on a given spatial filter.

Parameters
gA given geometry
rA given spatial relation.
dtA given date time
trA given temporal relation.
Returns
a new DataSet
Note
The caller will take the ownership of the returned pointer.
The returned DataSet will NOT share the intenal observations. It will clone the internal observations.

Definition at line 437 of file stmemory/DataSet.cpp.

References filter().

te::common::AccessPolicy te::stmem::DataSet::getAccessPolicy ( ) const
virtual

It returns the read and write permission associated to the dataset.

Returns
The read and write permission associated to the dataset.

Implements te::da::DataSet.

Definition at line 493 of file stmemory/DataSet.cpp.

References te::common::RWAccess.

std::unique_ptr< te::dt::Array > te::stmem::DataSet::getArray ( std::size_t  i) const
virtual

Method for retrieving an array.

Parameters
iThe attribute index.

Implements te::da::DataSet.

Definition at line 835 of file stmemory/DataSet.cpp.

std::unique_ptr< te::dt::Array > te::da::DataSet::getArray ( const std::string &  name) const
virtualinherited

Method for retrieving an array.

Parameters
nameThe attribute name.
Returns
An array. The caller will take its ownership.

Reimplemented in te::gdal::DataSet.

Definition at line 145 of file dataaccess/dataset/DataSet.cpp.

References te::da::DataSet::getArray(), and te::da::GetPropertyPos().

std::string te::da::DataSet::getAsString ( std::size_t  i,
int  precision = 0 
) const
virtualinherited

Method for retrieving a data value as a string plain representation.

Parameters
iThe attribute index.
precisionThe precision in the conversion.
Returns
The attribute value in a string format.
Note
It is safe to call this method for any data type, the data source implementation will take care of how to convert the internal representation to a string.

Definition at line 219 of file dataaccess/dataset/DataSet.cpp.

References te::dt::ARRAY_TYPE, b, te::dt::BOOLEAN_TYPE, te::dt::BYTE_ARRAY_TYPE, te::dt::CHAR_TYPE, te::common::Convert2String(), te::dt::DATETIME_TYPE, te::dt::DOUBLE_TYPE, te::dt::FLOAT_TYPE, te::dt::GEOMETRY_TYPE, te::da::DataSet::getArray(), te::da::DataSet::getBool(), te::da::DataSet::getByteArray(), te::da::DataSet::getChar(), te::da::DataSet::getDateTime(), te::da::DataSet::getDouble(), te::da::DataSet::getFloat(), te::da::DataSet::getGeometry(), te::da::DataSet::getInt16(), te::da::DataSet::getInt32(), te::da::DataSet::getInt64(), te::da::DataSet::getNumeric(), te::da::DataSet::getPropertyDataType(), te::da::DataSet::getRaster(), te::da::DataSet::getString(), te::da::DataSet::getUChar(), te::dt::INT16_TYPE, te::dt::INT32_TYPE, te::dt::INT64_TYPE, te::dt::NUMERIC_TYPE, te::dt::RASTER_TYPE, te::dt::STRING_TYPE, and te::dt::UCHAR_TYPE.

Referenced by te::ogr::Transactor::add(), te::gpkg::Transactor::add(), te::sa::AssociateGPMVertexAttribute(), te::sa::KernelMapOperation::buildTree(), te::sa::KernelRatioOperation::buildTree(), te::sa::SkaterOperation::createDataSet(), te::qt::widgets::DataSetTableModel::data(), te::map::QueryLayerRenderer::drawDatSetGeometries(), te::da::DataSet::getAsString(), te::attributefill::VectorToVectorMemory::getDistinctClasses(), te::qt::widgets::DefaultFeatureInfoMaker::getGeometryInfo(), te::edit::EditInfoTool::getInfo(), te::qt::widgets::Promoter::preProcessKeys(), PrintDataSet(), PrintDataSetValues(), te::sa::BayesLocalOperation::runBayesLocal(), ToHighlight(), te::da::TupleToStringConverter(), TupleToStringUpperCaseConverter(), te::ado::Transactor::update(), and te::pgis::Transactor::update().

std::string te::da::DataSet::getAsString ( const std::string &  name,
int  precision = 0 
) const
virtualinherited

Method for retrieving a data value as a string plain representation.

Parameters
nameThe attribute name.
precisionThe precision in the conversion.
Returns
The attribute value in a string format.
Exceptions
Exceptionif property not found.
Note
It is safe to call this method for any data type, the data source implementation will take care of how to convert the internal representation to a string.

Definition at line 307 of file dataaccess/dataset/DataSet.cpp.

References te::da::DataSet::getAsString(), te::da::DataSet::getNumProperties(), te::da::GetPropertyPos(), and TE_TR.

int te::stmem::DataSet::getBeginTimePropIdx ( ) const

It returns the index of the property that contains the beginning phenomenon time.

Returns
An index of the property that conatins the beginning phenomenon time.

Definition at line 260 of file stmemory/DataSet.cpp.

References m_begTimePropIdx.

bool te::da::DataSet::getBool ( const std::string &  name) const
virtualinherited

Method for retrieving a boolean attribute value.

Parameters
nameThe attribute name.
Returns
The boolean attribute value with the given name.

Reimplemented in te::gdal::DataSet.

Definition at line 82 of file dataaccess/dataset/DataSet.cpp.

References te::da::DataSet::getBool(), and te::da::GetPropertyPos().

bool te::stmem::DataSet::getBool ( std::size_t  i) const
virtual

Method for retrieving a boolean attribute value.

Parameters
iThe attribute index.
Returns
The boolean attribute value in the given position.

Implements te::da::DataSet.

Definition at line 705 of file stmemory/DataSet.cpp.

References m_iterator.

std::unique_ptr< te::dt::ByteArray > te::stmem::DataSet::getByteArray ( std::size_t  i) const
virtual

Method for retrieving a byte array.

You can use this method in order to retrieve a BLOB data.

Parameters
iThe attribute index.
Returns
The byte array attribute.

Implements te::da::DataSet.

Definition at line 775 of file stmemory/DataSet.cpp.

References m_iterator.

std::unique_ptr< te::dt::ByteArray > te::da::DataSet::getByteArray ( const std::string &  name) const
virtualinherited

Method for retrieving a byte array.

You can use this method in order to retrieve a BLOB data.

Parameters
nameThe attribute name.
Returns
The byte array attribute.

Reimplemented in te::gdal::DataSet.

Definition at line 117 of file dataaccess/dataset/DataSet.cpp.

References te::da::DataSet::getByteArray(), and te::da::GetPropertyPos().

char te::da::DataSet::getChar ( const std::string &  name) const
virtualinherited

Method for retrieving a signed character attribute value (1 byte long).

Parameters
nameThe attribute name.
Returns
The signed character attribute value (1 byte long) with the given name.

Reimplemented in te::gdal::DataSet.

Definition at line 47 of file dataaccess/dataset/DataSet.cpp.

References te::da::DataSet::getChar(), and te::da::GetPropertyPos().

char te::stmem::DataSet::getChar ( std::size_t  i) const
virtual

Method for retrieving a signed character attribute value (1 byte long).

Parameters
iThe attribute index.
Returns
The signed character attribute value (1 byte long) in the given position.

Implements te::da::DataSet.

Definition at line 630 of file stmemory/DataSet.cpp.

References m_iterator.

const te::stmem::TimeToDataSetItemMap & te::stmem::DataSet::getData ( ) const

It returns a reference to the internal observation set.

Returns
A reference to the internal observation set.

Definition at line 250 of file stmemory/DataSet.cpp.

References m_items.

std::string te::stmem::DataSet::getDatasetNameOfProperty ( std::size_t  i) const
virtual

It returns the underlying dataset name of the property at position pos.

Parameters
iThe property position of interest.
Returns
The underlying dataset name of the property at position pos.

Implements te::da::DataSet.

Definition at line 513 of file stmemory/DataSet.cpp.

std::unique_ptr< te::dt::DateTime > te::stmem::DataSet::getDateTime ( std::size_t  i) const
virtual

Method for retrieving a date and time attribute value.

Parameters
iThe attribute index.
Returns
The date and time attribute value in the given position.

Implements te::da::DataSet.

Definition at line 820 of file stmemory/DataSet.cpp.

References m_iterator.

std::unique_ptr< te::dt::DateTime > te::da::DataSet::getDateTime ( const std::string &  name) const
virtualinherited

Method for retrieving a date and time attribute value.

Parameters
nameThe attribute name.
Returns
The date and time attribute value with the given name.

Reimplemented in te::gdal::DataSet.

Definition at line 138 of file dataaccess/dataset/DataSet.cpp.

References te::da::DataSet::getDateTime(), and te::da::GetPropertyPos().

double te::stmem::DataSet::getDouble ( std::size_t  i) const
virtual

Method for retrieving a double attribute value.

Parameters
iThe attribute index.
Returns
The double attribute value in the given position.

Implements te::da::DataSet.

Definition at line 730 of file stmemory/DataSet.cpp.

References m_iterator.

double te::da::DataSet::getDouble ( const std::string &  name) const
virtualinherited

Method for retrieving a double attribute value.

Parameters
nameThe attribute name.
Returns
The double attribute value with the given name.

Reimplemented in te::gdal::DataSet.

Definition at line 96 of file dataaccess/dataset/DataSet.cpp.

References te::da::DataSet::getDouble(), and te::da::GetPropertyPos().

int te::stmem::DataSet::getEndTimePropIdx ( ) const

It returns the index of the property that contains the end phenomenon time.

Returns
An index of the property that conatins the end phenomenon time.

Definition at line 265 of file stmemory/DataSet.cpp.

References m_endTimePropIdx.

std::unique_ptr< te::gm::Envelope > te::stmem::DataSet::getExtent ( std::size_t  i)
virtual

It computes the bounding rectangle for a spatial property of the dataset.

Parameters
iThe position of a spatial property to get its bounding box.
Precondition
The position i must be associated to a spatial property of the dataset.
Exceptions
ExceptionIt throws an exception if something goes wrong during MBR search.
Returns
The spatial property bounding rectangle, or an invalid box, if none is found.

Implements te::da::DataSet.

Definition at line 533 of file stmemory/DataSet.cpp.

References m_geomPropIdx, m_items, and m_RTree.

Referenced by te::st::STDataLoaderFromMemDS::buildDataSet(), and te::stmem::Transactor::getExtent().

float te::stmem::DataSet::getFloat ( std::size_t  i) const
virtual

Method for retrieving a float attribute value.

Parameters
iThe attribute index.
Returns
The float attribute value in the given position.

Implements te::da::DataSet.

Definition at line 720 of file stmemory/DataSet.cpp.

References m_iterator.

float te::da::DataSet::getFloat ( const std::string &  name) const
virtualinherited

Method for retrieving a float attribute value.

Parameters
nameThe attribute name.
Returns
The float attribute value with the given name.

Reimplemented in te::gdal::DataSet.

Definition at line 89 of file dataaccess/dataset/DataSet.cpp.

References te::da::DataSet::getFloat(), and te::da::GetPropertyPos().

std::unique_ptr< te::gm::Geometry > te::stmem::DataSet::getGeometry ( std::size_t  i) const
virtual

Method for retrieving a geometric attribute value.

Parameters
iThe attribute index.
Returns
The geometric attribute value in the given position.

Implements te::da::DataSet.

Definition at line 790 of file stmemory/DataSet.cpp.

References m_iterator.

Referenced by filter().

std::unique_ptr< te::gm::Geometry > te::da::DataSet::getGeometry ( const std::string &  name) const
virtualinherited

Method for retrieving a geometric attribute value.

Parameters
nameThe attribute name.
Returns
The geometric attribute value with the given name.

Reimplemented in te::gdal::DataSet.

Definition at line 124 of file dataaccess/dataset/DataSet.cpp.

References te::da::DataSet::getGeometry(), and te::da::GetPropertyPos().

int te::stmem::DataSet::getGeomPropIdx ( ) const

It returns the index of the property that contains the observed geometries.

Returns
An index of the property that conatins the observed geometries.

Definition at line 255 of file stmemory/DataSet.cpp.

References m_geomPropIdx.

Referenced by te::stmem::Transactor::getDataSet(), and te::stmem::Transactor::getExtent().

boost::int16_t te::da::DataSet::getInt16 ( const std::string &  name) const
virtualinherited

Method for retrieving a 16-bit integer attribute value (2 bytes long).

Parameters
nameThe attribute name.
Returns
The 16-bit integer attribute value (2 bytes long) with the given name.

Reimplemented in te::gdal::DataSet.

Definition at line 61 of file dataaccess/dataset/DataSet.cpp.

References te::da::DataSet::getInt16(), and te::da::GetPropertyPos().

boost::int16_t te::stmem::DataSet::getInt16 ( std::size_t  i) const
virtual

Method for retrieving a 16-bit integer attribute value (2 bytes long).

Parameters
iThe attribute index.
Returns
The 16-bit integer attribute value (2 bytes long) in the given position.

Implements te::da::DataSet.

Definition at line 660 of file stmemory/DataSet.cpp.

References m_iterator.

boost::int32_t te::da::DataSet::getInt32 ( const std::string &  name) const
virtualinherited

Method for retrieving a 32-bit integer attribute value (4 bytes long).

Parameters
nameThe attribute name.
Returns
The 32-bit integer attribute value with the given name.

Reimplemented in te::gdal::DataSet.

Definition at line 68 of file dataaccess/dataset/DataSet.cpp.

References te::da::DataSet::getInt32(), and te::da::GetPropertyPos().

boost::int32_t te::stmem::DataSet::getInt32 ( std::size_t  i) const
virtual

Method for retrieving a 32-bit integer attribute value (4 bytes long).

Parameters
iThe attribute index.
Returns
The 32-bit integer attribute value in the given position.

Implements te::da::DataSet.

Definition at line 675 of file stmemory/DataSet.cpp.

References m_iterator.

boost::int64_t te::da::DataSet::getInt64 ( const std::string &  name) const
virtualinherited

Method for retrieving a 64-bit integer attribute value (8 bytes long).

Parameters
nameThe attribute name.
Returns
The 64-bit integer attribute value with the given name.

Reimplemented in te::gdal::DataSet.

Definition at line 75 of file dataaccess/dataset/DataSet.cpp.

References te::da::DataSet::getInt64(), and te::da::GetPropertyPos().

boost::int64_t te::stmem::DataSet::getInt64 ( std::size_t  i) const
virtual

Method for retrieving a 64-bit integer attribute value (8 bytes long).

Parameters
iThe attribute index.
Returns
The 64-bit integer attribute value in the given position.

Implements te::da::DataSet.

Definition at line 690 of file stmemory/DataSet.cpp.

References m_iterator.

std::string te::stmem::DataSet::getNumeric ( std::size_t  i) const
virtual

Method for retrieving a numeric attribute value.

Parameters
iThe attribute index.
Returns
The numeric attribute value in the given position.

Implements te::da::DataSet.

Definition at line 745 of file stmemory/DataSet.cpp.

References m_iterator.

std::string te::da::DataSet::getNumeric ( const std::string &  name) const
virtualinherited

Method for retrieving a numeric attribute value.

Parameters
nameThe attribute name.
Returns
The numeric attribute value with the given name.

Reimplemented in te::gdal::DataSet.

Definition at line 103 of file dataaccess/dataset/DataSet.cpp.

References te::da::DataSet::getNumeric(), and te::da::GetPropertyPos().

std::size_t te::stmem::DataSet::getNumProperties ( ) const
virtual

It returns the number of properties that composes an item of the dataset.

Returns
The number of properties that composes an item of the dataset.

Implements te::da::DataSet.

Definition at line 498 of file stmemory/DataSet.cpp.

References m_pnames.

int te::stmem::DataSet::getPropertyDataType ( std::size_t  i) const
virtual

It returns the underlying data type of the property at position pos.

Parameters
iThe property position of interest.
Returns
The underlying data type of the property at position pos.

Implements te::da::DataSet.

Definition at line 503 of file stmemory/DataSet.cpp.

References m_ptypes.

std::string te::stmem::DataSet::getPropertyName ( std::size_t  i) const
virtual

It returns the property name at position pos.

Parameters
iThe property name at the position of interest.
Returns
The property name at position pos.

Implements te::da::DataSet.

Definition at line 508 of file stmemory/DataSet.cpp.

References m_pnames.

std::unique_ptr< te::rst::Raster > te::stmem::DataSet::getRaster ( std::size_t  i) const
virtual

Method for retrieving a raster attribute value.

Parameters
iThe attribute index.
Returns
The raster attribute value in the given position.
Exceptions
ExceptionIt can throw an exception if:
  • something goes wrong during the data retrieval
  • the maximum number of simultaneous accesses has been reached

Implements te::da::DataSet.

Definition at line 805 of file stmemory/DataSet.cpp.

References m_iterator.

std::unique_ptr< te::rst::Raster > te::da::DataSet::getRaster ( const std::string &  name) const
virtualinherited

Method for retrieving a raster attribute value.

Parameters
nameThe attribute name.
Returns
The raster attribute value with the given name.
Exceptions
ExceptionIt can throw an exception if:
  • something goes wrong during the data retrieval
  • the maximum number of simultaneous accesses has been reached

Reimplemented in te::gdal::DataSet.

Definition at line 131 of file dataaccess/dataset/DataSet.cpp.

References te::da::GetPropertyPos(), and te::da::DataSet::getRaster().

std::string te::stmem::DataSet::getString ( std::size_t  i) const
virtual

Method for retrieving a string value attribute.

Parameters
iThe attribute index.
Returns
The string attribute value in the given position.

Implements te::da::DataSet.

Definition at line 760 of file stmemory/DataSet.cpp.

References m_iterator.

std::string te::da::DataSet::getString ( const std::string &  name) const
virtualinherited

Method for retrieving a string attribute value.

Parameters
nameThe attribute name.
Returns
The string attribute value with the given name.

Reimplemented in te::gdal::DataSet.

Definition at line 110 of file dataaccess/dataset/DataSet.cpp.

References te::da::GetPropertyPos(), and te::da::DataSet::getString().

std::unique_ptr< te::dt::DateTimePeriod > te::stmem::DataSet::getTemporalExtent ( ) const

It returns the temporal extent of the observations.

Returns
The temporal extent of the observations.
Note
The caller will take the ownership of the output pointer.

Definition at line 319 of file stmemory/DataSet.cpp.

References te::dt::GetTemporalExtent(), and m_items.

Referenced by te::st::STDataLoaderFromMemDS::buildDataSet(), and te::stmem::Transactor::getTemporalExtent().

te::common::TraverseType te::stmem::DataSet::getTraverseType ( ) const
virtual

It returns the traverse type associated to the dataset.

Returns
The traverse type associated to the dataset.

Implements te::da::DataSet.

Definition at line 488 of file stmemory/DataSet.cpp.

References te::common::BIDIRECTIONAL.

unsigned char te::da::DataSet::getUChar ( const std::string &  name) const
virtualinherited

Method for retrieving an unsigned character attribute value (1 byte long).

Parameters
nameThe attribute name.
Returns
The unsigned character attribute value (1 byte long) with the given name.

Reimplemented in te::gdal::DataSet.

Definition at line 54 of file dataaccess/dataset/DataSet.cpp.

References te::da::GetPropertyPos(), and te::da::DataSet::getUChar().

unsigned char te::stmem::DataSet::getUChar ( std::size_t  i) const
virtual

Method for retrieving an unsigned character attribute value (1 byte long).

Parameters
iThe attribute index.
Returns
The unsigned character attribute value (1 byte long) in the given position.

Implements te::da::DataSet.

Definition at line 645 of file stmemory/DataSet.cpp.

References m_iterator.

std::unique_ptr< te::dt::AbstractData > te::stmem::DataSet::getValue ( std::size_t  i) const
virtual

Method for retrieving any other type of data value stored in the data source.

This method can be use for extensible datatypes.

Parameters
iThe attribute index.
Returns
A pointer to the data value.

Reimplemented from te::da::DataSet.

Definition at line 840 of file stmemory/DataSet.cpp.

References m_iterator.

std::unique_ptr< te::dt::AbstractData > te::da::DataSet::getValue ( const std::string &  name) const
virtualinherited

Method for retrieving any other type of data value stored in the data source.

This method can be use for extensible datatypes.

Parameters
nameThe attribute name.
Returns
A pointer to the data value.

Definition at line 212 of file dataaccess/dataset/DataSet.cpp.

References te::da::GetPropertyPos(), and te::da::DataSet::getValue().

bool te::stmem::DataSet::isAfterEnd ( ) const
virtual

It tells if the dataset internal pointer is on the sentinel position after the last element of the collection or not.

Returns
True, if the dataset internal pointer is on the sentinel position after the last element otherwise it returns false.

Implements te::da::DataSet.

Definition at line 620 of file stmemory/DataSet.cpp.

References m_items, and m_iterator.

Referenced by isPositionValid().

bool te::stmem::DataSet::isAtBegin ( ) const
virtual

It tells if the dataset internal pointer is on the first element of the collection or not.

Returns
True if the dataset internal pointer is on the first element otherwise it returns false.

Implements te::da::DataSet.

Definition at line 603 of file stmemory/DataSet.cpp.

References m_items, and m_iterator.

bool te::stmem::DataSet::isAtEnd ( ) const
virtual

It tells if the dataset internal pointer is on the last element of the collection.

Returns
True, if the dataset internal pointer is on the last element otherwise it returns false.

Implements te::da::DataSet.

Definition at line 613 of file stmemory/DataSet.cpp.

References m_items, and m_iterator.

bool te::stmem::DataSet::isBeforeBegin ( ) const
virtual

It tells if the dataset internal pointer is in a position before the first element of the collection or not.

Returns
True, if the dataset internal pointer is in a position before the first element otherwise it returns false.

Implements te::da::DataSet.

Definition at line 608 of file stmemory/DataSet.cpp.

References m_beforeFirst.

Referenced by isPositionValid().

bool te::stmem::DataSet::isConnected ( ) const
virtual

It returns true if the dataset is connected and false if it is disconnected. A dataset can be connected or disconnected. A connected dataset, after its creation through the data source transactor, continues to depend on the connection given by its associated data source. Differently, a disconnected dataset, after its creation, no more depends of the connection given by the data source, and it continues to live after the connection has been released to the data source.

Returns
True, if the dataset is connected, or false if it is disconnected.

Implements te::da::DataSet.

Definition at line 523 of file stmemory/DataSet.cpp.

bool te::stmem::DataSet::isEmpty ( ) const
virtual

It returns true if the collection is empty.

Returns
True, if the collection is empty.

Implements te::da::DataSet.

Definition at line 518 of file stmemory/DataSet.cpp.

References m_items.

bool te::stmem::DataSet::isNull ( std::size_t  i) const
virtual

It checks if the attribute value is NULL.

Parameters
iThe attribute index.
Returns
True if the attribute value is NULL.

Implements te::da::DataSet.

Definition at line 855 of file stmemory/DataSet.cpp.

References m_iterator.

bool te::da::DataSet::isNull ( const std::string &  name) const
virtualinherited

It checks if the attribute value is NULL.

Parameters
nameThe attribute name.
Returns
True if the attribute value is NULL.

Reimplemented in te::gdal::DataSet.

Definition at line 319 of file dataaccess/dataset/DataSet.cpp.

References te::da::GetPropertyPos(), and te::da::DataSet::isNull().

bool te::stmem::DataSet::isPositionValid ( ) const
virtual

It tells if the dataset internal pointer is on a valid position.

Returns
True, if the dataset internal pointer is on a valid position.

Implements te::da::DataSet.

Definition at line 625 of file stmemory/DataSet.cpp.

References isAfterEnd(), and isBeforeBegin().

bool te::stmem::DataSet::move ( std::size_t  i)
virtual

It moves the dataset internal pointer to a given position.

Parameters
iThe position the dataset internal pointer must be set up.
Returns
True, if it was possible to move the dataset reading to the given position.
Note
The first item in the collection starts at address 0.

Implements te::da::DataSet.

Definition at line 588 of file stmemory/DataSet.cpp.

References m_items, and m_iterator.

bool te::stmem::DataSet::moveBeforeFirst ( )
virtual

It moves the internal pointer to a position before the first item in the collection.

Returns
True, if it was possible to move to a sentinel position before the first item in the collection.
Note
This method is not supported by FORWARDONLY datasets.

Implements te::da::DataSet.

Definition at line 574 of file stmemory/DataSet.cpp.

References m_beforeFirst.

bool te::stmem::DataSet::moveFirst ( )
virtual

It moves the internal pointer to the first item in the collection.

Returns
True, if it was possible to move to the first item in the collection.
Note
This method is not supported by FORWARDONLY datasets.

Implements te::da::DataSet.

Definition at line 567 of file stmemory/DataSet.cpp.

References m_beforeFirst, m_items, and m_iterator.

Referenced by moveNext().

bool te::stmem::DataSet::moveLast ( )
virtual

It sets the dataset internal pointer to the last item in the collection.

Returns
True, if it was possible to move to the last item in the collection.

Implements te::da::DataSet.

Definition at line 580 of file stmemory/DataSet.cpp.

References m_beforeFirst, m_items, and m_iterator.

bool te::stmem::DataSet::moveNext ( )
virtual

It moves the internal pointer to the next item of the collection.

You always has to call this method in order to move the internal pointer to the first item in the collection. This method can be used to traverse a dataset.

Returns
True if the internal pointer is on a valid item, or false otherwise.
Note
All dataset types support this method: FORWARDONLY, BIDIRECTIONAL and RANDOM.

Implements te::da::DataSet.

Definition at line 551 of file stmemory/DataSet.cpp.

References m_beforeFirst, m_items, m_iterator, and moveFirst().

bool te::stmem::DataSet::movePrevious ( )
virtual

It moves the internal pointer to the previous item of the collection.

Returns
True, if the internal pointer (cursor position) is on a valid item, or false otherwise.
Note
This method is not supported by FORWARDONLY datasets.

Implements te::da::DataSet.

Definition at line 559 of file stmemory/DataSet.cpp.

References m_beforeFirst, m_items, and m_iterator.

std::unique_ptr< te::stmem::DataSet > te::stmem::DataSet::nearestObservations ( const te::dt::DateTime time,
int  n 
) const

It returns the n nearest observations to a given date and time.

Parameters
dtA given date time
nThe number of returned observations.
Returns
a new DataSet
Note
The caller will take the ownership of the returned pointer.
The returned DataSet will share the intenal observations.

Definition at line 444 of file stmemory/DataSet.cpp.

References te::dt::AbstractData::clone(), te::da::DataSet::DataSet(), ds, te::dt::GetDistance(), m_begTimePropIdx, m_endTimePropIdx, m_geomPropIdx, m_items, m_pnames, and m_ptypes.

te::stmem::DataSet & te::stmem::DataSet::operator= ( const DataSet rhs)

Assignment operator.

Note
The left-side DataSet will share all observations or items of the right-side DataSet.
If the caller does not want to share the items, it must use the method clone.

Definition at line 170 of file stmemory/DataSet.cpp.

References add(), m_beforeFirst, m_begTimePropIdx, m_endTimePropIdx, m_geomPropIdx, m_items, m_pnames, m_ptypes, and m_RTree.

void te::stmem::DataSet::setBool ( std::size_t  i,
bool  value 
)

Definition at line 710 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setBool ( const std::string &  name,
bool  value 
)

Definition at line 715 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setByteArray ( std::size_t  i,
te::dt::ByteArray value 
)

Definition at line 780 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setByteArray ( const std::string &  name,
te::dt::ByteArray value 
)

Definition at line 785 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setChar ( std::size_t  i,
char  value 
)

Definition at line 635 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setChar ( const std::string &  name,
char  value 
)

Definition at line 640 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setDateTime ( std::size_t  i,
te::dt::DateTime value 
)

Definition at line 825 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setDateTime ( const std::string &  name,
te::dt::DateTime value 
)

Definition at line 830 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setDouble ( std::size_t  i,
double  value 
)

Definition at line 735 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setDouble ( const std::string &  name,
double  value 
)

Definition at line 740 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setFloat ( std::size_t  i,
float  value 
)

Definition at line 725 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setFloat ( const std::string &  name,
float  value 
)
void te::stmem::DataSet::setGeometry ( std::size_t  i,
te::gm::Geometry value 
)

Definition at line 795 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setGeometry ( const std::string &  name,
te::gm::Geometry value 
)

Definition at line 800 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setInt16 ( std::size_t  i,
boost::int16_t  value 
)

Definition at line 665 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setInt16 ( const std::string &  name,
boost::int16_t  value 
)

Definition at line 670 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setInt32 ( std::size_t  i,
boost::int32_t  value 
)

Definition at line 680 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setInt32 ( const std::string &  name,
boost::int32_t  value 
)

Definition at line 685 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setInt64 ( std::size_t  i,
boost::int64_t  value 
)

Definition at line 695 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setInt64 ( const std::string &  name,
boost::int64_t  value 
)

Definition at line 700 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setNumeric ( std::size_t  i,
const std::string &  value 
)

Definition at line 750 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setNumeric ( const std::string &  name,
const std::string &  value 
)

Definition at line 755 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setRaster ( std::size_t  i,
te::rst::Raster value 
)

Definition at line 810 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setRaster ( const std::string &  name,
te::rst::Raster value 
)

Definition at line 815 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setString ( std::size_t  i,
const std::string &  value 
)

Definition at line 765 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setString ( const std::string &  name,
const std::string &  value 
)

Definition at line 770 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setUChar ( std::size_t  i,
unsigned char  value 
)

Definition at line 650 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setUChar ( const std::string &  name,
unsigned char  value 
)

Definition at line 655 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setValue ( std::size_t  i,
te::dt::AbstractData value 
)

Definition at line 845 of file stmemory/DataSet.cpp.

References m_iterator.

void te::stmem::DataSet::setValue ( const std::string &  name,
te::dt::AbstractData ad 
)

Definition at line 850 of file stmemory/DataSet.cpp.

References m_iterator.

std::size_t te::stmem::DataSet::size ( ) const
virtual

It returns the collection size, if it is known.

It may return std::string::npos if the size is not known, or it would be too costly to compute it.

Returns
The size of the collection, if it is known.

Implements te::da::DataSet.

Definition at line 528 of file stmemory/DataSet.cpp.

References m_items.

Referenced by te::stmem::Transactor::getNumberOfItems().

Member Data Documentation

bool te::stmem::DataSet::m_beforeFirst
protected
int te::stmem::DataSet::m_begTimePropIdx
protected

The property index of the DataSetType that contains the phenomenon beginning time.

Definition at line 533 of file stmemory/DataSet.h.

Referenced by add(), filter(), getBeginTimePropIdx(), nearestObservations(), and operator=().

int te::stmem::DataSet::m_endTimePropIdx
protected

The property index of the DataSetType that contains the phenomenon end time.

Definition at line 534 of file stmemory/DataSet.h.

Referenced by add(), filter(), getEndTimePropIdx(), nearestObservations(), and operator=().

int te::stmem::DataSet::m_geomPropIdx
protected

The property index of the DataSetType that contains geometries.

Definition at line 535 of file stmemory/DataSet.h.

Referenced by add(), filter(), getExtent(), getGeomPropIdx(), nearestObservations(), and operator=().

TimeToDataSetItemMap te::stmem::DataSet::m_items
protected
std::vector<std::string> te::stmem::DataSet::m_pnames
protected

internal control

The list of property names.

Definition at line 531 of file stmemory/DataSet.h.

Referenced by DataSet(), filter(), getNumProperties(), getPropertyName(), nearestObservations(), and operator=().

std::vector<int> te::stmem::DataSet::m_ptypes
protected

The list of property types.

Definition at line 532 of file stmemory/DataSet.h.

Referenced by DataSet(), filter(), getPropertyDataType(), nearestObservations(), and operator=().

std::unique_ptr<te::sam::rtree::Index<te::mem::DataSetItem*> > te::stmem::DataSet::m_RTree
protected

A RTree index created over the default geometry property.

Definition at line 528 of file stmemory/DataSet.h.

Referenced by add(), DataSet(), filter(), getExtent(), and operator=().


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