28 #include "../../dataaccess/datasource/DataSourceInfo.h"
29 #include "../../dataaccess/utils/Utils.h"
30 #include "../../dataaccess/datasource/DataSourceManager.h"
36 #include "../core/observation/ObservationDataSet.h"
37 #include "../core/observation/ObservationDataSetInfo.h"
38 #include "../core/trajectory/TrajectoryDataSet.h"
39 #include "../core/trajectory/TrajectoryDataSetInfo.h"
40 #include "../core/timeseries/TimeSeriesDataSet.h"
41 #include "../core/timeseries/TimeSeriesDataSetInfo.h"
42 #include "../core/coverage/CoverageSeries.h"
43 #include "../core/coverage/Coverage.h"
44 #include "../core/coverage/PointCoverage.h"
45 #include "../core/coverage/RasterCoverage.h"
46 #include "../core/coverage/RasterCoverageDataSetInfo.h"
47 #include "../core/coverage/PointCoverageDataSetInfo.h"
48 #include "../Exception.h"
49 #include "../Globals.h"
57 std::auto_ptr<te::st::ObservationDataSet>
62 return impl->getDataSet(info, travType);
65 std::auto_ptr<te::st::ObservationDataSet>
70 return impl->getDataSet(info, e, r, travType);
73 std::auto_ptr<te::st::ObservationDataSet>
78 return impl->getDataSet(info, geom, r, travType);
81 std::auto_ptr<te::st::ObservationDataSet>
87 return impl->getDataSet(info, dt, r, travType);
90 std::auto_ptr<te::st::ObservationDataSet>
99 return impl->getDataSet(info, dt, tr, e, sr, travType);
102 std::auto_ptr<te::st::ObservationDataSet>
109 return impl->getDataSet(info, geom, sr, dt, tr, travType);
113 std::vector<te::st::TrajectoryDataSetInfo>& output)
116 return impl->getInfo(input, output);
119 std::auto_ptr<te::st::TrajectoryDataSet>
123 return impl->getDataSet(info, travType);
126 std::auto_ptr<te::st::TrajectoryDataSet>
132 return impl->getDataSet(info, travType);
135 std::auto_ptr<te::st::TrajectoryDataSet>
140 return impl->getDataSet(info, e, r, travType);
143 std::auto_ptr<te::st::TrajectoryDataSet>
149 return impl->getDataSet(info, dt, r, travType);
152 std::auto_ptr<te::st::TrajectoryDataSet>
161 return impl->getDataSet(info, dt, tr, e, sr, travType);
164 std::auto_ptr<te::st::TrajectoryDataSet>
170 return impl->getDataSet(info, geom, sr, dt, tr, travType);
175 std::vector<te::st::TimeSeriesDataSetInfo>& output)
178 return impl->getInfo(input, output);
181 std::auto_ptr<te::st::TimeSeriesDataSet>
185 return impl->getDataSet(info, travType);
188 std::auto_ptr<te::st::TimeSeriesDataSet>
194 return impl->getDataSet(info, dt, r, travType);
197 std::auto_ptr<te::st::CoverageSeries>
201 te::st::PointCoverageSeriesDataSetInfo::const_iterator it = info.begin();
202 std::auto_ptr<te::st::CoverageSeries> result(
new CoverageSeries());
203 while(it!=info.end())
205 std::auto_ptr<PointCoverage> cv(getCoverage(*it, interp));
206 result->add(static_cast<te::dt::DateTime*>(cv->getTime()->clone()), cv.release());
213 std::auto_ptr<te::st::CoverageSeries>
216 te::st::RasterCoverageSeriesDataSetInfo::const_iterator it = info.begin();
217 std::auto_ptr<te::st::CoverageSeries> result(
new CoverageSeries());
218 while(it!=info.end())
220 std::auto_ptr<RasterCoverage> cv(getCoverage(*it));
221 result->add(static_cast<te::dt::DateTime*>(cv->getTime()->clone()), cv.release());
227 std::auto_ptr<te::st::RasterCoverage>
233 throw Exception(
"The DataSet was not loaded correctly!");
235 std::auto_ptr<te::st::RasterCoverage> result(
new RasterCoverage());
236 while(dset->moveNext())
239 std::auto_ptr<te::dt::DateTime> dt = info.
getTime();
242 std::auto_ptr<te::rst::Raster> raster(dset->getRaster(info.
getRasterPropIdx()));
243 result->set(raster.release(), dt.release());
248 std::auto_ptr<te::st::PointCoverage>
255 throw Exception(
"The DataSet was not loaded correctly!");
258 std::vector<int> ptypes;
259 std::vector<std::string> pnames;
261 for(
unsigned int i=0; i<vPropDS.size(); ++i)
263 ptypes.push_back(dset->getPropertyDataType(vPropDS[i]));
264 pnames.push_back(dset->getPropertyName(vPropDS[i]));
273 if(tProps.size()>0 && tProps[0]>=0)
276 ptypes.push_back(dset->getPropertyDataType(tpDS));
277 pnames.push_back(dset->getPropertyName(tpDS));
278 vPropDS.push_back(tpDS);
279 tpCV = ptypes.size()-1;
282 std::auto_ptr<te::dt::DateTime> dt = info.
getTime();
283 std::auto_ptr<te::st::PointCoverage> result(
new PointCoverage(interp, 0, dt.get(), vPropDS.size(), ptypes, pnames, tpCV));
285 while(dset->moveNext())
288 std::auto_ptr<te::gm::Geometry> geom(dset->getGeometry(info.
getPointPropIdx()));
291 boost::ptr_vector<te::dt::AbstractData> values;
292 for(
unsigned int i=0; i<vPropDS.size(); ++i)
293 values.push_back(dset->getValue(vPropDS[i]));
295 result->add(*static_cast<te::gm::Point*>(geom.release()), values);
300 std::auto_ptr<te::dt::DateTimePeriod>
304 return impl->getTemporalExtent(info);
307 std::auto_ptr<te::dt::DateTimePeriod>
311 return impl->getTemporalExtent(info);
314 std::auto_ptr<te::dt::DateTimePeriod>
318 return impl->getTemporalExtent(info);
325 return impl->getSpatialExtent(info);
332 return impl->getSpatialExtent(info);
static void getInfo(const TrajectoryDataSetInfo &input, std::vector< TrajectoryDataSetInfo > &output)
It returns the information about all trajectories that exist in a single DataSet. ...
static std::auto_ptr< RasterCoverage > getCoverage(const RasterCoverageDataSetInfo &info)
It returns a raster coverage.
static const std::string sm_STMemoryDataSourceId
The global id of the st memory data source.
A concrete class to represent a point coverage.
static te::gm::Envelope getSpatialExtent(const ObservationDataSetInfo &info)
It returns the temporal extent of the data set with observations of a coverage series.
boost::shared_ptr< DataSource > DataSourcePtr
A class that contains infos about a DataSet that contains observations.
const ObservationDataSetInfo & getObservationDataSetInfo() const
It returns information about the DataSet that contains the coverage observations. ...
This file contains an abstract class responsible for loading spatiotemporal data from data sources...
TemporalRelation
Temporal relations between date and time (Source: Allen, 1991).
An abstract class for interpolation function or interpolator that estimate values at non-observaved l...
int getPointPropIdx() const
It returns the property index that contains the points of the coverage.
SpatialRelation
Spatial relations between geometric objects.
std::vector< RasterCoverageDataSetInfo > RasterCoverageSeriesDataSetInfo
A class that contains infos about a DataSource and DataSet that contains observations of a point cove...
std::vector< PointCoverageDataSetInfo > PointCoverageSeriesDataSetInfo
std::auto_ptr< te::dt::DateTime > getTime() const
It returns the date and time associated to the raster coverage, when this information is not in the D...
const ObservationDataSetInfo & getObservationDataSetInfo() const
It returns information about the DataSet that contains the coverage observations. ...
This file contains a class that contains a set of static methods to load spatiotemporal data from dat...
const te::da::DataSourceInfo & getDataSourceInfo() const
It returns information about the DataSource from which the DataSet comes.
virtual ~STDataLoader()
Virtual destructor.
TraverseType
A dataset can be traversed in two ways:
static void initialize()
It returns the spatial extent of the observations of a coverage series.
std::auto_ptr< te::dt::DateTime > getTime() const
It returns the date and time associated to the entire point coverage.
STDataLoader()
Protected constructor.
static DataSourceManager & getInstance()
It returns a reference to the singleton instance.
An Envelope defines a 2D rectangular region.
const te::da::DataSourceInfo & getDataSourceInfo() const
It returns information about the DataSource from which the DataSet comes.
const te::da::DataSourceInfo & getDataSourceInfo() const
It returns information about the DataSource from which the DataSet comes.
TEDATAACCESSEXPORT DataSet * GetDataSet(const std::string &name, const std::string &datasourceId)
const te::da::DataSourceInfo & getDataSourceInfo() const
It returns the information about the DataSource.
static std::auto_ptr< CoverageSeries > getCoverageSeries(const PointCoverageSeriesDataSetInfo &info, AbstractPointCoverageInterp *interp)
It returns a point coverage series.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
A concrete class to represent a raster coverage.
const std::vector< int > & getTimePropIdxs() const
It returns the indexes of the DataSet properties that contains the times associated to the coverage...
const std::vector< int > & getValuePropIdxs() const
It returns the property indexes that contains the values of the coverage.
A class that contains infos about a DataSet that contains observations of one or more trajectories...
const std::string & getId() const
This is the abstract factory for STDataLoaderImpl.
A class to represent a coverage series.
static std::auto_ptr< te::dt::DateTimePeriod > getTemporalExtent(const ObservationDataSetInfo &info)
It returns the temporal extent of the data set with observations.
const std::vector< int > & getTimePropIdxs() const
It returns the indexes of the DataSet properties that contains the times associated to the coverage...
A class that contains infos about a DataSet that contains observations of one or more time series...
static bool sm_STDataLoaderInitialized
Indictes if the st data loader support was initialized.
A class that contains infos about a DataSource and DataSet that contains observations of a raster cov...
const std::string & getType() const
std::string getDataSetName() const
It returns the DataSet name.
static 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.
const te::da::DataSourceInfo & getDataSourceInfo() const
It returns information about the DataSource from which the DataSet comes.
int getRasterPropIdx() const
It returns the property index that contains the raster of the coverage.
static void finalize()
It finalize the STDataLoader.