STDataLoaderFromMemDS.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18 */
19 
20 /*!
21  \file STDataLoaderFromMemDS.h
22 
23  \brief This file contains a class responsible for loading spatiotemporal data
24  from a ST in-memory DataSource which contains an internal chache of
25  in-memory DataSets indexed by space and time.
26 */
27 
28 #ifndef __TERRALIB_ST_INTERNAL_STDATALOADERFROMMEMDS_H
29 #define __TERRALIB_ST_INTERNAL_STDATALOADERFROMMEMDS_H
30 
31 //ST
32 #include "../Config.h"
33 #include "STDataLoaderImpl.h"
34 
35 //TerraLib
36 #include "../../dataaccess/datasource/DataSource.h"
37 
38 //Forward declarations
39 namespace te { namespace da { class DataSourceInfo; } }
40 namespace te { namespace stmem { class DataSet; } }
41 
42 namespace te
43 {
44  namespace st
45  {
46  /*!
47  \class STDataLoaderFromMemDS
48 
49  \brief A class responsible for loading spatiotemporal data
50  from a ST in-memory DataSource which contains an internal chache of
51  in-memory DataSets indexed by space and time.
52 
53  All infos about the DataSets that contains observations, such as ObservationDataSetInfo,
54  TrajectoryDataSetInfo, etc, contains information about the original DataSource and
55  DataSet.
56 
57  //TO DO: verificar o nome do DataSet: do jeito que está não pode ter nome repetido!
58  */
60  {
61  public:
62 
63  /*! \brief Constructor*/
65 
66  /*! \name Inhered methods*/
67  //@{
68 
69  std::unique_ptr<ObservationDataSet> getDataSet(const ObservationDataSetInfo& info,
71 
72  std::unique_ptr<ObservationDataSet> getDataSet(const ObservationDataSetInfo& info, const te::gm::Envelope& e,
75 
76  std::unique_ptr<ObservationDataSet> getDataSet(const ObservationDataSetInfo& info, const te::gm::Geometry& geom,
79 
80  std::unique_ptr<ObservationDataSet> getDataSet(const ObservationDataSetInfo& info,
83 
84  std::unique_ptr<ObservationDataSet> getDataSet(const ObservationDataSetInfo& info,
85  const te::dt::DateTime& dt,
87  const te::gm::Envelope& e,
90 
91  std::unique_ptr<ObservationDataSet> getDataSet(const ObservationDataSetInfo& info,
95 
96  void getInfo( const TrajectoryDataSetInfo& input, std::vector<TrajectoryDataSetInfo>& output);
97 
98  std::unique_ptr<TrajectoryDataSet> getDataSet(const TrajectoryDataSetInfo& info,
100 
101  std::unique_ptr<TrajectoryDataSet> getDataSet(const TrajectoryDataSetInfo& info,
104 
105  std::unique_ptr<TrajectoryDataSet> getDataSet(const TrajectoryDataSetInfo& info,
108 
109  std::unique_ptr<TrajectoryDataSet> getDataSet(const TrajectoryDataSetInfo& info,
112 
113  std::unique_ptr<TrajectoryDataSet> getDataSet(const TrajectoryDataSetInfo& info,
114  const te::dt::DateTime& dt,
116  const te::gm::Envelope& e,
119 
120  std::unique_ptr<TrajectoryDataSet> getDataSet(const TrajectoryDataSetInfo& info,
124 
125  void getInfo( const TimeSeriesDataSetInfo& input, std::vector<TimeSeriesDataSetInfo>& output);
126 
127  std::unique_ptr<TimeSeriesDataSet> getDataSet(const TimeSeriesDataSetInfo& info,
129 
130  std::unique_ptr<TimeSeriesDataSet> getDataSet(const TimeSeriesDataSetInfo& info,
133 
134  std::unique_ptr<TimeSeriesDataSet> getDataSet(const TimeSeriesDataSetInfo& info,
137 
138  std::unique_ptr<TimeSeriesDataSet> getDataSet(const TimeSeriesDataSetInfo& info,
141 
142  std::unique_ptr<TimeSeriesDataSet> getDataSet(const TimeSeriesDataSetInfo& info,
143  const te::dt::DateTime& dt,
145  const te::gm::Envelope& e,
148 
149  std::unique_ptr<TimeSeriesDataSet> getDataSet(const TimeSeriesDataSetInfo& info,
153 
154  std::unique_ptr<te::dt::DateTimePeriod> getTemporalExtent(const ObservationDataSetInfo& info);
155 
156  std::unique_ptr<te::dt::DateTimePeriod> getTemporalExtent(const TrajectoryDataSetInfo& info);
157 
158  std::unique_ptr<te::dt::DateTimePeriod> getTemporalExtent(const TimeSeriesDataSetInfo& info);
159 
161 
163  //@}
164 
166 
167  protected:
168 
169  /*! \brief It loads DataSet from the original DataSource and put it in the In-Memory DataSource
170 
171  \note It can through an Exception.
172  */
173  void loadDataSet( const te::da::DataSourceInfo& info, const std::string dsname,
174  const std::string& begTimePropName, const std::string& endTimePropName,
175  const std::string& gmPropName);
176 
177  /*! \brief It builds an ObservationDataSet from a given DataSet */
178  std::unique_ptr<ObservationDataSet> buildDataSet(te::stmem::DataSet* ds, const ObservationDataSetInfo& info);
179 
180  /*! \brief It builds an TrajectoryDataSet from a given DataSet */
181  std::unique_ptr<TrajectoryDataSet> buildDataSet(te::stmem::DataSet* ds, const TrajectoryDataSetInfo& info);
182 
183  /*! \brief It builds an TimeSeriesDataSet from a given DataSet */
184  std::unique_ptr<TimeSeriesDataSet> buildDataSet(te::stmem::DataSet* ds, const TimeSeriesDataSetInfo& info);
185 
186  private:
187 
188  te::da::DataSourcePtr m_ds; //! A shared pointer to the ST In-Mem Data Source
189 
190  };
191  } // end namespace st
192 } // end namespace te
193 
194 #endif // __TERRALIB_ST_INTERNAL_STDATALOADERFROMMEMDS_H
195 
196 
197 
This file contains an abstract class responsible for loading spatiotemporal data from data sources.
A class that represents a data source component.
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:52
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:78
A class that contains infos about a DataSet that contains observations.
te::gm::Envelope getSpatialExtent(const TrajectoryDataSetInfo &info)
It returns the spatial extent of the observations of a trajectory.
std::unique_ptr< te::dt::DateTimePeriod > getTemporalExtent(const TimeSeriesDataSetInfo &info)
It returns the temporal extent of the data set with observations of a time series.
std::unique_ptr< ObservationDataSet > buildDataSet(te::stmem::DataSet *ds, const ObservationDataSetInfo &info)
It builds an ObservationDataSet from a given DataSet.
STDataLoaderFromMemDS()
Constructor.
std::unique_ptr< TrajectoryDataSet > getDataSet(const TrajectoryDataSetInfo &info, const te::gm::Geometry &geom, te::gm::SpatialRelation sr, const te::dt::DateTime &dt, te::dt::TemporalRelation tr, te::common::TraverseType travType=te::common::FORWARDONLY)
It returns patches of a trajectory whose geometries satisfy a given spatial relation and times satisf...
std::unique_ptr< TimeSeriesDataSet > getDataSet(const TimeSeriesDataSetInfo &info, const te::dt::DateTime &dt, te::dt::TemporalRelation tr, const te::gm::Envelope &e, te::gm::SpatialRelation sr=te::gm::INTERSECTS, te::common::TraverseType travType=te::common::FORWARDONLY)
It returns data set with observations of time series whose geometries satisfy a given spatial relatio...
std::unique_ptr< te::dt::DateTimePeriod > getTemporalExtent(const ObservationDataSetInfo &info)
It returns the temporal extent of the data set with observations.
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.
void getInfo(const TrajectoryDataSetInfo &input, std::vector< TrajectoryDataSetInfo > &output)
It returns the information about all trajectories that exist in a single DataSet.
std::unique_ptr< TimeSeriesDataSet > getDataSet(const TimeSeriesDataSetInfo &info, const te::gm::Geometry &geom, te::gm::SpatialRelation sr, const te::dt::DateTime &dt, te::dt::TemporalRelation tr, te::common::TraverseType travType=te::common::FORWARDONLY)
It returns data set with observations of time series whose geometries satisfy a given spatial relatio...
std::unique_ptr< TimeSeriesDataSet > getDataSet(const TimeSeriesDataSetInfo &info, const te::gm::Geometry &geom, te::gm::SpatialRelation r, te::common::TraverseType travType=te::common::FORWARDONLY)
It returns data set with observations of time series whose geometries satisfy a given spatial relatio...
std::unique_ptr< ObservationDataSet > getDataSet(const ObservationDataSetInfo &info, const te::dt::DateTime &dt, te::dt::TemporalRelation tr, const te::gm::Envelope &e, te::gm::SpatialRelation sr=te::gm::INTERSECTS, te::common::TraverseType travType=te::common::FORWARDONLY)
It returns a data set with observations whose observed geometries satisfy a given spatial relation an...
std::unique_ptr< TrajectoryDataSet > buildDataSet(te::stmem::DataSet *ds, const TrajectoryDataSetInfo &info)
It builds an TrajectoryDataSet from a given DataSet.
std::unique_ptr< TimeSeriesDataSet > getDataSet(const TimeSeriesDataSetInfo &info, te::common::TraverseType travType=te::common::FORWARDONLY)
It returns a data set with observations of time series.
std::unique_ptr< te::dt::DateTimePeriod > getTemporalExtent(const TrajectoryDataSetInfo &info)
It returns the temporal extent of the data set with observations of a trajectory.
std::unique_ptr< TimeSeriesDataSet > buildDataSet(te::stmem::DataSet *ds, const TimeSeriesDataSetInfo &info)
It builds an TimeSeriesDataSet from a given DataSet.
std::unique_ptr< ObservationDataSet > getDataSet(const ObservationDataSetInfo &info, const te::gm::Geometry &geom, te::gm::SpatialRelation r=te::gm::INTERSECTS, te::common::TraverseType travType=te::common::FORWARDONLY)
It returns a data set with observations whose observed geometries satisfy a given spatial relation.
std::unique_ptr< TimeSeriesDataSet > getDataSet(const TimeSeriesDataSetInfo &info, const te::dt::DateTime &dt, te::dt::TemporalRelation r=te::dt::DURING, te::common::TraverseType travType=te::common::FORWARDONLY)
It returns a data set with observations of time series whose times satisfy a given temporal relation.
std::unique_ptr< TrajectoryDataSet > getDataSet(const TrajectoryDataSetInfo &info, const te::dt::DateTime &dt, te::dt::TemporalRelation r=te::dt::DURING, te::common::TraverseType travType=te::common::FORWARDONLY)
It returns a data set with observations of trajectories whose times satisfy a given temporal relation...
std::unique_ptr< TrajectoryDataSet > getDataSet(const TrajectoryDataSetInfo &info, const te::gm::Envelope &e, te::gm::SpatialRelation r, te::common::TraverseType travType=te::common::FORWARDONLY)
It returns patches of a trajectory whose geometries satisfy a given spatial relation.
std::unique_ptr< TrajectoryDataSet > getDataSet(const TrajectoryDataSetInfo &info, te::common::TraverseType travType=te::common::FORWARDONLY)
It returns a data set with observations of a trajectory.
std::unique_ptr< TrajectoryDataSet > getDataSet(const TrajectoryDataSetInfo &info, const te::gm::Geometry &geom, te::gm::SpatialRelation r, te::common::TraverseType travType=te::common::FORWARDONLY)
It returns patches of a trajectory whose geometries satisfy a given spatial relation.
std::unique_ptr< TrajectoryDataSet > getDataSet(const TrajectoryDataSetInfo &info, const te::dt::DateTime &dt, te::dt::TemporalRelation tr, const te::gm::Envelope &e, te::gm::SpatialRelation sr=te::gm::INTERSECTS, te::common::TraverseType travType=te::common::FORWARDONLY)
It returns patches of a trajectory whose envelope satisfy a given spatial relation and times satisfy ...
std::unique_ptr< ObservationDataSet > getDataSet(const ObservationDataSetInfo &info, const te::gm::Envelope &e, te::gm::SpatialRelation r=te::gm::INTERSECTS, te::common::TraverseType travType=te::common::FORWARDONLY)
It returns a data set with observations whose observed geometries satisfy a given spatial relation.
te::gm::Envelope getSpatialExtent(const ObservationDataSetInfo &info)
It returns the temporal extent of the data set with observations of a coverage series.
std::unique_ptr< ObservationDataSet > getDataSet(const ObservationDataSetInfo &info, const te::dt::DateTime &dt, te::dt::TemporalRelation r=te::dt::DURING, te::common::TraverseType travType=te::common::FORWARDONLY)
It returns a data set with observations whose phenomenon times satisfy a given temporal relation.
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.
std::unique_ptr< ObservationDataSet > getDataSet(const ObservationDataSetInfo &info, const te::gm::Geometry &geom, te::gm::SpatialRelation sr, const te::dt::DateTime &dt, te::dt::TemporalRelation tr=te::dt::DURING, te::common::TraverseType travType=te::common::FORWARDONLY)
It returns a data set with observations whose observed geometries satisfy a given spatial relation an...
std::unique_ptr< TimeSeriesDataSet > getDataSet(const TimeSeriesDataSetInfo &info, const te::gm::Envelope &e, te::gm::SpatialRelation r, te::common::TraverseType travType=te::common::FORWARDONLY)
It returns data set with observations of time series whose geometries satisfy a given spatial relatio...
void getInfo(const TimeSeriesDataSetInfo &input, std::vector< TimeSeriesDataSetInfo > &output)
It returns the information about all time series that exist in a single DataSet.
An abstract class responsible for loading spatiotemporal data from data sources.
A class that contains infos about a DataSet that contains observations of one or more time series.
A class that contains infos about a DataSet that contains observations of one or more trajectories.
Implementation of a in-memory data set that contains spatiotemporal observations indexed by time and ...
Definition: DataSet.h:62
TraverseType
A dataset can be traversed in two ways:
Definition: Enums.h:54
@ FORWARDONLY
Definition: Enums.h:55
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1449
TemporalRelation
Temporal relations between date and time (Source: Allen, 1991).
Definition: Enums.h:141
@ DURING
Definition: Enums.h:145
SpatialRelation
Spatial relations between geometric objects.
Definition: Enums.h:128
@ INTERSECTS
Definition: Enums.h:130
TerraLib.
#define TESTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:88