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