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::auto_ptr<te::st::ObservationDataSet>
60 return impl->getDataSet(info, travType);
63 std::auto_ptr<te::st::ObservationDataSet>
68 return impl->getDataSet(info, e, r, travType);
71 std::auto_ptr<te::st::ObservationDataSet>
76 return impl->getDataSet(info, geom, r, travType);
79 std::auto_ptr<te::st::ObservationDataSet>
85 return impl->getDataSet(info, dt, r, travType);
88 std::auto_ptr<te::st::ObservationDataSet>
95 return impl->getDataSet(info, geom, sr, dt, tr, travType);
99 std::vector<te::st::TrajectoryDataSetInfo>& output)
102 return impl->getInfo(input, output);
105 std::auto_ptr<te::st::TrajectoryDataSet>
109 return impl->getDataSet(info, travType);
112 std::auto_ptr<te::st::TrajectoryDataSet>
118 return impl->getDataSet(info, travType);
121 std::auto_ptr<te::st::TrajectoryDataSet>
126 return impl->getDataSet(info, e, r, travType);
130 std::auto_ptr<te::st::TrajectoryDataSet>
136 return impl->getDataSet(info, dt, r, travType);
139 std::auto_ptr<te::st::TrajectoryDataSet>
145 return impl->getDataSet(info, geom, sr, dt, tr, travType);
150 std::vector<te::st::TimeSeriesDataSetInfo>& output)
153 return impl->getInfo(input, output);
156 std::auto_ptr<te::st::TimeSeriesDataSet>
160 return impl->getDataSet(info, travType);
163 std::auto_ptr<te::st::TimeSeriesDataSet>
169 return impl->getDataSet(info, dt, r, travType);
172 std::auto_ptr<te::st::CoverageSeries>
176 te::st::PointCoverageSeriesDataSetInfo::const_iterator it = info.begin();
177 std::auto_ptr<te::st::CoverageSeries> result(
new CoverageSeries());
178 while(it!=info.end())
180 std::auto_ptr<PointCoverage> cv(getCoverage(*it, interp));
181 result->add(static_cast<te::dt::DateTime*>(cv->getTime()->clone()), cv.release());
188 std::auto_ptr<te::st::CoverageSeries>
191 te::st::RasterCoverageSeriesDataSetInfo::const_iterator it = info.begin();
192 std::auto_ptr<te::st::CoverageSeries> result(
new CoverageSeries());
193 while(it!=info.end())
195 std::auto_ptr<RasterCoverage> cv(getCoverage(*it));
196 result->add(static_cast<te::dt::DateTime*>(cv->getTime()->clone()), cv.release());
202 std::auto_ptr<te::st::RasterCoverage>
208 throw Exception(
"The DataSet was not loaded correctly!");
210 std::auto_ptr<te::st::RasterCoverage> result(
new RasterCoverage());
211 while(dset->moveNext())
214 std::auto_ptr<te::dt::DateTime> dt = info.
getTime();
217 std::auto_ptr<te::rst::Raster> raster(dset->getRaster(info.
getRasterPropIdx()));
218 result->set(raster.release(), dt.release());
223 std::auto_ptr<te::st::PointCoverage>
230 throw Exception(
"The DataSet was not loaded correctly!");
233 std::vector<int> ptypes;
234 std::vector<std::string> pnames;
236 for(
unsigned int i=0; i<vPropDS.size(); ++i)
238 ptypes.push_back(dset->getPropertyDataType(vPropDS[i]));
239 pnames.push_back(dset->getPropertyName(vPropDS[i]));
248 if(tProps.size()>0 && tProps[0]>=0)
251 ptypes.push_back(dset->getPropertyDataType(tpDS));
252 pnames.push_back(dset->getPropertyName(tpDS));
253 vPropDS.push_back(tpDS);
254 tpCV = ptypes.size()-1;
257 std::auto_ptr<te::dt::DateTime> dt = info.
getTime();
258 std::auto_ptr<te::st::PointCoverage> result(
new PointCoverage(interp, 0, dt.get(), vPropDS.size(), ptypes, pnames, tpCV));
260 while(dset->moveNext())
263 std::auto_ptr<te::gm::Geometry> geom(dset->getGeometry(info.
getPointPropIdx()));
266 boost::ptr_vector<te::dt::AbstractData> values;
267 for(
unsigned int i=0; i<vPropDS.size(); ++i)
268 values.push_back(dset->getValue(vPropDS[i]));
270 result->add(*static_cast<te::gm::Point*>(geom.release()), values);
275 std::auto_ptr<te::dt::DateTimePeriod>
279 return impl->getTemporalExtent(info);
282 std::auto_ptr<te::dt::DateTimePeriod>
286 return impl->getTemporalExtent(info);
289 std::auto_ptr<te::dt::DateTimePeriod>
293 return impl->getTemporalExtent(info);
300 return impl->getSpatialExtent(info);
307 return impl->getSpatialExtent(info);
const te::da::DataSourceInfo & getDataSourceInfo() const
It returns the information about the DataSource.
std::vector< RasterCoverageDataSetInfo > RasterCoverageSeriesDataSetInfo
const std::vector< int > & getTimePropIdxs() const
It returns the indexes of the DataSet properties that contains the times associated to the coverage...
const ObservationDataSetInfo & getObservationDataSetInfo() const
It returns information about the DataSet that contains the coverage observations. ...
A class that contains infos about a DataSet that contains observations of one or more time series...
const std::string & getId() const
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 > & getValuePropIdxs() const
It returns the property indexes that contains the values of the coverage.
int getPointPropIdx() const
It returns the property index that contains the points of the coverage.
int getRasterPropIdx() const
It returns the property index that contains the raster of the coverage.
A class that contains infos about a DataSet that contains observations.
An abstract class for interpolation function or interpolator that estimate values at non-observaved l...
std::string getDataSetName() const
It returns the DataSet name.
A concrete class to represent a point coverage.
TEDATAACCESSEXPORT DataSet * GetDataSet(const std::string &name, const std::string &datasourceId)
A concrete class to represent a raster coverage.
static std::auto_ptr< RasterCoverage > getCoverage(const RasterCoverageDataSetInfo &info)
It returns a raster coverage.
std::vector< PointCoverageDataSetInfo > PointCoverageSeriesDataSetInfo
static const std::string sm_STMemoryDataSourceId
The global id of the st memory data source.
virtual ~STDataLoader()
Virtual destructor.
SpatialRelation
Spatial relations between geometric objects.
This file contains an abstract class responsible for loading spatiotemporal data from data sources...
static void finalize()
It finalize the STDataLoader.
static te::gm::Envelope getSpatialExtent(const ObservationDataSetInfo &info)
It returns the temporal extent of the data set with 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.
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...
static std::auto_ptr< CoverageSeries > getCoverageSeries(const PointCoverageSeriesDataSetInfo &info, AbstractPointCoverageInterp *interp)
It returns a point coverage series.
STDataLoader()
Protected constructor.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
TemporalRelation
Temporal relations between date and time (Source: Allen, 1991).
A class that contains infos about a DataSet that contains observations of one or more trajectories...
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.
boost::shared_ptr< DataSource > DataSourcePtr
const std::string & getType() const
TraverseType
A dataset can be traversed in two ways:
const te::da::DataSourceInfo & getDataSourceInfo() const
It returns information about the DataSource from which the DataSet comes.
const std::vector< int > & getTimePropIdxs() const
It returns the indexes of the DataSet properties that contains the times associated to the coverage...
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.
This is the abstract factory for STDataLoaderImpl.
This file contains a class that contains a set of static methods to load spatiotemporal data from dat...
static void getInfo(const TrajectoryDataSetInfo &input, std::vector< TrajectoryDataSetInfo > &output)
It returns the information about all trajectories that exist in a single DataSet. ...
A class that contains infos about a DataSource and DataSet that contains observations of a point cove...
A class to represent a coverage series.
const te::da::DataSourceInfo & getDataSourceInfo() const
It returns information about the DataSource from which the DataSet comes.
static DataSourceManager & getInstance()
It returns a reference to the singleton instance.
An Envelope defines a 2D rectangular region.
static void initialize()
It returns the spatial extent of the observations of a coverage series.
const ObservationDataSetInfo & getObservationDataSetInfo() const
It returns information about the DataSet that contains the coverage observations. ...
A class that contains infos about a DataSource and DataSet that contains observations of a raster cov...