1 // Class encapulating the metar station information
3 // METAR station information is kept in this file:
4 // http://www.nws.noaa.gov/pub/stninfo/nsd_cccc.gz
5 // http://www.nws.noaa.gov/pub/stninfo/nsd_cccc.txt
11 #include <simgear/compiler.h>
18 #include <simgear/math/point3d.hxx>
19 #include <simgear/math/polar3d.hxx>
25 class CMetarStationDB;
32 unsigned long m_number;
35 std::string m_country;
37 Point3D m_locationPolar;
38 Point3D m_upperLocationPolar;
39 Point3D m_locationCart;
40 Point3D m_upperLocationCart;
47 double decodeDMS( char *b );
61 std::string &ID() { return m_ID; }
62 unsigned long number() { return m_number; }
63 std::string &name() { return m_name; }
64 std::string &state() { return m_state; }
65 std::string &country() { return m_country; }
66 int region() { return m_region; }
67 unsigned int Altitude() { //Returns the stations height above MSL in M.
69 Point3D &locationPolar() { return m_locationPolar; }
70 Point3D &upperLocationPolar() { return m_upperLocationPolar; }
71 Point3D &locationCart() { return m_locationCart; }
72 Point3D &upperLocationCart() { return m_upperLocationCart; }
73 char pFlag() { return m_pFlag; }
76 friend ostream& operator << ( ostream&, const CMetarStation& );
84 const CMetarStation &rNewObj );
85 // Copy constructor. Not implemented.
87 CMetarStation &operator =(
88 const CMetarStation &rObj );
89 // Assignment operator. Not implemented.
91 friend class CMetarStationDB;
99 std::string databasePath; //The path of the database file.
100 std::map<std::string , CMetarStation *> METAR_Stations;
101 CMetarStation * bestStation;
104 CMetarStation *find( std::string stationID );
105 CMetarStation * find( Point3D locationCart );
106 CMetarStationDB(const char * dbFile);