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" 55 std::unique_ptr<te::st::ObservationDataSet>
60 return impl->getDataSet(info, travType);
63 std::unique_ptr<te::st::ObservationDataSet>
68 return impl->getDataSet(info, e, r, travType);
71 std::unique_ptr<te::st::ObservationDataSet>
76 return impl->getDataSet(info, geom, r, travType);
79 std::unique_ptr<te::st::ObservationDataSet>
85 return impl->getDataSet(info, dt, r, travType);
88 std::unique_ptr<te::st::ObservationDataSet>
97 return impl->getDataSet(info, dt, tr, e, sr, travType);
100 std::unique_ptr<te::st::ObservationDataSet>
107 return impl->getDataSet(info, geom, sr, dt, tr, travType);
111 std::vector<te::st::TrajectoryDataSetInfo>& output)
114 return impl->getInfo(input, output);
117 std::unique_ptr<te::st::TrajectoryDataSet>
121 return impl->getDataSet(info, travType);
129 return impl->getDataSet(info, travType);
132 std::unique_ptr<te::st::TrajectoryDataSet>
137 return impl->getDataSet(info, e, r, travType);
140 std::unique_ptr<te::st::TrajectoryDataSet>
146 return impl->getDataSet(info, dt, r, travType);
149 std::unique_ptr<te::st::TrajectoryDataSet>
158 return impl->getDataSet(info, dt, tr, e, sr, travType);
161 std::unique_ptr<te::st::TrajectoryDataSet>
167 return impl->getDataSet(info, geom, sr, dt, tr, travType);
172 std::vector<te::st::TimeSeriesDataSetInfo>& output)
175 return impl->getInfo(input, output);
178 std::unique_ptr<te::st::TimeSeriesDataSet>
182 return impl->getDataSet(info, travType);
185 std::unique_ptr<te::st::TimeSeriesDataSet>
191 return impl->getDataSet(info, dt, r, travType);
194 std::unique_ptr<te::st::TimeSeriesDataSet>
200 return impl->getDataSet(info, e, r, travType);
203 std::unique_ptr<te::st::TimeSeriesDataSet>
209 return impl->getDataSet(info, geom, r, travType);
212 std::unique_ptr<te::st::TimeSeriesDataSet>
221 return impl->getDataSet(info, dt, tr, e, sr, travType);
224 std::unique_ptr<te::st::TimeSeriesDataSet>
231 return impl->getDataSet(info, geom, sr, dt, tr, travType);
234 std::unique_ptr<te::st::CoverageSeries>
238 te::st::PointCoverageSeriesDataSetInfo::const_iterator it = info.begin();
239 std::unique_ptr<te::st::CoverageSeries> result(
new CoverageSeries());
240 while(it!=info.end())
242 std::unique_ptr<PointCoverage> cv(
getCoverage(*it, interp));
243 result->add(static_cast<te::dt::DateTime*>(cv->getTime()->clone()), cv.release());
250 std::unique_ptr<te::st::CoverageSeries>
253 te::st::RasterCoverageSeriesDataSetInfo::const_iterator it = info.begin();
254 std::unique_ptr<te::st::CoverageSeries> result(
new CoverageSeries());
255 while(it!=info.end())
257 std::unique_ptr<RasterCoverage> cv(
getCoverage(*it));
258 result->add(static_cast<te::dt::DateTime*>(cv->getTime()->clone()), cv.release());
264 std::unique_ptr<te::st::RasterCoverage>
270 throw Exception(
"The DataSet was not loaded correctly!");
272 std::unique_ptr<te::st::RasterCoverage> result(
new RasterCoverage());
273 while(dset->moveNext())
276 std::unique_ptr<te::dt::DateTime>
dt;
282 std::unique_ptr<te::rst::Raster> raster(dset->getRaster(info.
getRasterPropName()));
283 result->set(raster.release(), dt.release());
288 std::unique_ptr<te::st::PointCoverage>
295 throw Exception(
"The DataSet was not loaded correctly!");
298 std::vector<int> ptypes;
299 std::vector<std::string> pnames;
301 for(
unsigned int i=0; i<vPropDS.size(); ++i)
304 ptypes.push_back(dset->getPropertyDataType(idx));
305 pnames.push_back(vPropDS[i]);
314 if(!tPropName.empty())
318 ptypes.push_back(dset->getPropertyDataType(idx));
319 pnames.push_back(tpDS);
320 vPropDS.push_back(tpDS);
321 tpCV =
static_cast<unsigned int>(ptypes.size() - 1);
326 std::unique_ptr<te::st::PointCoverage> result(
new PointCoverage(interp,
nullptr, dt.release(),
static_cast<int>(vPropDS.size()), ptypes, pnames, tpCV));
328 while(dset->moveNext())
334 boost::ptr_vector<te::dt::AbstractData> values;
335 for(
unsigned int i=0; i<vPropDS.size(); ++i)
336 values.push_back(dset->getValue(vPropDS[i]).release());
338 result->add(*static_cast<te::gm::Point*>(geom.release()), values);
343 std::unique_ptr<te::dt::DateTimePeriod>
347 return impl->getTemporalExtent(info);
350 std::unique_ptr<te::dt::DateTimePeriod>
354 return impl->getTemporalExtent(info);
357 std::unique_ptr<te::dt::DateTimePeriod>
361 return impl->getTemporalExtent(info);
368 return impl->getSpatialExtent(info);
375 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 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 std::unique_ptr< CoverageSeries > getCoverageSeries(const PointCoverageSeriesDataSetInfo &info, AbstractPointCoverageInterp *interp)
It returns a point coverage series.
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.
Base exception class for plugin module.
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.
static std::unique_ptr< RasterCoverage > getCoverage(const RasterCoverageDataSetInfo &info)
It returns a raster coverage.
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.
static te::dt::TimeDuration dt(20, 30, 50, 11)
TEDATAACCESSEXPORT DataSet * GetDataSet(const std::string &name, const std::string &datasourceId)
static std::unique_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 the information about the DataSource.
virtual AbstractData * clone() const =0
It returns a clone of this object.
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.
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
const std::string getConnInfoAsString() const
std::string getDataSetName() const
It returns the DataSet name.
static std::unique_ptr< te::dt::DateTimePeriod > getTemporalExtent(const ObservationDataSetInfo &info)
It returns the temporal extent of the data set with observations.
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.