All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ObservationDataSetInfo.cpp
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.cpp
22 
23  \brief This file contains a class called ObservationDataSetInfo
24 */
25 
26 //TerraLib
27 #include "../../../common/StringUtils.h"
28 
29 //ST
30 #include "../observation/ObservationDataSetType.h"
31 #include "ObservationDataSetInfo.h"
32 
34  int phTimePropIdx, int obsPropIdx, int gPropIdx)
35  : m_dsInfo(dsInfo),
36  m_dsName(dsName),
37  m_phTimePropIdx(2,-1),
38  m_geomPropIdx(gPropIdx)
39 {
40  m_observedPropIdx.push_back(obsPropIdx);
41  m_phTimePropIdx[0]=phTimePropIdx;
42 }
43 
45  const std::string& dsName,
46  const std::vector<int>& phTimeIdx,
47  const std::vector<int>& obsPropIdx, int gPropIdx)
48  : m_dsInfo(dsinfo),
49  m_dsName(dsName),
50  m_phTimePropIdx(2,-1),
51  m_observedPropIdx(obsPropIdx),
52  m_geomPropIdx(gPropIdx)
53 {
54  for(std::size_t i=0; i<phTimeIdx.size(); i++)
55  m_phTimePropIdx[i]=phTimeIdx[i];
56 }
57 
59  const std::vector<int>& phTimeIdx, const std::vector<int>& obsPropIdx,
60  const std::vector<int>& valTimeIdx, int resTimeIdx, int gPropIdx)
61  : m_dsInfo(dsinfo),
62  m_dsName(dsName),
63  m_phTimePropIdx(2,-1),
64  m_observedPropIdx(obsPropIdx),
65  m_geomPropIdx(gPropIdx),
66  m_validTimePropIdx(2,-1),
67  m_resultTimePropIdx(resTimeIdx)
68 {
69  for(std::size_t i=0; i<phTimeIdx.size(); i++)
70  m_phTimePropIdx[i]=phTimeIdx[i];
71 
72  for(std::size_t i=0; i<valTimeIdx.size(); i++)
73  m_validTimePropIdx[i]=valTimeIdx[i];
74 }
75 
77 {
78  return m_dsInfo;
79 }
80 
82 {
83  return m_dsName;
84 }
85 
86 void te::st::ObservationDataSetInfo::setDataSetName(const std::string& name )
87 {
88  m_dsName = name;
89 }
90 
91 const std::vector<int>& te::st::ObservationDataSetInfo::getTimePropIdxs() const
92 {
93  return m_phTimePropIdx;
94 }
95 
97 {
98  return m_phTimePropIdx[0];
99 }
100 
102 {
103  return m_phTimePropIdx[1];
104 }
105 
106 void te::st::ObservationDataSetInfo::setTimePropIdxs(const std::vector<int>& idxs)
107 {
108  for(std::size_t i=0; i<idxs.size(); i++)
109  m_phTimePropIdx[i]=idxs[i];
110 }
111 
113 {
114  m_phTimePropIdx[0]=idx;
115 }
116 
118 {
119  m_phTimePropIdx[1]=idx;
120 }
121 
122 const std::vector<int>& te::st::ObservationDataSetInfo::getObsPropIdxs() const
123 {
124  return m_observedPropIdx;
125 }
126 
127 void te::st::ObservationDataSetInfo::setObsPropIdxs(const std::vector<int>& props, int gPropIdx)
128 {
129  m_observedPropIdx = props;
130  m_geomPropIdx = gPropIdx;
131 }
132 
134 {
135  return m_geomPropIdx;
136 }
137 
139 {
140  return m_validTimePropIdx[0];
141 }
142 
144 {
145  return m_validTimePropIdx[1];
146 }
147 
149 {
150  return m_validTimePropIdx;
151 }
152 
154 {
155  m_validTimePropIdx[0]=idx;
156 }
157 
159 {
160  m_validTimePropIdx[1]=idx;
161 }
162 
163 void te::st::ObservationDataSetInfo::setVlTimePropIdxs(const std::vector<int>& idxs)
164 {
165  for(std::size_t i=0; i<idxs.size(); i++)
166  m_validTimePropIdx[i]=idxs[i];
167 }
168 
170 {
171  return m_resultTimePropIdx;
172 }
173 
175 {
176  m_resultTimePropIdx = idx;
177 }
178 
180 {
181  return te::common::Convert2UCase(m_dsInfo.getId()+"&"+m_dsName);
182 }
183 
185 {
186 }
const te::da::DataSourceInfo & getDataSourceInfo() const
It returns the information about the DataSource.
std::string getId() const
It returns an id (as a string) that identifies the DataSet.
std::vector< int > m_validTimePropIdx
The indexes of DataSet properties that contain the valid time.
This file contains a class called ObservationDataSetInfo.
int getVlBeginTimePropIdx() const
It returns the index of the DataSet property that contains the valid beginning time.
void setTimePropIdxs(const std::vector< int > &idxs)
It sets the indexes of the DataSet properties that contains the phenomenon time.
std::string getDataSetName() const
It returns the DataSet name.
A class that represents a data source component.
void setEndTimePropIdx(int idx)
It sets the index of the DataSet property that contains the phenomenon end time.
std::string Convert2UCase(const std::string &value)
It converts a string to upper case.
Definition: StringUtils.h:163
int getBeginTimePropIdx() const
It returns the index of the DataSet property that contains the phenomenon beginning time...
std::vector< int > m_phTimePropIdx
The indexes of DataSet properties that contain the phenomenon time.
ObservationDataSetInfo(const te::da::DataSourceInfo &dsinfo, const std::string &dsName, int phTimePropIdx, int obsPropIdx, int gPropIdx=-1)
Constructor.
int getVlEndTimePropIdx() const
It returns the index of the DataSet property that contains the valid end time.
void setVlTimePropIdxs(const std::vector< int > &idxs)
It sets the indexes of the DataSet properties that contains the valid time.
std::vector< int > m_observedPropIdx
The indexes of DataSet properties that are observed.
void setVlBeginTimePropIdx(int idx)
It sets the index of the DataSet property that contains the valid beginning time. ...
int getRsTimePropIdx() const
It returns the index of the DataSet property that contains the result time.
int getGeomPropIdx() const
It returns the index of the property that is a geometry property.
void setBeginTimePropIdx(int idx)
It sets the index of the DataSet property that contains the phenomenon beginning time.
int getEndTimePropIdx() const
It returns the index of the DataSet property that contains the phenomenon end time.
const std::vector< int > & getTimePropIdxs() const
It returns the indexes of the DataSetType properties that contains the phenomenon time...
void setRsTimePropIdx(int idx)
It sets the index of the DataSet property that contains the result time.
void setObsPropIdxs(const std::vector< int > &props, int gPropIdx=-1)
It sets the indexes of the DataSetType properties that are observed over time.
const std::vector< int > & getVlTimePropIdxs() const
It returns the indexes of the DataSet properties that contains the valid time.
const std::vector< int > & getObsPropIdxs() const
It returns the indexes of the DataSetType properties that are observed over time. ...
void setVlEndTimePropIdx(int idx)
It sets the index of the DataSet property that contains the valid end time.
void setDataSetName(const std::string &name)
It sets the DataSet name.
virtual ~ObservationDataSetInfo()
Virtual destructor.