VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
airportRunwayLoaderFromShp.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2019 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 
11 
12 #pragma once
13 
14 #include <vrfGuiCore/vrfGuiCore.h>
15 
16 #include <string>
17 #include <set>
18 #include <map>
19 
20 class OGRLayer;
21 class DtFilename;
22 class OGRSFDriver;
23 class OGRDataSource;
24 class OGRFeature;
25 
26 namespace makVrf
27 {
29  {
30  public:
33  ~DtAirportRecord();
34 
35  DtAirportRecord& operator=(const DtAirportRecord&);
36 
37  bool operator<(const DtAirportRecord&) const;
38  bool operator==(const DtAirportRecord&) const;
39 
40 
41  std::string myICAOName;
42  std::string myNormalName;
43  double myLat;
44  double myLon;
45  double myElev;
46  std::set<std::string> myRunways;
47 
48  };
49 
50  /*
51  The purpose of this class is to load the data that pertains to airports such as
52  the airports name, icao, location in geodetic and runways from the airport ESRI
53  shape files and provide a mechanism in which it can be easily queried.
54  */
56  {
57  public:
60 
62  static DtAirportRunwayLoaderFromShp* getInstance();
63 
65  std::set<std::string> getAirportIcaoNames();
66 
68  std::set<std::string> getRunwaysForAirport(const std::string & icaoName);
69 
71  bool getLatLonForAirport(double & lat, double & lon, double & elev, const std::string & icaoName);
72 
74  std::string getAirportName(const std::string & icaoName);
75 
77  std::set<std::string> getAirportNames();
78 
80  std::string getIcaoForAirportName(const std::string & airportName);
81 
83  const std::set < std::pair<std::string, std::string> > & getAirportandIcaoNames();
84  protected:
86  bool loadAirportRunwayData(const std::string & filename);
87 
89  bool loadAirportLocations(const std::string & filename);
90 
92  int processLayerForAirportLocations(OGRLayer * layer);
93 
95  int processLayerForRunways(OGRLayer * layer);
96 
98  bool parseFeatureForRunways(OGRFeature * feature);
99 
101  bool parseFeatureForAirportLocation(OGRFeature* feature);
102 
104  bool initializiae();
105 
108 
110 
113 
115  std::map<std::string, DtAirportRecord> myAirports;
116 
118  std::map<std::string, std::string> myNametoIcaoMap;
119 
121  std::set < std::pair<std::string, std::string> > myAirportNameAndIcaoSet;
122 
123  };
124 }
125 
std::map< std::string, DtAirportRecord > myAirports
stored airport icao (e.g. &quot;KBOS&quot;) to airport record
Definition: airportRunwayLoaderFromShp.h:115
Definition: airportRunwayLoaderFromShp.h:55
std::map< std::string, std::string > myNametoIcaoMap
airport name (e.g. &quot;Boston Logan Intn&#39;l (KBOS)&quot; ) to ICAO (e.g. &quot;KBOS&quot;)
Definition: airportRunwayLoaderFromShp.h:118
double myLat
Definition: airportRunwayLoaderFromShp.h:43
Definition: airportRunwayLoaderFromShp.h:28
DT_DLL_terrainCS bool operator==(const DtDegMinSec &lhs, const DtDegMinSec &rhs)
#define DT_DLL_VRFGUICORE
Contains DLL export macros.
Definition: vrfGuiCore.h:25
static DtAirportRunwayLoaderFromShp * myInstance
Definition: airportRunwayLoaderFromShp.h:109
bool myAirportLocationsAreInitialized
Definition: airportRunwayLoaderFromShp.h:112
std::string myNormalName
Definition: airportRunwayLoaderFromShp.h:42
std::set< std::pair< std::string, std::string > > myAirportNameAndIcaoSet
pairs of airport name (e.g. &quot;Boston Logan Intn&#39;l (KBOS)&quot; ) and ICAO (e.g. &quot;KBOS&quot;) ...
Definition: airportRunwayLoaderFromShp.h:121
double myLon
Definition: airportRunwayLoaderFromShp.h:44
double myElev
Definition: airportRunwayLoaderFromShp.h:45
bool myAirportRunwaysAreInitialized
Definition: airportRunwayLoaderFromShp.h:111
std::string myICAOName
Definition: airportRunwayLoaderFromShp.h:41
std::set< std::string > myRunways
Definition: airportRunwayLoaderFromShp.h:46

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)