MeteoIODoc  MeteoIODoc-2.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StationData.h
Go to the documentation of this file.
1 /***********************************************************************************/
2 /* Copyright 2009 WSL Institute for Snow and Avalanche Research SLF-DAVOS */
3 /***********************************************************************************/
4 /* This file is part of MeteoIO.
5  MeteoIO 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, or
8  (at your option) any later version.
9 
10  MeteoIO 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 MeteoIO. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef STATIONDATA_H
19 #define STATIONDATA_H
20 
22 
23 #include <string>
24 #include <iomanip>
25 #include <vector>
26 
27 namespace mio {
28 
38 class StationData {
39  public:
40  //Constructors
44  StationData(void);
45 
52  StationData(const Coords& i_position, const std::string& i_id="", const std::string& i_name="");
53 
54  //Specific getter functions
55  std::string getStationID() const;
56  std::string getStationName() const;
57  Coords getPosition() const;
58  std::string getHash() const;
59  double getAltitude() const;
60 
65  double getSlopeAngle() const;
66 
71  double getAzimuth() const;
72 
79  void setStationData(const Coords& i_position, const std::string& i_id="", const std::string& i_name="");
80 
86  void setSlope(const double& in_slope_angle, const double& in_azimuth);
87 
88  const std::string toString() const;
89  friend std::iostream& operator<<(std::iostream& os, const StationData& station);
90  friend std::iostream& operator>>(std::iostream& is, StationData& station);
91 
92  //Comparison operators
98  bool operator==(const StationData&) const;
99  bool operator!=(const StationData&) const;
100 
109  static StationData merge(StationData sd1, const StationData& sd2);
110 
117  void merge(const StationData& sd2);
118 
119  public:
121  std::string stationID;
122  std::string stationName;
123 
124  private:
125  double slope;
126  double azi;
127 };
128 
129 typedef std::vector<StationData> STATIONS_SET;
130 
131 } //end namespace
132 
133 #endif
double getSlopeAngle() const
Get local slope angle.
Definition: StationData.cc:105
static StationData merge(StationData sd1, const StationData &sd2)
Simple merge strategy. If some fields of the first argument are empty, they will be filled by the mat...
Definition: StationData.cc:70
Coords getPosition() const
Definition: StationData.cc:85
std::string stationID
ID of the Station, typically a short string.
Definition: StationData.h:121
std::string getHash() const
Definition: StationData.cc:97
bool operator==(const StationData &) const
Equality operator check all parameters but the station name.
Definition: StationData.cc:59
void setStationData(const Coords &i_position, const std::string &i_id="", const std::string &i_name="")
General setter function.
Definition: StationData.cc:34
A class to handle geographic coordinate systems. This class offers an easy way to transparently conve...
Definition: Coords.h:81
void setSlope(const double &in_slope_angle, const double &in_azimuth)
Slope information setter.
Definition: StationData.cc:41
friend std::iostream & operator<<(std::iostream &os, const StationData &station)
Definition: StationData.cc:124
friend std::iostream & operator>>(std::iostream &is, StationData &station)
Definition: StationData.cc:139
double getAltitude() const
Definition: StationData.cc:101
std::string stationName
Name of the Station, detailled description.
Definition: StationData.h:122
const std::string toString() const
Definition: StationData.cc:113
bool operator!=(const StationData &) const
Operator that tests for inequality.
Definition: StationData.cc:66
std::vector< StationData > STATIONS_SET
Definition: StationData.h:129
std::string getStationID() const
Definition: StationData.cc:89
StationData(void)
The default constructor initializing every double attribute to nodata and strings to ""...
Definition: StationData.cc:28
A class to represent meteo stations with attributes like longitude, latitude, etc.
Definition: StationData.h:38
double getAzimuth() const
Get local slope azimuth.
Definition: StationData.cc:109
std::string getStationName() const
Definition: StationData.cc:93
Coords position
Definition: StationData.h:120