29 #include "../../dataaccess/datasource/DataSourceInfo.h"
30 #include "../../dataaccess/datasource/DataSourceManager.h"
31 #include "../../dataaccess/dataset/DataSet.h"
32 #include "../../dataaccess/utils/Utils.h"
33 #include "../../datatype/DateTimePeriod.h"
34 #include "../../geometry/Utils.h"
37 #include "../../stmemory/DataSource.h"
38 #include "../../stmemory/DataSet.h"
41 #include "../Exception.h"
43 #include "../Globals.h"
45 #include "../core/observation/ObservationDataSetInfo.h"
46 #include "../core/trajectory/TrajectoryDataSetInfo.h"
47 #include "../core/timeseries/TimeSeriesDataSetInfo.h"
48 #include "../core/observation/ObservationDataSet.h"
49 #include "../core/trajectory/TrajectoryDataSet.h"
50 #include "../core/timeseries/TimeSeriesDataSet.h"
61 throw Exception(
"The STDataLoader is not inialized! Please, use the method STDataLoader::initialize");
67 std::auto_ptr<te::st::ObservationDataSet>
76 std::auto_ptr<te::da::DataSet> dset(m_ds->getDataSet(info.
getDataSetName(), travType));
78 return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
82 std::auto_ptr<te::st::ObservationDataSet>
87 return std::auto_ptr<te::st::ObservationDataSet>();
98 std::auto_ptr<te::da::DataSet> dset(m_ds->getDataSet(info.
getDataSetName(), geomPropName, &e, r, travType));
100 return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
103 std::auto_ptr<te::st::ObservationDataSet>
108 return std::auto_ptr<te::st::ObservationDataSet>();
119 std::auto_ptr<te::da::DataSet> dset(m_ds->getDataSet(info.
getDataSetName(), geomPropName, &geom, r, travType));
121 return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
124 std::auto_ptr<te::st::ObservationDataSet>
136 std::auto_ptr<te::da::DataSet> dset(inMemDataSource->getDataSet(info.
getDataSetName(), &dt, r, travType));
138 return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
141 std::auto_ptr<te::st::ObservationDataSet>
156 std::auto_ptr<te::da::DataSet> dset(inMemDataSource->getDataSet(
159 return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
162 std::auto_ptr<te::st::ObservationDataSet>
175 std::auto_ptr<te::da::DataSet> dset(inMemDataSource->getDataSet(info.
getDataSetName(), &geom, sr, &dt, tr, travType));
177 return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
186 std::auto_ptr<te::st::TrajectoryDataSet>
199 return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
202 std::auto_ptr<te::st::TrajectoryDataSet>
208 return std::auto_ptr<te::st::TrajectoryDataSet>();
222 geomPropName, &geom, r, travType));
224 return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
227 std::auto_ptr<te::st::TrajectoryDataSet>
233 return std::auto_ptr<te::st::TrajectoryDataSet>();
247 geomPropName, &e, r, travType));
249 return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
252 std::auto_ptr<te::st::TrajectoryDataSet>
266 std::auto_ptr<te::da::DataSet> dset(inMemDataSource->getDataSet(
269 return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
272 std::auto_ptr<te::st::TrajectoryDataSet>
289 std::auto_ptr<te::da::DataSet> dset(inMemDataSource->getDataSet(
292 return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
295 std::auto_ptr<te::st::TrajectoryDataSet>
310 std::auto_ptr<te::da::DataSet> dset(inMemDataSource->getDataSet(
313 return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
317 std::vector<TimeSeriesDataSetInfo>& )
322 std::auto_ptr<te::st::TimeSeriesDataSet>
336 return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
339 std::auto_ptr<te::st::TimeSeriesDataSet>
345 return std::auto_ptr<te::st::TimeSeriesDataSet>();
359 geomPropName, &geom, r, travType));
361 return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
364 std::auto_ptr<te::st::TimeSeriesDataSet>
370 return std::auto_ptr<te::st::TimeSeriesDataSet>();
384 geomPropName, &e, r, travType));
386 return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
389 std::auto_ptr<te::st::TimeSeriesDataSet>
403 std::auto_ptr<te::da::DataSet> dset(inMemDataSource->getDataSet(
406 return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
409 std::auto_ptr<te::st::TimeSeriesDataSet>
426 std::auto_ptr<te::da::DataSet> dset(inMemDataSource->getDataSet(
429 return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
432 std::auto_ptr<te::st::TimeSeriesDataSet>
447 std::auto_ptr<te::da::DataSet> dset(inMemDataSource->getDataSet(
450 return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
453 std::auto_ptr<te::dt::DateTimePeriod>
466 std::auto_ptr<te::dt::DateTimePeriod>
481 std::auto_ptr<te::dt::DateTimePeriod>
525 const std::string& begTimePropName,
const std::string& endTimePropName,
526 const std::string& gmPropName)
530 throw Exception(
"The DataSet was not loaded correctly!");
534 throw Exception(
"The DataSetType was not loaded correctly!");
547 memDS->
add(dsname, dsettype.release(), inMemdset);
550 std::auto_ptr<te::st::ObservationDataSet>
558 std::auto_ptr<te::gm::Geometry> geom;
562 std::auto_ptr<te::gm::Envelope> aux = ds->
getExtent(idx);
571 std::auto_ptr<te::st::TrajectoryDataSet>
580 std::auto_ptr<te::gm::Geometry> geom;
584 std::auto_ptr<te::gm::Envelope> aux = ds->
getExtent(idx);
594 std::auto_ptr<te::st::TimeSeriesDataSet>
STDataLoaderFromMemDS()
Constructor.
static const std::string sm_STMemoryDataSourceId
The global id of the st memory data source.
std::string getBeginTimePropName() const
It returns the name of the DataSet property that contains the phenomenon beginning time...
void loadDataSet(const te::da::DataSourceInfo &info, const std::string dsname, const std::string &begTimePropName, const std::string &endTimePropName, const std::string &gmPropName)
It loads DataSet from the original DataSource and put it in the In-Memory DataSource.
A class to represent a time series data set.
A class to represent a DataSet that contains observations.
A class that contains infos about a DataSet that contains observations.
te::da::DataSourcePtr m_ds
This file contains a class responsible for loading spatiotemporal data from a ST in-memory DataSource...
std::auto_ptr< ObservationDataSet > getDataSet(const ObservationDataSetInfo &info, te::common::TraverseType travType=te::common::FORWARDONLY)
It returns a ObservationDataSet, that is, a DataSet that contains observations.
std::string getGeomPropName() const
It returns the name of the property that is a geometry property.
Implements a DataSource that contains In-Memory DataSets indexed by space and time.
TemporalRelation
Temporal relations between date and time (Source: Allen, 1991).
TEDATAACCESSEXPORT std::size_t GetPropertyPos(const DataSet *dataset, const std::string &name)
const ObservationDataSetInfo & getObservationDataSetInfo() const
It returns information about the DataSet that contains the time series observations.
void add(const std::string &name, te::da::DataSetType *t, DataSet *d)
It adds a new DataSet and DataSetType into the DataSource.
SpatialRelation
Spatial relations between geometric objects.
void getInfo(const TrajectoryDataSetInfo &input, std::vector< TrajectoryDataSetInfo > &output)
It returns the information about all trajectories that exist in a single DataSet. ...
std::auto_ptr< te::dt::DateTimePeriod > getTemporalExtent(const ObservationDataSetInfo &info)
It returns the temporal extent of the data set with observations.
const ObservationDataSetInfo & getObservationDataSetInfo() const
It returns information about the DataSet that contains the trajectory observations.
std::auto_ptr< te::gm::Envelope > getExtent(std::size_t i)
It computes the bounding rectangle for a spatial property of the dataset.
virtual ~STDataLoaderFromMemDS()
TESTEXPORT ObservationDataSetType GetType(const ObservationDataSetInfo &info)
An auxiliary function that transform ObservationDataSetInfo into ObservationDataSetType.
TraverseType
A dataset can be traversed in two ways:
const std::vector< std::string > & getValuePropNames() const
It returns the names of the DataSet properties that contains the values associated to the time series...
std::auto_ptr< te::dt::DateTimePeriod > getTemporalExtent(const std::string &name)
It returns the temporal extent associated to a DataSet.
static DataSourceManager & getInstance()
It returns a reference to the singleton instance.
An Envelope defines a 2D rectangular region.
TEDATAACCESSEXPORT DataSet * GetDataSet(const std::string &name, const std::string &datasourceId)
std::auto_ptr< ObservationDataSet > buildDataSet(te::stmem::DataSet *ds, const ObservationDataSetInfo &info)
It builds an ObservationDataSet from a given DataSet.
const te::da::DataSourceInfo & getDataSourceInfo() const
It returns the information about the DataSource.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
A class that contains infos about a DataSet that contains observations of one or more trajectories...
A class to represent a trajectory data set.
const std::string & getId() const
Implementation of a in-memory data set that contains spatiotemporal observations indexed by time and ...
void setSpatialExtent(te::gm::Geometry *se)
It sets the spatial extent of all observations.
std::auto_ptr< te::dt::DateTimePeriod > getTemporalExtent() const
It returns the temporal extent of the observations.
A class that contains infos about a DataSet that contains observations of one or more time series...
void setTemporalExtent(te::dt::DateTimePeriod *te)
It sets the temporal extent of all observations.
A class that contains complemental DataSetType information about a DataSet that holds observations...
A class that represents a data source component.
std::string getDataSetName() const
It returns the DataSet name.
TEDATAACCESSEXPORT DataSetType * GetDataSetType(const std::string &name, const std::string &datasourceId)
std::string getEndTimePropName() const
It returns the name of the DataSet property that contains the phenomenon end time.
te::gm::Envelope getSpatialExtent(const ObservationDataSetInfo &info)
It returns the temporal extent of the data set with observations of a coverage series.
TEGEOMEXPORT Geometry * GetGeomFromEnvelope(const Envelope *const e, int srid)
It creates a Geometry (a polygon) from the given envelope.