All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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,
88 
89  void getInfo( const TrajectoryDataSetInfo& input, std::vector<TrajectoryDataSetInfo>& output);
90 
91  std::auto_ptr<TrajectoryDataSet> getDataSet(const TrajectoryDataSetInfo& info,
93 
94  std::auto_ptr<TrajectoryDataSet> getDataSet(const TrajectoryDataSetInfo& info,
97 
98  std::auto_ptr<TrajectoryDataSet> getDataSet(const TrajectoryDataSetInfo& info,
101 
102  std::auto_ptr<TrajectoryDataSet> getDataSet(const TrajectoryDataSetInfo& info,
105 
106  std::auto_ptr<TrajectoryDataSet> getDataSet(const TrajectoryDataSetInfo& info,
110 
111  void getInfo( const TimeSeriesDataSetInfo& input, std::vector<TimeSeriesDataSetInfo>& output);
112 
113  std::auto_ptr<TimeSeriesDataSet> getDataSet(const TimeSeriesDataSetInfo& info,
115 
116  std::auto_ptr<TimeSeriesDataSet> getDataSet(const TimeSeriesDataSetInfo& info,
119 
120  std::auto_ptr<te::dt::DateTimePeriod> getTemporalExtent(const ObservationDataSetInfo& info);
121 
122  std::auto_ptr<te::dt::DateTimePeriod> getTemporalExtent(const TrajectoryDataSetInfo& info);
123 
124  std::auto_ptr<te::dt::DateTimePeriod> getTemporalExtent(const TimeSeriesDataSetInfo& info);
125 
126  te::gm::Envelope getSpatialExtent(const ObservationDataSetInfo& info);
127 
128  te::gm::Envelope getSpatialExtent(const TrajectoryDataSetInfo& info);
129  //@}
130 
131  virtual ~STDataLoaderFromMemDS();
132 
133  protected:
134 
135  /*! \brief It loads DataSet from the original DataSource and put it in the In-Memory DataSource
136 
137  \note It can through an Exception.
138  */
139  void loadDataSet( const te::da::DataSourceInfo& info, const std::string dsname,
140  int begTimePropIdx, int endTimePropIdx, int gmPropIdx);
141 
142  /*! \brief It builds an ObservationDataSet from a given DataSet */
143  std::auto_ptr<ObservationDataSet> buildDataSet(te::stmem::DataSet* ds, const ObservationDataSetInfo& info);
144 
145  /*! \brief It builds an TrajectoryDataSet from a given DataSet */
146  std::auto_ptr<TrajectoryDataSet> buildDataSet(te::stmem::DataSet* ds, const TrajectoryDataSetInfo& info);
147 
148  /*! \brief It builds an TimeSeriesDataSet from a given DataSet */
149  std::auto_ptr<TimeSeriesDataSet> buildDataSet(te::stmem::DataSet* ds, const TimeSeriesDataSetInfo& info);
150 
151  private:
152 
153  te::da::DataSourcePtr m_ds; //! A shared pointer to the ST In-Mem Data Source
154 
155  };
156  } // end namespace st
157 } // end namespace te
158 
159 #endif // __TERRALIB_ST_INTERNAL_STDATALOADERFROMMEMDS_H
160 
161 
162 
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.
Implementation of a in-memory data set that contains spatiotemporal observations indexed by time and ...
Definition: DataSet.h:61
A class that represents a data source component.
A class responsible for loading spatiotemporal data from a ST in-memory DataSource which contains an ...
SpatialRelation
Spatial relations between geometric objects.
Definition: Enums.h:122
This file contains an abstract class responsible for loading spatiotemporal data from data sources...
#define TESTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:136
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:73
TemporalRelation
Temporal relations between date and time (Source: Allen, 1991).
Definition: Enums.h:76
A class that contains infos about a DataSet that contains observations of one or more trajectories...
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1395
TraverseType
A dataset can be traversed in two ways:
Definition: Enums.h:53
An abstract class responsible for loading spatiotemporal data from data sources.
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51