OpenTREP Logo  0.07.4
C++ Open Travel Request Parsing Library
LocationExchange.cpp
Go to the documentation of this file.
1 // //////////////////////////////////////////////////////////////////////
2 // Import section
3 // //////////////////////////////////////////////////////////////////////
4 // STL
5 #include <cassert>
6 // STL
7 #include <ostream>
8 #include <string>
9 // OpenTrep Protobuf
10 #include <opentrep/Travel.pb.h>
11 // OpenTrep
12 #include <opentrep/Location.hpp>
13 #include <opentrep/CityDetails.hpp>
15 
16 namespace OPENTREP {
17 
18  // //////////////////////////////////////////////////////////////////////
20  exportLocationList (std::ostream& oStream,
21  const LocationList_T& iLocationList,
22  const WordList_T& iNonMatchedWordList) {
23  // Protobuf structure
24  treppb::QueryAnswer oQueryAnswer;
25 
26  // //// 1. Status ////
27  const bool kOKStatus = true;
28  oQueryAnswer.set_ok_status (kOKStatus);
29 
30  // //// 2. Error message ////
38  // //// 3. List of places ////
39  treppb::PlaceList* lPlaceListPtr = oQueryAnswer.mutable_place_list();
40  assert (lPlaceListPtr != NULL);
41 
42  // Browse the list of Location structures, and fill the Protobuf structure
43  for (LocationList_T::const_iterator itLocation = iLocationList.begin();
44  itLocation != iLocationList.end(); ++itLocation) {
45  const Location& lLocation = *itLocation;
46 
47  // Create an instance of a Protobuf Place structure
48  treppb::Place* lPlacePtr = lPlaceListPtr->add_place();
49  assert (lPlacePtr != NULL);
50 
51  // Fill the Protobuf Place structure with the content of
52  // the Location structure
53  exportLocation (*lPlacePtr, lLocation);
54  }
55 
56  // //// 4. List of un-matched keywords ////
57  // Create an instance of a Protobuf UnknownKeywordList structure
58  treppb::UnknownKeywordList* lUnknownKeywordListPtr =
59  oQueryAnswer.mutable_unmatched_keyword_list();
60  assert (lUnknownKeywordListPtr != NULL);
61 
62  // Browse the list of un-matched keywords, and fill the Protobuf structure
63  for (WordList_T::const_iterator itWord = iNonMatchedWordList.begin();
64  itWord != iNonMatchedWordList.end(); ++itWord) {
65  const Word_T& lWord = *itWord;
66  lUnknownKeywordListPtr->add_word (lWord);
67  }
68 
69  // Serialise the Protobuf
70  oQueryAnswer.SerializeToOstream (&oStream);
71  }
72 
73  // //////////////////////////////////////////////////////////////////////
74  void LocationExchange::exportLocation (treppb::Place& ioPlace,
75  const Location& iLocation) {
76  // Retrieve the primary key
77  const LocationKey& lLocationKey = iLocation.getKey();
78 
79  // Retrieve and set the travel-related IATA code (part of the primary key)
80  const IATACode_T& lIataCode = lLocationKey.getIataCode();
81  treppb::IATACode* lIataAirportPtr = ioPlace.mutable_tvl_code();
82  assert (lIataAirportPtr != NULL);
83  lIataAirportPtr->set_code (lIataCode);
84 
85  // Retrieve and set the location type
86  const IATAType& lLocationType = lLocationKey.getIataType();
87  const treppb::PlaceType& lPlaceType = lLocationType.getTypeAsPB();
88  const treppb::PlaceType_LocationType& lPlaceTypeEnum = lPlaceType.type();
89  treppb::PlaceType* lPlaceTypePtr = ioPlace.mutable_loc_type();
90  assert (lPlaceTypePtr != NULL);
91  lPlaceTypePtr->set_type (lPlaceTypeEnum);
92 
93  // Retrieve and set the Geonames ID
94  const GeonamesID_T& lGeonamesID = lLocationKey.getGeonamesID();
95  treppb::GeonamesID* lGeonamesIDPtr = ioPlace.mutable_geonames_id();
96  assert (lGeonamesIDPtr != NULL);
97  lGeonamesIDPtr->set_id (lGeonamesID);
98 
99  // Retrieve and set the ICAO code
100  const ICAOCode_T& lIcaoCode = iLocation.getIcaoCode();
101  treppb::ICAOCode* lIcaoCodePtr = ioPlace.mutable_icao_code();
102  assert (lIcaoCodePtr != NULL);
103  lIcaoCodePtr->set_code (lIcaoCode);
104 
105  // Retrieve and set the FAA code
106  const FAACode_T& lFaaCode = iLocation.getFaaCode();
107  treppb::FAACode* lFaaCodePtr = ioPlace.mutable_faa_code();
108  assert (lFaaCodePtr != NULL);
109  lFaaCodePtr->set_code (lFaaCode);
110 
111  // Retrieve and set the UN/LOCODE code list
112  const UNLOCodeList_T& lUNLOCodeList = iLocation.getUNLOCodeList();
113  treppb::UNLOCodeList* lUNLOCodeListPtr = ioPlace.mutable_unlocode_list();
114  assert (lUNLOCodeListPtr != NULL);
115  //
116  for (UNLOCodeList_T::const_iterator itUNLOCode = lUNLOCodeList.begin();
117  itUNLOCode != lUNLOCodeList.end(); ++itUNLOCode) {
118  const UNLOCode_T& lUNLOCode = *itUNLOCode;
119  treppb::UNLOCode* lUNLOCodePtr = lUNLOCodeListPtr->add_unlocode();
120  assert (lUNLOCodePtr != NULL);
121  lUNLOCodePtr->set_code (lUNLOCode);
122  }
123 
124  // Retrieve and set the names
125  const CommonName_T& lUtfName = iLocation.getCommonName();
126  ioPlace.set_name_utf (lUtfName);
127  const ASCIIName_T& lAsciiName = iLocation.getAsciiName();
128  ioPlace.set_name_ascii (lAsciiName);
129 
130  // Retrieve and set the feature class and code
131  const FeatureClass_T& lFeatClass = iLocation.getFeatureClass();
132  const FeatureCode_T& lFeatCode = iLocation.getFeatureCode();
133  treppb::FeatureType* lFeatTypePtr = ioPlace.mutable_feat_type();
134  assert (lFeatTypePtr != NULL);
135  treppb::FeatureClass* lFeatClassPtr = lFeatTypePtr->mutable_fclass();
136  assert (lFeatClassPtr != NULL);
137  treppb::FeatureCode* lFeatCodePtr = lFeatTypePtr->mutable_fcode();
138  assert (lFeatCodePtr != NULL);
139  lFeatClassPtr->set_code (lFeatClass);
140  lFeatCodePtr->set_code (lFeatCode);
141 
142  // Retrieve and set the geographical coordinates
143  const Latitude_T& lLatitude = iLocation.getLatitude();
144  const Longitude_T& lLongitude = iLocation.getLongitude();
145  treppb::GeoPoint* lPointPtr = ioPlace.mutable_coord();
146  assert (lPointPtr != NULL);
147  lPointPtr->set_latitude (lLatitude);
148  lPointPtr->set_longitude (lLongitude);
149 
150  // Retrieve and set the list of served city details
151  const CityDetailsList_T& lCityList = iLocation.getCityList();
152  treppb::CityList* lCityListPtr = ioPlace.mutable_city_list();
153  assert (lCityListPtr != NULL);
154  //
155  for (CityDetailsList_T::const_iterator itCity = lCityList.begin();
156  itCity != lCityList.end(); ++itCity) {
157  const CityDetails& lCity = *itCity;
158  treppb::City* lCityPtr = lCityListPtr->add_city();
159  assert (lCityPtr != NULL);
160 
161  // IATA code of the served city
162  const IATACode_T& lIataCode = lCity.getIataCode();
163  treppb::IATACode* lIataCodePtr = lCityPtr->mutable_code();
164  assert (lIataCodePtr != NULL);
165  lIataCodePtr->set_code (lIataCode);
166 
167  // Geonames ID of the served city
168  const GeonamesID_T& lGeonamesID = lCity.getGeonamesID();
169  treppb::GeonamesID* lGeonamesIDPtr = lCityPtr->mutable_geonames_id();
170  assert (lGeonamesIDPtr != NULL);
171  lGeonamesIDPtr->set_id (lGeonamesID);
172 
173  // City UTF8 name
174  const CityUTFName_T& lCityUtfName = lCity.getUtfName();
175  lCityPtr->set_name_utf (lCityUtfName);
176 
177  // City ASCII name
178  const CityASCIIName_T& lCityAsciiName = lCity.getAsciiName();
179  lCityPtr->set_name_ascii (lCityAsciiName);
180  }
181 
182  // Retrieve and set the state code
183  const StateCode_T& lStateCode = iLocation.getStateCode();
184  treppb::StateCode* lStateCodePtr = ioPlace.mutable_state_code();
185  assert (lStateCodePtr != NULL);
186  lStateCodePtr->set_code (lStateCode);
187 
188  // Retrieve and set the country code
189  const CountryCode_T& lCountryCode = iLocation.getCountryCode();
190  treppb::CountryCode* lCountryCodePtr = ioPlace.mutable_country_code();
191  assert (lCountryCodePtr != NULL);
192  lCountryCodePtr->set_code (lCountryCode);
193 
194  // Retrieve and set the alternative country code
195  const AltCountryCode_T& lAltCountryCode = iLocation.getAltCountryCode();
196  treppb::AltCountryCode* lAltCountryCodePtr =
197  ioPlace.mutable_alt_country_code();
198  assert (lAltCountryCodePtr != NULL);
199  lAltCountryCodePtr->set_code (lAltCountryCode);
200 
201  // Retrieve and set the country name
202  const CountryName_T& lCountryName = iLocation.getCountryName();
203  ioPlace.set_country_name (lCountryName);
204 
205  // Retrieve and set the US DOT World Area Code (WAC)
206  const WAC_T& lWAC = iLocation.getWAC();
207  treppb::WorldAreaCode* lWorldAreaCodePtr = ioPlace.mutable_wac_code();
208  assert (lWorldAreaCodePtr != NULL);
209  lWorldAreaCodePtr->set_code (lWAC);
210 
211  // Retrieve and set the US DOT World Area Code (WAC) name
212  const WACName_T& lWACName = iLocation.getWACName();
213  ioPlace.set_wac_name (lWACName);
214 
215  // Retrieve and set the currency code
216  const CurrencyCode_T& lCurrencyCode = iLocation.getCurrencyCode();
217  treppb::CurrencyCode* lCurrencyCodePtr = ioPlace.mutable_currency_code();
218  assert (lCurrencyCodePtr != NULL);
219  lCurrencyCodePtr->set_code (lCurrencyCode);
220 
221  // Retrieve and set the continent code
222  const ContinentCode_T& lContinentCode = iLocation.getContinentCode();
223  treppb::ContinentCode* lContinentCodePtr = ioPlace.mutable_continent_code();
224  assert (lContinentCodePtr != NULL);
225  lContinentCodePtr->set_code (lContinentCode);
226 
227  // Retrieve and set the continent name
228  const ContinentName_T& lContinentName = iLocation.getContinentName();
229  ioPlace.set_continent_name (lContinentName);
230 
231  // Retrieve and set the admin level 1 code
232  const Admin1Code_T& lAdm1Code = iLocation.getAdmin1Code();
233  treppb::Admin1Code* lAdm1CodePtr = ioPlace.mutable_adm1_code();
234  assert (lAdm1CodePtr != NULL);
235  lAdm1CodePtr->set_code (lAdm1Code);
236 
237  // Retrieve and set the admin level 1 names
238  const Admin1UTFName_T& lAdm1UtfName = iLocation.getAdmin1UtfName();
239  ioPlace.set_adm1_name_utf (lAdm1UtfName);
240  const Admin1ASCIIName_T& lAdm1AsciiName = iLocation.getAdmin1AsciiName();
241  ioPlace.set_adm1_name_ascii (lAdm1AsciiName);
242 
243  // Retrieve and set the admin level 2 code
244  const Admin2Code_T& lAdm2Code = iLocation.getAdmin2Code();
245  treppb::Admin2Code* lAdm2CodePtr = ioPlace.mutable_adm2_code();
246  assert (lAdm2CodePtr != NULL);
247  lAdm2CodePtr->set_code (lAdm2Code);
248 
249  // Retrieve and set the admin level 2 names
250  const Admin2UTFName_T& lAdm2UtfName = iLocation.getAdmin2UtfName();
251  ioPlace.set_adm2_name_utf (lAdm2UtfName);
252  const Admin2ASCIIName_T& lAdm2AsciiName = iLocation.getAdmin2AsciiName();
253  ioPlace.set_adm2_name_ascii (lAdm2AsciiName);
254 
255  // Retrieve and set the admin level 3 code
256  const Admin3Code_T& lAdm3Code = iLocation.getAdmin3Code();
257  treppb::Admin3Code* lAdm3CodePtr = ioPlace.mutable_adm3_code();
258  assert (lAdm3CodePtr != NULL);
259  lAdm3CodePtr->set_code (lAdm3Code);
260 
261  // Retrieve and set the admin level 4 code
262  const Admin4Code_T& lAdm4Code = iLocation.getAdmin4Code();
263  treppb::Admin4Code* lAdm4CodePtr = ioPlace.mutable_adm4_code();
264  assert (lAdm4CodePtr != NULL);
265  lAdm4CodePtr->set_code (lAdm4Code);
266 
267  // Retrieve and set the population
268  const Population_T& lPopulation = iLocation.getPopulation();
269  treppb::Population* lPopulationPtr = ioPlace.mutable_population();
270  assert (lPopulationPtr != NULL);
271  lPopulationPtr->set_value (lPopulation);
272 
273  // Retrieve and set the elevation
274  const Elevation_T& lElevation = iLocation.getElevation();
275  treppb::Elevation* lElevationPtr = ioPlace.mutable_elevation();
276  assert (lElevationPtr != NULL);
277  lElevationPtr->set_value (lElevation);
278 
279  // Retrieve and set the geo topology 30
280  const GTopo30_T& lGTopo30 = iLocation.getGTopo30();
281  treppb::GTopo30* lGTopo30Ptr = ioPlace.mutable_gtopo30();
282  assert (lGTopo30Ptr != NULL);
283  lGTopo30Ptr->set_value (lGTopo30);
284 
285  // Retrieve and set the PageRank value
286  const PageRank_T& lPageRank = iLocation.getPageRank();
287  treppb::PageRank* lPageRankPtr = ioPlace.mutable_page_rank();
288  assert (lPageRankPtr != NULL);
289  lPageRankPtr->set_rank (lPageRank);
290 
291  // Retrieve and set the time-zone
292  const TimeZone_T& lTimeZone = iLocation.getTimeZone();
293  treppb::TimeZone* lTimeZonePtr = ioPlace.mutable_tz();
294  assert (lTimeZonePtr != NULL);
295  lTimeZonePtr->set_tz (lTimeZone);
296 
297  // Retrieve and set the GMT offset
298  const GMTOffset_T& lGMTOffset = iLocation.getGMTOffset();
299  treppb::TZOffSet* lGMTOffsetPtr = ioPlace.mutable_gmt_offset();
300  assert (lGMTOffsetPtr != NULL);
301  lGMTOffsetPtr->set_offset (lGMTOffset);
302 
303  // Retrieve and set the DST offset
304  const DSTOffset_T& lDSTOffset = iLocation.getDSTOffset();
305  treppb::TZOffSet* lDSTOffsetPtr = ioPlace.mutable_dst_offset();
306  assert (lDSTOffsetPtr != NULL);
307  lDSTOffsetPtr->set_offset (lDSTOffset);
308 
309  // Retrieve and set the RAW offset
310  const RawOffset_T& lRAWOffset = iLocation.getRawOffset();
311  treppb::TZOffSet* lRAWOffsetPtr = ioPlace.mutable_raw_offset();
312  assert (lRAWOffsetPtr != NULL);
313  lRAWOffsetPtr->set_offset (lRAWOffset);
314 
315  // Retrieve and set the modification date (within Geonames)
316  const Date_T& lGeonameModDate = iLocation.getModificationDate();
317  treppb::Date* lGeonameModDatePtr = ioPlace.mutable_mod_date();
318  assert (lGeonameModDatePtr != NULL);
319  lGeonameModDatePtr->set_date (boost::gregorian::to_iso_extended_string(lGeonameModDate));
320 
321  // Retrieve and set the list of the travel-related POR IATA codes
322  const TvlPORListString_T& lTvlPORList = iLocation.getTvlPORListString();
323  treppb::TravelRelatedList* lTvlPORListPtr = ioPlace.mutable_tvl_por_list();
324  assert (lTvlPORListPtr != NULL);
325  lTvlPORListPtr->add_tvl_code (lTvlPORList);
326 
327  // Retrieve and set the list of the Wikipedia links (URLs)
328  const WikiLink_T& lWikiLink = iLocation.getWikiLink();
329  treppb::WikiLinkList* lWikiLinkListPtr = ioPlace.mutable_link_list();
330  assert (lWikiLinkListPtr != NULL);
331  treppb::WikiLink* lWikiLinkPtr = lWikiLinkListPtr->add_link();
332  assert (lWikiLinkPtr != NULL);
333  treppb::LanguageCode* lLangCodePtr = lWikiLinkPtr->mutable_lang();
334  assert (lLangCodePtr != NULL);
335  lLangCodePtr->set_code ("en");
336  lWikiLinkPtr->set_link (lWikiLink);
337 
338  // Retrieve and set the beginning date of the validity period
339  const Date_T& lDateFrom = iLocation.getDateFrom();
340  treppb::Date* lDateFromPtr = ioPlace.mutable_date_from();
341  assert (lDateFromPtr != NULL);
342  lDateFromPtr->set_date (boost::gregorian::to_iso_extended_string(lDateFrom));
343 
344  // Retrieve and set the end date of the validity period
345  const Date_T& lDateEnd = iLocation.getDateEnd();
346  treppb::Date* lDateEndPtr = ioPlace.mutable_date_end();
347  assert (lDateEndPtr != NULL);
348  lDateEndPtr->set_date (boost::gregorian::to_iso_extended_string(lDateEnd));
349 
350  // Retrieve and set the commentaries
351  const Comment_T& lComment = iLocation.getComment();
352  treppb::Comment* lCommentPtr = ioPlace.mutable_comment();
353  assert (lCommentPtr != NULL);
354  lCommentPtr->set_text (lComment);
355 
356  // Retrieve and set the list of alternate names
357  const NameMatrix& lNameMatrixRef = iLocation.getNameMatrix();
358  treppb::AltNameList* lAltNameListPtr = ioPlace.mutable_alt_name_list();
359  assert (lAltNameListPtr != NULL);
360  //
361  const NameMatrix_T lNameMatrix = lNameMatrixRef.getNameMatrix();
362  for (NameMatrix_T::const_iterator itNameList = lNameMatrix.begin();
363  itNameList != lNameMatrix.end(); ++itNameList) {
364  const Names& lNameListRef = itNameList->second;
365  const LanguageCode_T& lLangCode = lNameListRef.getLanguageCode();
366  const NameList_T& lNameList = lNameListRef.getNameList();
367  for (NameList_T::const_iterator itName = lNameList.begin();
368  itName != lNameList.end(); ++itName) {
369  const std::string& lName = *itName;
370  //
371  treppb::AltName* lAltNamePtr = lAltNameListPtr->add_name();
372  assert (lAltNamePtr != NULL);
373  //
374  treppb::LanguageCode* lLangCodePtr = lAltNamePtr->mutable_lang();
375  assert (lLangCodePtr != NULL);
376  lLangCodePtr->set_code (lLangCode);
377  lAltNamePtr->set_name (lName);
378  }
379  }
380 
381  // Retrieve and set the matching percentage value
382  const MatchingPercentage_T& lPercentage = iLocation.getPercentage();
383  treppb::MatchingPercentage* lPercentagePtr =
384  ioPlace.mutable_matching_percentage();
385  assert (lPercentagePtr != NULL);
386  lPercentagePtr->set_percentage (lPercentage);
387 
388  // Retrieve and set the list of the original keywords
393  const std::string& lOriginalKeywords = iLocation.getOriginalKeywords();
394  treppb::KeywordList* lOriginalKeywordListPtr =
395  ioPlace.mutable_original_keyword_list();
396  assert (lOriginalKeywordListPtr != NULL);
397  lOriginalKeywordListPtr->add_word (lOriginalKeywords);
398 
399  // Retrieve and set the list of the corrected keywords
404  const std::string& lCorrectedKeywords = iLocation.getCorrectedKeywords();
405  treppb::KeywordList* lCorrectedKeywordListPtr =
406  ioPlace.mutable_corrected_keyword_list();
407  assert (lCorrectedKeywordListPtr != NULL);
408  lCorrectedKeywordListPtr->add_word (lCorrectedKeywords);
409 
410  // Retrieve and set the actual edit distance
411  const NbOfErrors_T& lEditDistanceActual = iLocation.getEditDistance();
412  treppb::EditDistance* lEditDistanceActualPtr =
413  ioPlace.mutable_edit_distance_actual();
414  assert (lEditDistanceActualPtr != NULL);
415  lEditDistanceActualPtr->set_dist (lEditDistanceActual);
416 
417  // Retrieve and set the allowable edit distance
418  const NbOfErrors_T& lEditDistanceAllowable =
419  iLocation.getAllowableEditDistance();
420  treppb::EditDistance* lEditDistanceAllowablePtr =
421  ioPlace.mutable_edit_distance_actual();
422  assert (lEditDistanceAllowablePtr != NULL);
423  lEditDistanceAllowablePtr->set_dist (lEditDistanceAllowable);
424 
425  // Iterate on the extra list of locations
426  const LocationList_T& lExtraLocationList = iLocation.getExtraLocationList();
427  treppb::PlaceList* lExtraPlaceListPtr = ioPlace.mutable_extra_place_list();
428  assert (lExtraPlaceListPtr != NULL);
429  for (LocationList_T::const_iterator itLoc = lExtraLocationList.begin();
430  itLoc != lExtraLocationList.end(); ++itLoc) {
431  const Location& lExtraLocation = *itLoc;
432  //
433  treppb::Place* lPlacePtr = lExtraPlaceListPtr->add_place();
434  assert (lPlacePtr != NULL);
435  //
436  exportLocation (*lPlacePtr, lExtraLocation);
437  }
438 
439  // Iterate on the alternative list of locations
440  const LocationList_T& lAltLocationList= iLocation.getAlternateLocationList();
441  treppb::PlaceList* lAltPlaceListPtr = ioPlace.mutable_alt_place_list();
442  assert (lAltPlaceListPtr != NULL);
443  for (LocationList_T::const_iterator itLoc = lAltLocationList.begin();
444  itLoc != lAltLocationList.end(); ++itLoc) {
445  const Location& lAlternateLocation = *itLoc;
446  //
447  treppb::Place* lPlacePtr = lAltPlaceListPtr->add_place();
448  assert (lPlacePtr != NULL);
449  //
450  exportLocation (*lPlacePtr, lAlternateLocation);
451  }
452  }
453 
454 }
455 
OPENTREP::Elevation_T
int Elevation_T
Definition: OPENTREP_Types.hpp:593
OPENTREP::Location::getAdmin2AsciiName
const Admin2ASCIIName_T & getAdmin2AsciiName() const
Definition: Location.hpp:312
OPENTREP::Location::getUNLOCodeList
const UNLOCodeList_T & getUNLOCodeList() const
Definition: Location.hpp:80
OPENTREP::Location::getWACName
const WACName_T & getWACName() const
Definition: Location.hpp:193
OPENTREP::WAC_T
unsigned int WAC_T
Definition: OPENTREP_Types.hpp:403
OPENTREP::Latitude_T
GeoCoord_T Latitude_T
Definition: OPENTREP_Types.hpp:563
OPENTREP::Location::getComment
const Comment_T & getComment() const
Definition: Location.hpp:144
OPENTREP::Location::getElevation
const Elevation_T & getElevation() const
Definition: Location.hpp:340
OPENTREP::LocationKey::getGeonamesID
const GeonamesID_T & getGeonamesID() const
Definition: LocationKey.hpp:49
OPENTREP::Location::getCountryName
const CountryName_T & getCountryName() const
Definition: Location.hpp:179
OPENTREP::NameMatrix::getNameMatrix
const NameMatrix_T & getNameMatrix() const
Definition: NameMatrix.hpp:44
OPENTREP::Location::getModificationDate
const Date_T & getModificationDate() const
Definition: Location.hpp:361
OPENTREP::CityUTFName_T
Definition: OPENTREP_Types.hpp:327
OPENTREP::Location::getFeatureClass
const FeatureClass_T & getFeatureClass() const
Definition: Location.hpp:263
OPENTREP::MatchingPercentage_T
double MatchingPercentage_T
Definition: OPENTREP_Types.hpp:665
OPENTREP::Location::getCurrencyCode
const CurrencyCode_T & getCurrencyCode() const
Definition: Location.hpp:200
OPENTREP::LocationKey::getIataCode
const IATACode_T & getIataCode() const
Definition: LocationKey.hpp:35
OPENTREP::Admin1ASCIIName_T
Definition: OPENTREP_Types.hpp:469
OPENTREP::CityDetails::getAsciiName
const CityASCIIName_T & getAsciiName() const
Definition: CityDetails.hpp:56
OPENTREP::Location::getAdmin4Code
const Admin4Code_T & getAdmin4Code() const
Definition: Location.hpp:326
OPENTREP::WordList_T
std::list< Word_T > WordList_T
Definition: OPENTREP_Types.hpp:690
OPENTREP::Location::getAllowableEditDistance
const NbOfErrors_T & getAllowableEditDistance() const
Definition: Location.hpp:425
OPENTREP::CityDetails::getUtfName
const CityUTFName_T & getUtfName() const
Definition: CityDetails.hpp:48
OPENTREP::GMTOffset_T
float GMTOffset_T
Definition: OPENTREP_Types.hpp:613
OPENTREP::Location::getPopulation
const Population_T & getPopulation() const
Definition: Location.hpp:333
OPENTREP::CountryCode_T
Definition: OPENTREP_Types.hpp:368
OPENTREP::Comment_T
Definition: OPENTREP_Types.hpp:309
OPENTREP::RawOffset_T
float RawOffset_T
Definition: OPENTREP_Types.hpp:623
OPENTREP::Population_T
unsigned int Population_T
Definition: OPENTREP_Types.hpp:586
OPENTREP::Admin3Code_T
Definition: OPENTREP_Types.hpp:512
OPENTREP::UNLOCode_T
Definition: OPENTREP_Types.hpp:225
OPENTREP::Location::getAdmin2Code
const Admin2Code_T & getAdmin2Code() const
Definition: Location.hpp:298
OPENTREP::ICAOCode_T
Definition: OPENTREP_Types.hpp:170
OPENTREP::IATACode_T
Definition: OPENTREP_Types.hpp:154
OPENTREP::Location::getIcaoCode
const ICAOCode_T & getIcaoCode() const
Definition: Location.hpp:66
CityDetails.hpp
OPENTREP::Location::getLongitude
const Longitude_T & getLongitude() const
Definition: Location.hpp:256
OPENTREP::UNLOCodeList_T
std::list< UNLOCode_T > UNLOCodeList_T
Definition: OPENTREP_Types.hpp:229
OPENTREP::Location::getCommonName
const CommonName_T & getCommonName() const
Definition: Location.hpp:95
OPENTREP::Admin1Code_T
Definition: OPENTREP_Types.hpp:448
OPENTREP::Location::getExtraLocationList
const LocationList_T & getExtraLocationList() const
Definition: Location.hpp:432
OPENTREP::Admin2UTFName_T
Definition: OPENTREP_Types.hpp:490
OPENTREP::Admin2ASCIIName_T
Definition: OPENTREP_Types.hpp:501
OPENTREP::Admin4Code_T
Definition: OPENTREP_Types.hpp:522
OPENTREP::Location::getAsciiName
const ASCIIName_T & getAsciiName() const
Definition: Location.hpp:102
OPENTREP::PageRank_T
double PageRank_T
Definition: OPENTREP_Types.hpp:630
OPENTREP::Location
Structure modelling a (geographical) location.
Definition: Location.hpp:25
OPENTREP::Location::getLatitude
const Latitude_T & getLatitude() const
Definition: Location.hpp:249
OPENTREP::LocationList_T
std::list< Location > LocationList_T
Definition: LocationList.hpp:13
OPENTREP::Word_T
std::string Word_T
Definition: OPENTREP_Types.hpp:685
OPENTREP::FeatureClass_T
Definition: OPENTREP_Types.hpp:532
OPENTREP::Location::getAdmin3Code
const Admin3Code_T & getAdmin3Code() const
Definition: Location.hpp:319
OPENTREP::Location::getEditDistance
const NbOfErrors_T & getEditDistance() const
Definition: Location.hpp:417
OPENTREP::Location::getAltCountryCode
const AltCountryCode_T & getAltCountryCode() const
Definition: Location.hpp:172
OPENTREP::Location::getAdmin1UtfName
const Admin1UTFName_T & getAdmin1UtfName() const
Definition: Location.hpp:284
OPENTREP
Definition: BasChronometer.cpp:10
OPENTREP::LocationExchange::exportLocationList
static void exportLocationList(std::ostream &, const LocationList_T &, const WordList_T &iNonMatchedWordList)
Definition: LocationExchange.cpp:20
OPENTREP::Location::getDSTOffset
const DSTOffset_T & getDSTOffset() const
Definition: Location.hpp:235
OPENTREP::Date_T
boost::gregorian::date Date_T
Definition: OPENTREP_Types.hpp:579
OPENTREP::Location::getCountryCode
const CountryCode_T & getCountryCode() const
Definition: Location.hpp:165
OPENTREP::Location::getKey
const LocationKey & getKey() const
Definition: Location.hpp:31
OPENTREP::Longitude_T
GeoCoord_T Longitude_T
Definition: OPENTREP_Types.hpp:564
OPENTREP::CityDetails::getIataCode
const IATACode_T & getIataCode() const
Definition: CityDetails.hpp:34
OPENTREP::Location::getStateCode
const StateCode_T & getStateCode() const
Definition: Location.hpp:158
OPENTREP::Location::getOriginalKeywords
const std::string & getOriginalKeywords() const
Definition: Location.hpp:396
OPENTREP::Location::getAdmin1Code
const Admin1Code_T & getAdmin1Code() const
Definition: Location.hpp:277
Location.hpp
OPENTREP::NameList_T
std::list< std::string > NameList_T
Definition: Names.hpp:20
OPENTREP::LocationExchange::exportLocation
static void exportLocation(treppb::Place &, const Location &)
Definition: LocationExchange.cpp:74
OPENTREP::FeatureCode_T
Definition: OPENTREP_Types.hpp:543
OPENTREP::Location::getRawOffset
const RawOffset_T & getRawOffset() const
Definition: Location.hpp:242
OPENTREP::TimeZone_T
Definition: OPENTREP_Types.hpp:605
OPENTREP::LanguageCode_T
Definition: OPENTREP_Types.hpp:300
OPENTREP::Location::getPercentage
const MatchingPercentage_T & getPercentage() const
Definition: Location.hpp:410
OPENTREP::AltCountryCode_T
Definition: OPENTREP_Types.hpp:380
OPENTREP::IATAType::getTypeAsPB
treppb::PlaceType getTypeAsPB() const
Definition: IATAType.cpp:181
OPENTREP::GTopo30_T
int GTopo30_T
Definition: OPENTREP_Types.hpp:600
OPENTREP::Names::getNameList
const NameList_T & getNameList() const
Definition: Names.hpp:60
OPENTREP::Location::getPageRank
const PageRank_T & getPageRank() const
Definition: Location.hpp:354
OPENTREP::DSTOffset_T
float DSTOffset_T
Definition: OPENTREP_Types.hpp:618
OPENTREP::Admin2Code_T
Definition: OPENTREP_Types.hpp:480
OPENTREP::Location::getFeatureCode
const FeatureCode_T & getFeatureCode() const
Definition: Location.hpp:270
OPENTREP::Location::getTimeZone
const TimeZone_T & getTimeZone() const
Definition: Location.hpp:221
OPENTREP::CityDetailsList_T
std::list< CityDetails > CityDetailsList_T
A list of cities, for instance the list of cities served by a travel-related POR (point of reference)...
Definition: CityDetailsList.hpp:13
OPENTREP::Location::getGTopo30
const GTopo30_T & getGTopo30() const
Definition: Location.hpp:347
OPENTREP::LocationKey
Class modelling the primary key of a location/POR (point of reference).
Definition: LocationKey.hpp:29
OPENTREP::Location::getCorrectedKeywords
const std::string & getCorrectedKeywords() const
Definition: Location.hpp:403
OPENTREP::Location::getFaaCode
const FAACode_T & getFaaCode() const
Definition: Location.hpp:73
OPENTREP::NbOfErrors_T
unsigned short NbOfErrors_T
Definition: OPENTREP_Types.hpp:720
OPENTREP::Location::getTvlPORListString
const TvlPORListString_T & getTvlPORListString() const
Definition: Location.hpp:116
OPENTREP::Location::getDateEnd
const Date_T & getDateEnd() const
Definition: Location.hpp:137
OPENTREP::Names::getLanguageCode
LanguageCode_T getLanguageCode() const
Definition: Names.hpp:53
OPENTREP::Location::getCityList
const CityDetailsList_T & getCityList() const
Definition: Location.hpp:151
OPENTREP::WACName_T
Definition: OPENTREP_Types.hpp:410
OPENTREP::Location::getContinentCode
const ContinentCode_T & getContinentCode() const
Definition: Location.hpp:207
OPENTREP::Location::getGMTOffset
const GMTOffset_T & getGMTOffset() const
Definition: Location.hpp:228
OPENTREP::ContinentCode_T
Definition: OPENTREP_Types.hpp:428
OPENTREP::TvlPORListString_T
Definition: OPENTREP_Types.hpp:289
OPENTREP::CityASCIIName_T
Definition: OPENTREP_Types.hpp:336
OPENTREP::CountryName_T
Definition: OPENTREP_Types.hpp:391
OPENTREP::Location::getContinentName
const ContinentName_T & getContinentName() const
Definition: Location.hpp:214
OPENTREP::ASCIIName_T
Definition: OPENTREP_Types.hpp:266
OPENTREP::StateCode_T
Definition: OPENTREP_Types.hpp:358
OPENTREP::Names
Definition: Names.hpp:26
OPENTREP::IATAType
Enumeration of place/location types with respect to their use for transportation purposes.
Definition: IATAType.hpp:42
OPENTREP::Location::getAlternateLocationList
const LocationList_T & getAlternateLocationList() const
Definition: Location.hpp:439
OPENTREP::Location::getNameMatrix
const NameMatrix & getNameMatrix() const
Definition: Location.hpp:375
OPENTREP::NameMatrix
Definition: NameMatrix.hpp:22
OPENTREP::Location::getDateFrom
const Date_T & getDateFrom() const
Definition: Location.hpp:130
OPENTREP::CommonName_T
Definition: OPENTREP_Types.hpp:257
LocationExchange.hpp
OPENTREP::ContinentName_T
Definition: OPENTREP_Types.hpp:437
OPENTREP::LocationKey::getIataType
const IATAType & getIataType() const
Definition: LocationKey.hpp:42
OPENTREP::NameMatrix_T
std::map< LanguageCode_T, Names > NameMatrix_T
Definition: Names.hpp:149
OPENTREP::Admin1UTFName_T
Definition: OPENTREP_Types.hpp:458
OPENTREP::CityDetails::getGeonamesID
const GeonamesID_T & getGeonamesID() const
Definition: CityDetails.hpp:41
OPENTREP::Location::getWikiLink
const WikiLink_T & getWikiLink() const
Definition: Location.hpp:368
OPENTREP::GeonamesID_T
unsigned int GeonamesID_T
Definition: OPENTREP_Types.hpp:182
OPENTREP::CurrencyCode_T
Definition: OPENTREP_Types.hpp:420
OPENTREP::Location::getWAC
const WAC_T & getWAC() const
Definition: Location.hpp:186
OPENTREP::Location::getAdmin1AsciiName
const Admin1ASCIIName_T & getAdmin1AsciiName() const
Definition: Location.hpp:291
OPENTREP::Location::getAdmin2UtfName
const Admin2UTFName_T & getAdmin2UtfName() const
Definition: Location.hpp:305
OPENTREP::FAACode_T
Definition: OPENTREP_Types.hpp:199
OPENTREP::CityDetails
Class modelling the elementary details of a city.
Definition: CityDetails.hpp:28