All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
STDataLoaderFromMemDS.h
Go to the documentation of this file.
1 /* Copyright (C) 2001-2009 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<te::dt::DateTimePeriod> getTemporalExtent(const ObservationDataSetInfo& info);
135 
136  std::auto_ptr<te::dt::DateTimePeriod> getTemporalExtent(const TrajectoryDataSetInfo& info);
137 
138  std::auto_ptr<te::dt::DateTimePeriod> getTemporalExtent(const TimeSeriesDataSetInfo& info);
139 
140  te::gm::Envelope getSpatialExtent(const ObservationDataSetInfo& info);
141 
142  te::gm::Envelope getSpatialExtent(const TrajectoryDataSetInfo& info);
143  //@}
144 
145  virtual ~STDataLoaderFromMemDS();
146 
147  protected:
148 
149  /*! \brief It loads DataSet from the original DataSource and put it in the In-Memory DataSource
150 
151  \note It can through an Exception.
152  */
153  void loadDataSet( const te::da::DataSourceInfo& info, const std::string dsname,
154  int begTimePropIdx, int endTimePropIdx, int gmPropIdx);
155 
156  /*! \brief It builds an ObservationDataSet from a given DataSet */
157  std::auto_ptr<ObservationDataSet> buildDataSet(te::stmem::DataSet* ds, const ObservationDataSetInfo& info);
158 
159  /*! \brief It builds an TrajectoryDataSet from a given DataSet */
160  std::auto_ptr<TrajectoryDataSet> buildDataSet(te::stmem::DataSet* ds, const TrajectoryDataSetInfo& info);
161 
162  /*! \brief It builds an TimeSeriesDataSet from a given DataSet */
163  std::auto_ptr<TimeSeriesDataSet> buildDataSet(te::stmem::DataSet* ds, const TimeSeriesDataSetInfo& info);
164 
165  private:
166 
167  te::da::DataSourcePtr m_ds; //! A shared pointer to the ST In-Mem Data Source
168 
169  };
170  } // end namespace st
171 } // end namespace te
172 
173 #endif // __TERRALIB_ST_INTERNAL_STDATALOADERFROMMEMDS_H
174 
175 
176 
#define TESTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:90
An abstract class responsible for loading spatiotemporal data from data sources.
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1435
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:76
SpatialRelation
Spatial relations between geometric objects.
Definition: Enums.h:122
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
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:73
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.