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::TimeSeriesDataSet>
203 return impl->getDataSet(info, e, r, travType);
206 std::auto_ptr<te::st::TimeSeriesDataSet>
212 return impl->getDataSet(info, geom, r, travType);
215 std::auto_ptr<te::st::TimeSeriesDataSet>
224 return impl->getDataSet(info, dt, tr, e, sr, travType);
227 std::auto_ptr<te::st::TimeSeriesDataSet>
234 return impl->getDataSet(info, geom, sr, dt, tr, travType);
237 std::auto_ptr<te::st::CoverageSeries>
241 te::st::PointCoverageSeriesDataSetInfo::const_iterator it = info.begin();
242 std::auto_ptr<te::st::CoverageSeries> result(
new CoverageSeries());
243 while(it!=info.end())
245 std::auto_ptr<PointCoverage> cv(getCoverage(*it, interp));
246 result->add(static_cast<te::dt::DateTime*>(cv->getTime()->clone()), cv.release());
253 std::auto_ptr<te::st::CoverageSeries>
256 te::st::RasterCoverageSeriesDataSetInfo::const_iterator it = info.begin();
257 std::auto_ptr<te::st::CoverageSeries> result(
new CoverageSeries());
258 while(it!=info.end())
260 std::auto_ptr<RasterCoverage> cv(getCoverage(*it));
261 result->add(static_cast<te::dt::DateTime*>(cv->getTime()->clone()), cv.release());
267 std::auto_ptr<te::st::RasterCoverage>
273 throw Exception(
"The DataSet was not loaded correctly!");
275 std::auto_ptr<te::st::RasterCoverage> result(
new RasterCoverage());
276 while(dset->moveNext())
279 std::auto_ptr<te::dt::DateTime> dt;
285 std::auto_ptr<te::rst::Raster> raster(dset->getRaster(info.
getRasterPropName()));
286 result->set(raster.release(), dt.release());
291 std::auto_ptr<te::st::PointCoverage>
298 throw Exception(
"The DataSet was not loaded correctly!");
301 std::vector<int> ptypes;
302 std::vector<std::string> pnames;
304 for(
unsigned int i=0; i<vPropDS.size(); ++i)
307 ptypes.push_back(dset->getPropertyDataType(idx));
308 pnames.push_back(vPropDS[i]);
314 std::string tpDS =
"";
317 if(!tPropName.empty())
321 ptypes.push_back(dset->getPropertyDataType(idx));
322 pnames.push_back(tpDS);
323 vPropDS.push_back(tpDS);
324 tpCV = ptypes.size()-1;
329 std::auto_ptr<te::st::PointCoverage> result(
new PointCoverage(interp, 0, dt.release(), vPropDS.size(), ptypes, pnames, tpCV));
331 while(dset->moveNext())
337 boost::ptr_vector<te::dt::AbstractData> values;
338 for(
unsigned int i=0; i<vPropDS.size(); ++i)
339 values.push_back(dset->getValue(vPropDS[i]));
341 result->add(*static_cast<te::gm::Point*>(geom.release()), values);
346 std::auto_ptr<te::dt::DateTimePeriod>
350 return impl->getTemporalExtent(info);
353 std::auto_ptr<te::dt::DateTimePeriod>
357 return impl->getTemporalExtent(info);
360 std::auto_ptr<te::dt::DateTimePeriod>
364 return impl->getTemporalExtent(info);
371 return impl->getSpatialExtent(info);
378 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.
std::string getBeginTimePropName() const
It returns the name of the DataSet property that contains the phenomenon beginning time...
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.
const te::dt::DateTime * getTime() const
It returns the phenomenon time.
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. ...
std::string getGeomPropName() const
It returns the name of the property that is a geometry property.
const std::string & getRasterPropName() const
It returns the property index that contains the raster of the coverage.
This file contains an abstract class responsible for loading spatiotemporal data from data sources...
TemporalRelation
Temporal relations between date and time (Source: Allen, 1991).
TEDATAACCESSEXPORT std::size_t GetPropertyPos(const DataSet *dataset, const std::string &name)
An abstract class for interpolation function or interpolator that estimate values at non-observaved l...
const ObservationDataSetInfo & getObservationDataSetInfo() const
It returns information about the DataSet that contains the time series observations.
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
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 ObservationDataSetInfo & getObservationDataSetInfo() const
It returns information about the DataSet that contains the trajectory observations.
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.
STDataLoader()
Protected constructor.
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)
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.
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.
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.
virtual AbstractData * clone() const =0
It returns a clone of this object.
const std::vector< std::string > & getValuePropNames() const
It returns the property names that contains the values of the coverage.
static void finalize()
It finalize the STDataLoader.