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::auto_ptr<ObservationDataSet> getDataSet(const ObservationDataSetInfo& info,
71 
72  std::auto_ptr<ObservationDataSet> getDataSet(const ObservationDataSetInfo& info, const te::gm::Envelope& e,
75 
76  std::auto_ptr<ObservationDataSet> getDataSet(const ObservationDataSetInfo& info, const te::gm::Geometry& geom,
79 
80  std::auto_ptr<ObservationDataSet> getDataSet(const ObservationDataSetInfo& info,
83 
84  std::auto_ptr<ObservationDataSet> getDataSet(const ObservationDataSetInfo& info,
85  const te::dt::DateTime& dt,
87  const te::gm::Envelope& e,
90 
91  std::auto_ptr<ObservationDataSet> getDataSet(const ObservationDataSetInfo& info,
95 
96  void getInfo( const TrajectoryDataSetInfo& input, std::vector<TrajectoryDataSetInfo>& output);
97 
98  std::auto_ptr<TrajectoryDataSet> getDataSet(const TrajectoryDataSetInfo& info,
100 
101  std::auto_ptr<TrajectoryDataSet> getDataSet(const TrajectoryDataSetInfo& info,
104 
105  std::auto_ptr<TrajectoryDataSet> getDataSet(const TrajectoryDataSetInfo& info,
108 
109  std::auto_ptr<TrajectoryDataSet> getDataSet(const TrajectoryDataSetInfo& info,
112 
113  std::auto_ptr<TrajectoryDataSet> getDataSet(const TrajectoryDataSetInfo& info,
114  const te::dt::DateTime& dt,
116  const te::gm::Envelope& e,
119 
120  std::auto_ptr<TrajectoryDataSet> getDataSet(const TrajectoryDataSetInfo& info,
124 
125  void getInfo( const TimeSeriesDataSetInfo& input, std::vector<TimeSeriesDataSetInfo>& output);
126 
127  std::auto_ptr<TimeSeriesDataSet> getDataSet(const TimeSeriesDataSetInfo& info,
129 
130  std::auto_ptr<TimeSeriesDataSet> getDataSet(const TimeSeriesDataSetInfo& info,
133 
134  std::auto_ptr<TimeSeriesDataSet> getDataSet(const TimeSeriesDataSetInfo& info,
137 
138  std::auto_ptr<TimeSeriesDataSet> getDataSet(const TimeSeriesDataSetInfo& info,
141 
142  std::auto_ptr<TimeSeriesDataSet> getDataSet(const TimeSeriesDataSetInfo& info,
143  const te::dt::DateTime& dt,
145  const te::gm::Envelope& e,
148 
149  std::auto_ptr<TimeSeriesDataSet> getDataSet(const TimeSeriesDataSetInfo& info,
153 
154  std::auto_ptr<te::dt::DateTimePeriod> getTemporalExtent(const ObservationDataSetInfo& info);
155 
156  std::auto_ptr<te::dt::DateTimePeriod> getTemporalExtent(const TrajectoryDataSetInfo& info);
157 
158  std::auto_ptr<te::dt::DateTimePeriod> getTemporalExtent(const TimeSeriesDataSetInfo& info);
159 
160  te::gm::Envelope getSpatialExtent(const ObservationDataSetInfo& info);
161 
162  te::gm::Envelope getSpatialExtent(const TrajectoryDataSetInfo& info);
163  //@}
164 
165  virtual ~STDataLoaderFromMemDS();
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::auto_ptr<ObservationDataSet> buildDataSet(te::stmem::DataSet* ds, const ObservationDataSetInfo& info);
179 
180  /*! \brief It builds an TrajectoryDataSet from a given DataSet */
181  std::auto_ptr<TrajectoryDataSet> buildDataSet(te::stmem::DataSet* ds, const TrajectoryDataSetInfo& info);
182 
183  /*! \brief It builds an TimeSeriesDataSet from a given DataSet */
184  std::auto_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 
#define TESTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:88
An abstract class responsible for loading spatiotemporal data from data sources.
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1438
A class that contains infos about a DataSet that contains 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).
Definition: Enums.h:140
SpatialRelation
Spatial relations between geometric objects.
Definition: Enums.h:127
TraverseType
A dataset can be traversed in two ways:
Definition: Enums.h:53
A class responsible for loading spatiotemporal data from a ST in-memory DataSource which contains an ...
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
URI C++ Library.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:74
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:61
A class that contains infos about a DataSet that contains observations of one or more time series...
A class that represents a data source component.