All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::st::TimeSeriesDataSet Class Reference

A class to represent a time series data set. More...

#include <TimeSeriesDataSet.h>

Inheritance diagram for te::st::TimeSeriesDataSet:

Public Member Functions

std::string getId () const
 It returns the identifier associated to the time series. More...
 
ObservationDataSetgetObservationSet () const
 It returns the data set that contains the time series observations. More...
 
te::dt::DateTimePeriodgetTemporalExtent () const
 It returns the temporal extent of the time series observations. More...
 
std::auto_ptr< TimeSeriesgetTimeSeries (te::st::AbstractTimeSeriesInterp *interp)
 It returns the time series from the DataSet. More...
 
std::auto_ptr< TimeSeriesgetTimeSeries (int idx, te::st::AbstractTimeSeriesInterp *interp)
 It returns the time series from the DataSet. More...
 
void getTimeSeriesSet (te::st::AbstractTimeSeriesInterp *interp, std::vector< te::st::TimeSeries * > &result)
 It returns all time series from the DataSet. More...
 
const TimeSeriesDataSetTypegetType () const
 It returns a reference to the internal time series data set type. More...
 
void setId (const std::string &id)
 It sets the identifier associated to the time series. More...
 
std::size_t size () const
 It returns the size of the time series observation set. More...
 
virtual ~TimeSeriesDataSet ()
 It returns the trajectory geometry property. More...
 
Constructor
 TimeSeriesDataSet (te::da::DataSet *ds, int tPropIdx, int vPropIdx, int gPropIdx, int idPropIdx, const std::string &id)
 Constructor. More...
 
 TimeSeriesDataSet (te::da::DataSet *ds, int tPropIdx, int vPropIdx, int gPropIdx, int idPropIdx, const std::string &id, te::dt::DateTimePeriod *text)
 Constructor. More...
 
 TimeSeriesDataSet (te::da::DataSet *ds, const std::vector< int > &tPropIdxs, const std::vector< int > &vPropIdxs, int gPropIdx, int idPropIdx, const std::string &id)
 Constructor. More...
 
 TimeSeriesDataSet (te::da::DataSet *ds, const std::vector< int > &tPropIdxs, const std::vector< int > &vPropIdxs, int gPropIdx, int idPropIdx, const std::string &id, te::dt::DateTimePeriod *text)
 Constructor. More...
 
 TimeSeriesDataSet (te::da::DataSet *ds, const TimeSeriesDataSetType &type, te::dt::DateTimePeriod *text)
 Constructor. More...
 
 TimeSeriesDataSet (ObservationDataSet *obs, const TimeSeriesDataSetType &type, const std::string &id)
 Constructor. More...
 
Methods to traverse the trajectory observations and to check the

internal cursor pointer

bool moveNext ()
 
bool movePrevious ()
 
bool moveFirst ()
 
bool moveBeforeFirst ()
 
bool moveLast ()
 
bool isAtBegin () const
 
bool isBeforeBegin () const
 
bool isAtEnd () const
 
bool isAfterEnd () const
 
Methods to get values pointed by the internal cursor.

It returns the time pointed by the internal cursor.

