MeteoIODoc 2.11.0
mio::StationData Class Reference

Detailed Description

A class to represent meteo stations with attributes like longitude, latitude, etc.

Author
Thomas Egger
Date
2008-11-29

#include <StationData.h>

Public Member Functions

 StationData (void)
 The default constructor initializing every double attribute to nodata and strings to "". More...
 
 StationData (const Coords &i_position, const std::string &i_id="", const std::string &i_name="")
 A constructor that takes three to six arguments. More...
 
std::string getStationID () const
 
std::string getStationName () const
 
Coords getPosition () const
 
std::string getHash () const
 
double getAltitude () const
 
double getSlopeAngle () const
 Get local slope angle. More...
 
double getAzimuth () const
 Get local slope azimuth. More...
 
void setStationData (const Coords &i_position, const std::string &i_id="", const std::string &i_name="")
 General setter function. More...
 
void setSlope (const double &in_slope_angle, const double &in_azimuth)
 Slope information setter. More...
 
const std::string toString () const
 
bool operator== (const StationData &) const
 Equality operator check all parameters but the station name. More...
 
bool operator!= (const StationData &) const
 Operator that tests for inequality. More...
 
void merge (const StationData &sd2)
 Simple merge strategy. If some fields of the current object are empty, they will be filled by the macthing field from the provided argument. More...
 

Static Public Member Functions

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 matching field from the second argument. More...
 
static bool unique (std::vector< StationData > &vecStation, const bool &position_only=false)
 Remove duplicate stations from a vector. More...
 

Public Attributes

Coords position
 
std::string stationID
 ID of the Station, typically a short string. More...
 
std::string stationName
 Name of the Station, detailed description. More...
 
std::map< std::string, std::string > extra
 Additional metadata, such as sensor types, etc. A better solution will be implemented at some point, so it WILL break. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const StationData &station)
 
std::istream & operator>> (std::istream &is, StationData &station)
 

Constructor & Destructor Documentation

◆ StationData() [1/2]

mio::StationData::StationData ( void  )

The default constructor initializing every double attribute to nodata and strings to "".

◆ StationData() [2/2]

mio::StationData::StationData ( const Coords i_position,
const std::string &  i_id = "",
const std::string &  i_name = "" 
)

A constructor that takes three to six arguments.

Parameters
i_positionPosition of the station
i_idStation's id (short identification)
i_nameFull name of the station (default "")

Member Function Documentation

◆ getAltitude()

double mio::StationData::getAltitude ( ) const
inline

◆ getAzimuth()

double mio::StationData::getAzimuth ( ) const
inline

Get local slope azimuth.

Returns
azimuth of the local slope expressed as a bearing (0 is North, in degrees, clockwise)

◆ getHash()

std::string mio::StationData::getHash ( ) const
inline

◆ getPosition()

Coords mio::StationData::getPosition ( ) const
inline

◆ getSlopeAngle()

double mio::StationData::getSlopeAngle ( ) const
inline

Get local slope angle.

Returns
angle of the local slope (in degrees, between 0 and 90 degrees)

◆ getStationID()

std::string mio::StationData::getStationID ( ) const
inline

◆ getStationName()

std::string mio::StationData::getStationName ( ) const
inline

◆ merge() [1/2]

void mio::StationData::merge ( const StationData sd2)

Simple merge strategy. If some fields of the current object are empty, they will be filled by the macthing field from the provided argument.

Parameters
[in]sd2extra StationData to merge, lowest priority

◆ merge() [2/2]

StationData mio::StationData::merge ( StationData  sd1,
const StationData sd2 
)
static

Simple merge strategy. If some fields of the first argument are empty, they will be filled by the matching field from the second argument.

Parameters
sd1first StationData to merge, highest priority
[in]sd2second StationData to merge, lowest priority
Returns
new StationData object

◆ operator!=()

bool mio::StationData::operator!= ( const StationData in) const

Operator that tests for inequality.

◆ operator==()

bool mio::StationData::operator== ( const StationData in) const

Equality operator check all parameters but the station name.

Returns
true or false

◆ setSlope()

void mio::StationData::setSlope ( const double &  in_slope_angle,
const double &  in_azimuth 
)

Slope information setter.

Parameters
in_slope_angleangle of the local slope (in degrees, between 0 and 90 degrees)
in_azimuthazimuth of the local slope expressed as a bearing (0 is North, in degrees, clockwise)

◆ setStationData()

void mio::StationData::setStationData ( const Coords i_position,
const std::string &  i_id = "",
const std::string &  i_name = "" 
)

General setter function.

Parameters
i_positionPosition of the station
i_idStation's id (short identification)
i_nameName of the station (default "")

◆ toString()

const std::string mio::StationData::toString ( ) const

◆ unique()

bool mio::StationData::unique ( std::vector< StationData > &  vecStation,
const bool &  position_only = false 
)
static

Remove duplicate stations from a vector.

Parameters
vecStationvector to purge from duplicate entries
[in]position_onlyonly consider the station location as criteria for equality (default: false)
Returns
true if some duplicates have been found

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const StationData station 
)
friend

◆ operator>>

std::istream & operator>> ( std::istream &  is,
StationData station 
)
friend

Member Data Documentation

◆ extra

std::map<std::string, std::string> mio::StationData::extra

Additional metadata, such as sensor types, etc. A better solution will be implemented at some point, so it WILL break.

◆ position

Coords mio::StationData::position

◆ stationID

std::string mio::StationData::stationID

ID of the Station, typically a short string.

◆ stationName

std::string mio::StationData::stationName

Name of the Station, detailed description.


The documentation for this class was generated from the following files: