All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ObservationDataSetInfo.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 ObservationDataSetInfo.h
22 
23  \brief This file contains a class called ObservationDataSetInfo
24 */
25 
26 #ifndef __TERRALIB_ST_INTERNAL_OBSERVATIONDATASETINFO_H
27 #define __TERRALIB_ST_INTERNAL_OBSERVATIONDATASETINFO_H
28 
29 //ST
30 #include "../../Config.h"
31 
32 //TerraLib
33 #include "../../../dataaccess/datasource/DataSourceInfo.h"
34 
35 //STL
36 #include <string>
37 #include <vector>
38 
39 namespace te { namespace da { class DataSourceInfo; } }
40 
41 namespace te
42 {
43  namespace st
44  {
45  /*!
46  \class ObservationDataSetInfo
47 
48  \brief A class that contains infos about a DataSet that contains observations.
49 
50  This class contains information about a DataSet that
51  contains observations. This information includes:
52  (1) the DataSource which it is from
53  (2) the DataSet name
54  (3) the DataSet properties that contains the phenomenon time, the result time, etc.
55 
56  An observation is an act associated with a discrete position in time,
57  in space or in space and time through which a number, term or other value
58  is assigned to a phenomenon. So, given a DataSet that contains observations,
59  we need to know some extra information about it, such as what columns contain
60  the phenomenon time and the observed properties.
61 
62  \sa DataSourceInfo
63  */
65  {
66  public:
67 
68  /*!
69  \brief Constructor.
70 
71  \param dsinfo Infos about the DataSource.
72  \param dsName The DataSet name.
73  \param phTimeIdx The index of the DataSet property that contains the phenomenon time.
74  \param obsPropIdx The index of the DataSet property that is observed.
75  \param gPropIdx The index of the property that contains the spatial information.
76 
77  */
78  ObservationDataSetInfo( const te::da::DataSourceInfo& dsinfo, const std::string& dsName,
79  int phTimePropIdx, int obsPropIdx, int gPropIdx = -1);
80 
81  /*!
82  \brief Constructor.
83 
84  \param dsinfo Infos about the DataSource.
85  \param dsName The DataSet name.
86  \param phTimeIdx The indexes of DataSet properties that contain the phenomenon time.
87  \param obsPropIdx The indexes of DataSete properties that are observed.
88  \param gPropIdx The index of the property that contains the spatial information.
89 
90  */
91  ObservationDataSetInfo( const te::da::DataSourceInfo& dsinfo, const std::string& dsName,
92  const std::vector<int>& phTimeIdx,
93  const std::vector<int>& obsPropIdx, int gPropIdx = -1);
94 
95  /*!
96  \brief Constructor.
97 
98  \param dsinfo Infos about the DataSource.
99  \param dsName The DataSet name.
100  \param phTimeIdx The indexes of DataSetType properties that contains the phenomen time.
101  \param obsPropIdx The indexes of DataSetType property that are observed.
102  \param valTimeIdx The indexes of DataSetType properties that contains the valid time.
103  \param resTimeIdx The index of DataSetType property that contains the result time.
104  \param gPropIdx The index of the property that contains the spatial information.
105  */
106  ObservationDataSetInfo( const te::da::DataSourceInfo& dsinfo, const std::string& dsName,
107  const std::vector<int>& phTimeIdx, const std::vector<int>& obsPropIdx,
108  const std::vector<int>& valTimeIdx, int resTimeIdx, int gPropIdx = -1);
109 
110  /*!
111  \brief It returns the information about the DataSource
112 
113  \return A reference to the internal DataSourceInfo.
114  */
115  const te::da::DataSourceInfo& getDataSourceInfo() const;
116 
117  /*!
118  \brief It returns the DataSet name
119 
120  \return The dataSet name
121  */
122  std::string getDataSetName() const;
123 
124  /*!
125  \brief It sets the DataSet name
126 
127  \param name The dataSet name
128  */
129  void setDataSetName(const std::string& name);
130 
131  /*!
132  \brief It returns the indexes of the DataSetType properties that contains the phenomenon time.
133 
134  \return The indexes of the DataSetType properties that contains the phenomenon time.
135  */
136  const std::vector<int>& getTimePropIdxs() const;
137 
138  /*!
139  \brief It returns the index of the DataSet property that contains the phenomenon beginning time.
140 
141  \return The index of the DataSet property that contains the phenomenon beginning time.
142  */
143  int getBeginTimePropIdx() const;
144 
145  /*!
146  \brief It returns the index of the DataSet property that contains the phenomenon end time.
147 
148  \return The index of the DataSet property that contains the phenomenon end time.
149 
150  \note It returns -1 when there is no a phenomenon end time.
151  */
152  int getEndTimePropIdx() const;
153 
154  /*!
155  \brief It sets the indexes of the DataSet properties that contains the phenomenon time.
156 
157  \param idxs The indexes of the DataSet properties that contains the phenomenon time.
158  */
159  void setTimePropIdxs(const std::vector<int>& idxs);
160 
161  /*!
162  \brief It sets the index of the DataSet property that contains the phenomenon beginning time.
163 
164  \param idx The index of the DataSet property that contains the phenomenon beginning time.
165  */
166  void setBeginTimePropIdx(int idx);
167 
168  /*!
169  \brief It sets the index of the DataSet property that contains the phenomenon end time.
170 
171  \param idx The index of the DataSet property that contains the phenomenon end time.
172  */
173  void setEndTimePropIdx(int idx);
174 
175  /*!
176  \brief It returns the indexes of the DataSetType properties that are observed over time.
177 
178  \return The indexes of the DataSetType properties that are observed over time.
179  */
180  const std::vector<int>& getObsPropIdxs() const;
181 
182  /*!
183  \brief It sets the indexes of the DataSetType properties that are observed over time.
184 
185  \param props The indexes of the DataSetType properties that are observed over time.
186  \param gPropIdx The index of the observed property that contains the spatial information.
187  */
188  void setObsPropIdxs(const std::vector<int>& props, int gPropIdx = -1);
189 
190  /*!
191  \brief It returns the index of the property that is a geometry property.
192 
193  \return The index of the property that is a geometry property.
194  */
195  int getGeomPropIdx() const;
196 
197  /*!
198  \brief It returns the index of the DataSet property that contains the valid beginning time.
199 
200  \return The index of the DataSet property that contains the valid beginning time.
201 
202  \note It returns -1 when there is no a valid beginning time.
203  */
204  int getVlBeginTimePropIdx() const;
205 
206  /*!
207  \brief It returns the index of the DataSet property that contains the valid end time.
208 
209  \return The index of the DataSet property that contains the valid end time.
210 
211  \note It returns -1 when there is no a valid end time.
212  */
213  int getVlEndTimePropIdx() const;
214 
215  /*!
216  \brief It returns the indexes of the DataSet properties that contains the valid time.
217 
218  \return The indexes of the DataSet properties that contains the valid time.
219  */
220  const std::vector<int>& getVlTimePropIdxs() const;
221 
222  /*!
223  \brief It sets the index of the DataSet property that contains the valid beginning time.
224 
225  \param idx The index of the DataSet property that contains the valid beginning time.
226  */
227  void setVlBeginTimePropIdx(int idx);
228 
229  /*!
230  \brief It sets the index of the DataSet property that contains the valid end time.
231 
232  \param idx The index of the DataSet property that contains the valid end time.
233  */
234  void setVlEndTimePropIdx(int idx);
235 
236  /*!
237  \brief It sets the indexes of the DataSet properties that contains the valid time.
238 
239  \param idxs The indexes of the DataSet properties that contains the valid time.
240  */
241  void setVlTimePropIdxs(const std::vector<int>& idxs);
242 
243  /*!
244  \brief It returns the index of the DataSet property that contains the result time.
245 
246  \return The index of the DataSet properties that contains the result time.
247  */
248  int getRsTimePropIdx() const;
249 
250  /*!
251  \brief It sets the index of the DataSet property that contains the result time.
252 
253  \param idx The index of the DataSet property that contains the result time.
254  */
255  void setRsTimePropIdx(int idx);
256 
257  /*!
258  \brief It returns an id (as a string) that identifies the DataSet.
259 
260  The id is composed of : DataSourceId + DataSetName
261 
262  \return An id that identifies the DataSet
263  */
264  std::string getId() const;
265 
266  /*! \brief Virtual destructor. */
267  virtual ~ObservationDataSetInfo();
268 
269  protected:
270 
271  te::da::DataSourceInfo m_dsInfo; //!< Information about the DataSource from which the DataSet come.
272  std::string m_dsName; //!< The DataSet name
273  std::vector<int> m_phTimePropIdx; //!< The indexes of DataSet properties that contain the phenomenon time.
274  std::vector<int> m_observedPropIdx; //!< The indexes of DataSet properties that are observed.
275  int m_geomPropIdx; //!< The index of the property that contains the spatial information.
276  std::vector<int> m_validTimePropIdx; //!< The indexes of DataSet properties that contain the valid time.
277  int m_resultTimePropIdx; //!< The index of DataSet property that contains the result time.
278  };
279  } // end namespace st
280 } // end namespace te
281 
282 #endif // __TERRALIB_ST_INTERNAL_OBSERVATIONDATASETINFO_H
283 
std::vector< int > m_validTimePropIdx
The indexes of DataSet properties that contain the valid time.
std::string m_dsName
The DataSet name.
A class that contains infos about a DataSet that contains observations.
A class that represents a data source component.
te::da::DataSourceInfo m_dsInfo
Information about the DataSource from which the DataSet come.
std::vector< int > m_phTimePropIdx
The indexes of DataSet properties that contain the phenomenon time.
std::vector< int > m_observedPropIdx
The indexes of DataSet properties that are observed.
#define TESTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:136
int m_resultTimePropIdx
The index of DataSet property that contains the result time.
int m_geomPropIdx
The index of the property that contains the spatial information.