/*!

Returns
A pointer to the time pointed by the internal cursor.
Note
The caller will take the ownership of the returned pointer.
std::auto_ptr< te::dt::DateTimegetTime () const
 
std::auto_ptr
< te::dt::AbstractData
getValue (std::size_t idx) const
 It returns the idx-th observed value pointed by the internal cursor. More...
 
std::auto_ptr
< te::dt::AbstractData
getValue () const
 It returns the observed value pointed by the internal cursor. More...
 
double getDouble (std::size_t idx) const
 It returns the idx-th observed value as double pointed by the internal cursor. More...
 
double getDouble () const
 It returns the observed value as double pointed by the internal cursor. More...
 
int getInt (std::size_t idx) const
 It returns the idx-th observed value as integer pointed by the internal cursor. More...
 
int getInt () const
 It returns the observed value as double pointed by the internal cursor. More...
 
std::auto_ptr< te::gm::GeometrygetGeometry () const
 It returns the geometry pointed by the internal cursor. More...
 

Protected Member Functions

std::auto_ptr< te::da::DataSetrelease ()
 It releases all internal pointers, returning its internal DataSet and invalidating itself. More...
 

Private Attributes

std::string m_id
 The trajectory identification. More...
 
std::auto_ptr< ObservationDataSetm_obsDs
 The data set that contains the trajectory observations. More...
 
TimeSeriesDataSetType m_type
 The trajectory type. More...
 

Friends

class TimeSeriesDataSetLayer
 

Detailed Description

A class to represent a time series data set.

This class represents a view on a DataSet that contains observations of time series. A time series represents the variation of the values of a property over time.

A TimeSeriesDataSet can contain one or more properties observed over time.

See also
ObservationDataSet ObservationDatasSetType TimeSeriesDataSetType

Definition at line 69 of file TimeSeriesDataSet.h.

Constructor & Destructor Documentation

te::st::TimeSeriesDataSet::TimeSeriesDataSet ( te::da::DataSet ds,
int  tPropIdx,
int  vPropIdx,
int  gPropIdx,
int  idPropIdx,
const std::string &  id 
)

Constructor.

Parameters
dsThe data set that contains the time series observations.
tPropIdxThe index of the property that contains the times of time series.
vPropIdxThe index of the property that contains the values of time series.
gPropIdxThe index of the property that contains the location of time series.
idPropIdxThe index of the property that contains the identity of the time series.
idThe time series id.
Note
It will take the ownership of the input pointer.

Definition at line 42 of file TimeSeriesDataSet.cpp.

te::st::TimeSeriesDataSet::TimeSeriesDataSet ( te::da::DataSet ds,
int  tPropIdx,
int  vPropIdx,
int  gPropIdx,
int  idPropIdx,
const std::string &  id,
te::dt::DateTimePeriod text 
)

Constructor.

Parameters
dsThe data set that contains the time series observations.
tPropIdxThe index of the property that contains the times of time series.
vPropIdxThe index of the property that contains the values of time series.
gPropIdxThe index of the property that contains the location of time series.
idPropIdxThe index of the property that contains the identity of the time series.
idThe time series id.
textThe temporal extent.
Note
It will take the ownership of the input pointers.

Definition at line 50 of file TimeSeriesDataSet.cpp.

te::st::TimeSeriesDataSet::TimeSeriesDataSet ( te::da::DataSet ds,
const std::vector< int > &  tPropIdxs,
const std::vector< int > &  vPropIdxs,
int  gPropIdx,
int  idPropIdx,
const std::string &  id 
)

Constructor.

Parameters
dsThe data set that contains the time series observations.
tPropIdxsThe indexes of the properties that contain the begin and end times of time series.
vPropIdxsThe indexes of the properties that contain the values of time series.
gPropIdxThe index of the property that contains the location of time series.
idPropIdxThe index of the property that contains the identity of the time series.
idThe time series id.
Note
It will take the ownership of the input pointer.

Definition at line 58 of file TimeSeriesDataSet.cpp.

te::st::TimeSeriesDataSet::TimeSeriesDataSet ( te::da::DataSet ds,
const std::vector< int > &  tPropIdxs,
const std::vector< int > &  vPropIdxs,
int  gPropIdx,
int  idPropIdx,
const std::string &  id,
te::dt::DateTimePeriod text 
)

Constructor.

Parameters
dsThe data set that contains the time series observations.
tPropIdxsThe indexes of the properties that contain the begin and end times of time series.
vPropIdxsThe indexes of the properties that contain the values of time series.
gPropIdxThe index of the property that contains the location of time series.
idPropIdxThe index of the property that contains the identity of the time series.
idThe time series id.
textThe temporal extent.
Note
It will take the ownership of the input pointer.

Definition at line 67 of file TimeSeriesDataSet.cpp.

te::st::TimeSeriesDataSet::TimeSeriesDataSet ( te::da::DataSet ds,
const TimeSeriesDataSetType type,
te::dt::DateTimePeriod text 
)

Constructor.

Parameters
dsThe data set that contains the time series observations.
typeThe time series data set type.
textThe temporal extent.
Note
It will take the ownership of the input pointer.
This constructor is used when each observation of a trajectory is associated to a period and the DataSet uses two properties to store these periods.

Definition at line 76 of file TimeSeriesDataSet.cpp.

te::st::TimeSeriesDataSet::TimeSeriesDataSet ( ObservationDataSet obs,
const TimeSeriesDataSetType type,
const std::string &  id 
)

Constructor.

Parameters
obsThe data set that contains the time series observations.
typeThe time series data set type.
idThe time series id
Note
It will take the ownership of the given pointer.

Definition at line 85 of file TimeSeriesDataSet.cpp.

te::st::TimeSeriesDataSet::~TimeSeriesDataSet ( )
virtual

It returns the trajectory geometry property.

Returns
The trajectory geometry property.
Note
The caller will NOT take the ownership of the returned pointer.

It returns the trajectory datetime property.

Returns
The trajectory datetime property.
Note
The caller will NOT take the ownership of the returned pointer.

Virtual destructor.

Definition at line 294 of file TimeSeriesDataSet.cpp.

Member Function Documentation

double te::st::TimeSeriesDataSet::getDouble ( std::size_t  idx) const

It returns the idx-th observed value as double pointed by the internal cursor.

Returns
A pointer to the idx-th observed value as double pointed by the internal cursor.

Definition at line 180 of file TimeSeriesDataSet.cpp.

double te::st::TimeSeriesDataSet::getDouble ( ) const

It returns the observed value as double pointed by the internal cursor.

Returns
A pointer to the observed value as double pointed by the internal cursor.

Definition at line 185 of file TimeSeriesDataSet.cpp.

std::auto_ptr< te::gm::Geometry > te::st::TimeSeriesDataSet::getGeometry ( ) const

It returns the geometry pointed by the internal cursor.

Returns
A pointer to the geometry pointed by the internal cursor.
Note
The caller will take the ownership of the returned pointer.

Definition at line 200 of file TimeSeriesDataSet.cpp.

std::string te::st::TimeSeriesDataSet::getId ( ) const

It returns the identifier associated to the time series.

Returns
The identifier associated to the time series.

Definition at line 103 of file TimeSeriesDataSet.cpp.

int te::st::TimeSeriesDataSet::getInt ( std::size_t  idx) const

It returns the idx-th observed value as integer pointed by the internal cursor.

Returns
A pointer to the idx-th observed value as integer pointed by the internal cursor.
Note
It returns a 32-bit integer.

Definition at line 190 of file TimeSeriesDataSet.cpp.

int te::st::TimeSeriesDataSet::getInt ( ) const

It returns the observed value as double pointed by the internal cursor.

Returns
A pointer to the observed value as double pointed by the internal cursor.
Note
It returns a 32-bit integer.

Definition at line 195 of file TimeSeriesDataSet.cpp.

te::st::ObservationDataSet * te::st::TimeSeriesDataSet::getObservationSet ( ) const

It returns the data set that contains the time series observations.

Returns
A pointer to the data set that contains the time series observations.
Note
The caller will NOT take the ownership of the input pointer.

Definition at line 93 of file TimeSeriesDataSet.cpp.

te::dt::DateTimePeriod * te::st::TimeSeriesDataSet::getTemporalExtent ( ) const

It returns the temporal extent of the time series observations.

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

Definition at line 205 of file TimeSeriesDataSet.cpp.

std::auto_ptr< te::dt::DateTime > te::st::TimeSeriesDataSet::getTime ( ) const

Definition at line 163 of file TimeSeriesDataSet.cpp.

std::auto_ptr< te::st::TimeSeries > te::st::TimeSeriesDataSet::getTimeSeries ( te::st::AbstractTimeSeriesInterp interp)

It returns the time series from the DataSet.

This method encapsulates all observations of this DataSet as a TimeSeries type associated to a given interpolator.

Parameters
interpThe time series interpolator.
Returns
The time series associated to a given interpolator.
Note
The caller will take the ownership of the returned pointer.
It uses the first observed property to generate the time series.

Definition at line 210 of file TimeSeriesDataSet.cpp.

std::auto_ptr< te::st::TimeSeries > te::st::TimeSeriesDataSet::getTimeSeries ( int  idx,
te::st::AbstractTimeSeriesInterp interp 
)

It returns the time series from the DataSet.

This method encapsulates all observations of this DataSet as a TimeSeries type associated to a given interpolator.

Parameters
idxThe index of the observed property to be considered
interpThe time series interpolator.
Returns
The time series associated to a given interpolator.
Note
The caller will take the ownership of the returned pointer.

Definition at line 215 of file TimeSeriesDataSet.cpp.

References te::da::DataSet::getDateTime(), te::da::DataSet::getGeometry(), te::da::DataSet::getValue(), and te::da::DataSet::moveNext().

void te::st::TimeSeriesDataSet::getTimeSeriesSet ( te::st::AbstractTimeSeriesInterp interp,
std::vector< te::st::TimeSeries * > &  result 
)

It returns all time series from the DataSet.

This method encapsulates all observations of this DataSet as a set of TimeSeries associated to a given interpolator.

Parameters
interpThe time series interpolator.
resultThe returned set of time series.
Note
The caller will take the ownership of the returned pointers.

Definition at line 245 of file TimeSeriesDataSet.cpp.

References te::da::DataSet::getDateTime(), te::da::DataSet::getGeometry(), te::da::DataSet::getValue(), and te::da::DataSet::moveNext().

const te::st::TimeSeriesDataSetType & te::st::TimeSeriesDataSet::getType ( ) const

It returns a reference to the internal time series data set type.

Returns
A reference to the internal time series data set type.

Definition at line 98 of file TimeSeriesDataSet.cpp.

std::auto_ptr< te::dt::AbstractData > te::st::TimeSeriesDataSet::getValue ( std::size_t  idx) const

It returns the idx-th observed value pointed by the internal cursor.

Returns
A pointer to the idx-th observed value pointed by the internal cursor.
Note
The caller will take the ownership of the returned pointer.

Definition at line 170 of file TimeSeriesDataSet.cpp.

std::auto_ptr< te::dt::AbstractData > te::st::TimeSeriesDataSet::getValue ( ) const

It returns the observed value pointed by the internal cursor.

Returns
A pointer to the observed value pointed by the internal cursor.
Note
The caller will take the ownership of the returned pointer.

Definition at line 175 of file TimeSeriesDataSet.cpp.

bool te::st::TimeSeriesDataSet::isAfterEnd ( ) const

Definition at line 158 of file TimeSeriesDataSet.cpp.

bool te::st::TimeSeriesDataSet::isAtBegin ( ) const

Definition at line 143 of file TimeSeriesDataSet.cpp.

bool te::st::TimeSeriesDataSet::isAtEnd ( ) const

Definition at line 153 of file TimeSeriesDataSet.cpp.

bool te::st::TimeSeriesDataSet::isBeforeBegin ( ) const

Definition at line 148 of file TimeSeriesDataSet.cpp.

bool te::st::TimeSeriesDataSet::moveBeforeFirst ( )

Definition at line 133 of file TimeSeriesDataSet.cpp.

bool te::st::TimeSeriesDataSet::moveFirst ( )

Definition at line 128 of file TimeSeriesDataSet.cpp.

bool te::st::TimeSeriesDataSet::moveLast ( )

Definition at line 138 of file TimeSeriesDataSet.cpp.

bool te::st::TimeSeriesDataSet::moveNext ( )

Definition at line 118 of file TimeSeriesDataSet.cpp.

bool te::st::TimeSeriesDataSet::movePrevious ( )

Definition at line 123 of file TimeSeriesDataSet.cpp.

std::auto_ptr< te::da::DataSet > te::st::TimeSeriesDataSet::release ( )
protected

It releases all internal pointers, returning its internal DataSet and invalidating itself.

Returns
A pointer to the internal DataSet that contains the observations.
Note
This method is used when the user is interested only in its internal DataSet
The caller will take the ownership of the returned pointer.

Definition at line 288 of file TimeSeriesDataSet.cpp.

void te::st::TimeSeriesDataSet::setId ( const std::string &  id)

It sets the identifier associated to the time series.

Parameters
idThe identifier associated to the time series.

Definition at line 108 of file TimeSeriesDataSet.cpp.

std::size_t te::st::TimeSeriesDataSet::size ( void  ) const

It returns the size of the time series observation set.

Returns
The observation set size of the time series.

Definition at line 113 of file TimeSeriesDataSet.cpp.

Friends And Related Function Documentation

friend class TimeSeriesDataSetLayer
friend

Definition at line 71 of file TimeSeriesDataSet.h.

Member Data Documentation

std::string te::st::TimeSeriesDataSet::m_id
private

The trajectory identification.

Definition at line 382 of file TimeSeriesDataSet.h.

std::auto_ptr<ObservationDataSet> te::st::TimeSeriesDataSet::m_obsDs
private

The data set that contains the trajectory observations.

Definition at line 380 of file TimeSeriesDataSet.h.

TimeSeriesDataSetType te::st::TimeSeriesDataSet::m_type
private

The trajectory type.

Definition at line 381 of file TimeSeriesDataSet.h.


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