VR-Forces 5.0.1 Developer's Guide
 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>
16 
17 #include <string>
18 #include <set>
19 #include <map>
20 
21 class OGRLayer;
22 class DtFilename;
23 class OGRSFDriver;
24 class OGRDataSource;
25 class OGRFeature;
26 
27 namespace makVrv
28 {
29  class DtDe;
30 }
31 
32 namespace makVrf
33 {
35  {
36  public:
39  ~DtAirportRecord();
40 
41  DtAirportRecord& operator=(const DtAirportRecord&);
42 
43  bool operator<(const DtAirportRecord&) const;
44  bool operator==(const DtAirportRecord&) const;
45 
46 
47  std::string myICAOName;
48  std::string myNormalName;
49  double myLat;
50  double myLon;
51  double myElev;
52  std::set<std::string> myRunways;
53 
54  };
55 
56  /*
57  The purpose of this class is to load the data that pertains to airports such as
58  the airports name, icao, location in geodetic and runways from the airport ESRI
59  shape files and provide a mechanism in which it can be easily queried.
60  */
62  {
63  public:
66 
68  static DtAirportRunwayLoaderFromShp* getInstance(makVrv::DtDe& de);
69 
71  std::set<std::string> getAirportIcaoNames();
72 
74  std::set<std::string> getRunwaysForAirport(const std::string & icaoName);
75 
77  bool getLatLonForAirport(double & lat, double & lon, double & elev, const std::string & icaoName);
78 
80  std::string getAirportName(const std::string & icaoName);
81 
83  std::set<std::string> getAirportNames();
84 
86  std::string getIcaoForAirportName(const std::string & airportName);
87 
89  const std::set < std::pair<std::string, std::string> > & getAirportandIcaoNames();
90  protected:
92  bool loadAirportRunwayData(const std::string & filename);
93 
95  bool loadAirportLocations(const std::string & filename);
96 
98  int processLayerForAirportLocations(OGRLayer * layer);
99 
101  int processLayerForRunways(OGRLayer * layer);
102 
104  bool parseFeatureForRunways(OGRFeature * feature);
105 
107  bool parseFeatureForAirportLocation(OGRFeature* feature);
108 
110  bool initialize();
111 
114 
116 
118 
121 
123  std::map<std::string, DtAirportRecord> myAirports;
124 
126  std::map<std::string, std::string> myNametoIcaoMap;
127 
129  std::set < std::pair<std::string, std::string> > myAirportNameAndIcaoSet;
130 
131  };
132 }
133 
std::map< std::string, DtAirportRecord > myAirports
stored airport icao (e.g. &quot;KBOS&quot;) to airport record
Definition: airportRunwayLoaderFromShp.h:123
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
Definition: airportRunwayLoaderFromShp.h:61
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:126
double myLat
Definition: airportRunwayLoaderFromShp.h:49
DT_DLL_VRFGUICORE bool operator==(const std::vector< makArchives::DtEnvironmentRecord::DtElevationalConfigurationRecord > &lhs, const std::vector< makArchives::DtEnvironmentRecord::DtElevationalConfigurationRecord > &rhs)
Definition: airportRunwayLoaderFromShp.h:34
#define DT_DLL_VRFGUICORE
Contains DLL export macros.
Definition: vrfGuiCore.h:25
static DtAirportRunwayLoaderFromShp * myInstance
Definition: airportRunwayLoaderFromShp.h:117
bool myAirportLocationsAreInitialized
Definition: airportRunwayLoaderFromShp.h:120
std::string myNormalName
Definition: airportRunwayLoaderFromShp.h:48
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:129
double myLon
Definition: airportRunwayLoaderFromShp.h:50
Contains makVrv::DtVirtualBaseClass class.
double myElev
Definition: airportRunwayLoaderFromShp.h:51
bool myAirportRunwaysAreInitialized
Definition: airportRunwayLoaderFromShp.h:119
makVrv::DtDe & myDe
Definition: airportRunwayLoaderFromShp.h:115
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:70
std::string myICAOName
Definition: airportRunwayLoaderFromShp.h:47
std::set< std::string > myRunways
Definition: airportRunwayLoaderFromShp.h:52

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)