OGS
Station.h
Go to the documentation of this file.
1 
15 #pragma once
16 
17 #include <memory>
18 #include <string>
19 
20 #include "Point.h"
21 #include "SensorData.h"
22 
23 namespace GeoLib
24 {
36 class Station : public Point
37 {
38 public:
48  explicit Station(double x = 0.0, double y = 0.0, double z = 0.0,
49  std::string name = "");
50 
51  explicit Station(Point* coords, std::string name = "");
52 
57  Station(Station const& src);
58 
60  std::string const& getName() const { return _name; }
61 
62  void setName(std::string const& name) { _name = name; }
63 
65  static Station* createStation(const std::string &line);
66 
68  static Station* createStation(const std::string &name, double x, double y, double z);
69 
71  double getStationValue() const { return this->_station_value; }
72 
74  void setStationValue(double station_value) { this->_station_value = station_value; }
75 
77  void addSensorDataFromCSV(const std::string& file_name)
78  {
79  _sensor_data.reset(new SensorData(file_name));
80  }
81 
83  const SensorData* getSensorData() const { return _sensor_data.get(); }
84 
85 private:
86  std::string _name;
87  double _station_value{0.0};
88  std::unique_ptr<SensorData> _sensor_data{nullptr};
89 };
90 
91 bool isStation(GeoLib::Point const* pnt);
92 } // namespace GeoLib
Definition of the SensorData class.
A Station (observation site) is basically a Point with some additional information.
Definition: Station.h:37
double _station_value
Definition: Station.h:87
Station(double x=0.0, double y=0.0, double z=0.0, std::string name="")
Constructor.
Definition: Station.cpp:25
void addSensorDataFromCSV(const std::string &file_name)
Allows to add sensor data from a CSV file to the observation site.
Definition: Station.h:77
const SensorData * getSensorData() const
Returns all the sensor data for this observation site.
Definition: Station.h:83
std::unique_ptr< SensorData > _sensor_data
Definition: Station.h:88
std::string _name
Definition: Station.h:86
double getStationValue() const
Returns the specific value for this station.
Definition: Station.h:71
std::string const & getName() const
Returns the name of the station.
Definition: Station.h:60
void setName(std::string const &name)
Definition: Station.h:62
static Station * createStation(const std::string &line)
Creates a Station-object from information contained in a string (assuming the string has the right fo...
Definition: Station.cpp:45
void setStationValue(double station_value)
Allows to set a specific value for this station (e.g. for classification)
Definition: Station.h:74
A container for sensor data at an observation site. The class stores a number of time series and has ...
Definition: SensorData.h:62
bool isStation(GeoLib::Point const *pnt)
Definition: Station.cpp:76