OpenTREP Logo  0.6.0
C++ Open Travel Request Parsing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Location.cpp
Go to the documentation of this file.
1 // //////////////////////////////////////////////////////////////////////
2 // Import section
3 // //////////////////////////////////////////////////////////////////////
4 // STL
5 #include <sstream>
6 #include <string>
7 #include <list>
8 // OpenTrep
10 #include <opentrep/IATAType.hpp>
11 #include <opentrep/Location.hpp>
12 
13 namespace OPENTREP {
14 
15  // //////////////////////////////////////////////////////////////////////
17  _key (IATACode_T (""), IATAType::LAST_VALUE, 0),
18  _icaoCode (ICAOCode_T ("")), _faaCode (FAACode_T ("")),
19  _commonName (CommonName_T ("NotAvailable")),
20  _asciiName (ASCIIName_T ("NotAvailable")),
21  _altNameShortListString (AltNameShortListString_T ("NotAvailable")),
22  _tvlPORListString (TvlPORListString_T ("")),
23  _envelopeID (0),
24  _dateFrom (1970, 01, 01), _dateEnd (2999, 12, 31), _comment (""),
25  _cityCode (CityCode_T ("")),
26  _cityUtfName (CityUTFName_T ("")), _cityAsciiName (CityASCIIName_T ("")),
27  _cityGeonamesID (0),
28  _stateCode (StateCode_T ("NA")), _countryCode (CountryCode_T ("NA")),
29  _altCountryCode (AltCountryCode_T ("")), _countryName (CountryName_T ("NA")),
30  _continentCode (ContinentCode_T ("NA")),
31  _continentName (ContinentName_T ("NotAvailable")),
32  _latitude (0), _longitude (0),
33  _featClass (FeatureClass_T ("Z")), _featCode (FeatureCode_T ("ZZZZ")),
34  _admin1Code (Admin1Code_T ("")),
35  _admin1UtfName (Admin1UTFName_T ("")),
36  _admin1AsciiName (Admin1ASCIIName_T ("")),
37  _admin2Code (Admin2Code_T ("")),
38  _admin2UtfName (Admin2UTFName_T ("")),
39  _admin2AsciiName (Admin2ASCIIName_T ("")),
40  _admin3Code (Admin3Code_T ("Z")), _admin4Code (Admin4Code_T ("")),
41  _population (0), _elevation (0), _gTopo30 (0),
42  _timeZone (TimeZone_T ("NA")),
43  _gmtOffset (0), _dstOffset (0), _rawOffset (0),
44  _modificationDate (2000, 01, 01),
45  _wikiLink (WikiLink_T ("http://en.wikipedia.org")),
46  _pageRank (K_DEFAULT_PAGE_RANK),
47  _originalKeywords ("NA"), _correctedKeywords ("NA"),
48  _percentage (0), _editDistance (0), _allowableEditDistance (0),
49  _rawDataString ("NA"),
50  _itLanguageCodeNum (Language::LAST_VALUE),
51  _itLanguageCode (LanguageCode_T ("")) {
52  }
53 
54  // //////////////////////////////////////////////////////////////////////
55  Location::Location (const Location& iLocation) :
56  _key (iLocation._key),
57  _icaoCode (iLocation._icaoCode), _faaCode (iLocation._faaCode),
58  _commonName (iLocation._commonName), _asciiName (iLocation._asciiName),
59  _altNameShortListString (iLocation._altNameShortListString),
60  _tvlPORListString (iLocation._tvlPORListString),
61  _envelopeID (iLocation.getEnvelopeID()),
62  _dateFrom (iLocation.getDateFrom()), _dateEnd (iLocation.getDateEnd()),
63  _comment (iLocation.getComment()),
64  _cityCode (iLocation._cityCode),
65  _cityUtfName (iLocation._cityUtfName),
66  _cityAsciiName (iLocation._cityAsciiName),
67  _cityGeonamesID (iLocation._cityGeonamesID),
68  _stateCode (iLocation._stateCode), _countryCode (iLocation._countryCode),
69  _altCountryCode (iLocation._altCountryCode),
70  _countryName (iLocation._countryName),
71  _continentCode (iLocation._continentCode),
72  _continentName (iLocation._continentName),
73  _latitude (iLocation._latitude), _longitude (iLocation._longitude),
74  _featClass (iLocation._featClass), _featCode (iLocation._featCode),
75  _admin1Code (iLocation._admin1Code),
76  _admin1UtfName (iLocation._admin1UtfName),
77  _admin1AsciiName (iLocation._admin1AsciiName),
78  _admin2Code (iLocation._admin2Code),
79  _admin2UtfName (iLocation._admin2UtfName),
80  _admin2AsciiName (iLocation._admin2AsciiName),
81  _admin3Code (iLocation._admin3Code), _admin4Code (iLocation._admin4Code),
82  _population (iLocation._population), _elevation (iLocation._elevation),
83  _gTopo30 (iLocation._gTopo30),
84  _timeZone (iLocation._timeZone), _gmtOffset (iLocation._gmtOffset),
85  _dstOffset (iLocation._dstOffset), _rawOffset (iLocation._rawOffset),
86  _modificationDate (iLocation._modificationDate),
87  _wikiLink (iLocation._wikiLink), _pageRank (iLocation._pageRank),
88  _nameMatrix (iLocation._nameMatrix),
89  _originalKeywords (iLocation._originalKeywords),
90  _correctedKeywords (iLocation._correctedKeywords),
91  _percentage (iLocation._percentage),
92  _editDistance (iLocation._editDistance),
93  _allowableEditDistance (iLocation._allowableEditDistance),
94  _extraLocationList (iLocation._extraLocationList),
95  _alternateLocationList (iLocation._alternateLocationList),
96  _rawDataString (iLocation._rawDataString),
97  _itLanguageCodeNum (iLocation._itLanguageCodeNum),
98  _itLanguageCode (LanguageCode_T ("")) {
99  }
100 
101  // //////////////////////////////////////////////////////////////////////
102  Location::Location (const IATACode_T& iIataCode, const IATAType& iIataType,
103  const GeonamesID_T& iGeonamesID,
104  const ICAOCode_T& iIcaoCode, const FAACode_T& iFaaCode,
105  const CommonName_T& iCommonName,
106  const ASCIIName_T& iASCIIName,
107  const EnvelopeID_T& iEnvelopeID,
108  const Date_T& iDateFrom, const Date_T& iDateEnd,
109  const Comment_T& iComment,
110  const CityCode_T& iCityCode,
111  const CityUTFName_T& iCityUtfName,
112  const CityASCIIName_T& iCityAsciiName,
113  const GeonamesID_T& iCityGeonamesID,
114  const StateCode_T& iStateCode,
115  const CountryCode_T& iCountryCode,
116  const AltCountryCode_T& iAltCountryCode,
117  const CountryName_T& iCountryName,
118  const ContinentName_T& iContinentName,
119  const Latitude_T& iLatitude, const Longitude_T& iLongitude,
120  const FeatureClass_T& iFeatureClass,
121  const FeatureCode_T& iFeatureCode,
122  const Admin1Code_T& iAdmin1Code,
123  const Admin1UTFName_T& iAdmin1UtfName,
124  const Admin1ASCIIName_T& iAdmin1AsciiName,
125  const Admin2Code_T& iAdmin2Code,
126  const Admin2UTFName_T& iAdmin2UtfName,
127  const Admin2ASCIIName_T& iAdmin2AsciiName,
128  const Admin3Code_T& iAdmin3Code,
129  const Admin4Code_T& iAdmin4Code,
130  const Population_T& iPopulation,
131  const Elevation_T& iElevation, const GTopo30_T& iGTopo30,
132  const TimeZone_T& iTimeZone,
133  const GMTOffset_T& iGMTOffset,
134  const DSTOffset_T& iDSTOffset,
135  const RawOffset_T& iRawOffset,
136  const Date_T& iModDate,
137  const TvlPORListString_T& iTvlPORListString,
138  const WikiLink_T& iWikiLink, const PageRank_T& iPageRank,
139  const std::string& iOriginalKeywords,
140  const std::string& iCorrectedKeywords,
141  const MatchingPercentage_T& iPercentage,
142  const NbOfErrors_T& iEditDistance,
143  const NbOfErrors_T& iAllowableEditDistance,
144  const RawDataString_T& iRawDataString) :
145  _key (iIataCode, iIataType, iGeonamesID),
146  _icaoCode (iIcaoCode), _faaCode (iFaaCode),
147  _commonName (iCommonName),_asciiName (iASCIIName),
148  _altNameShortListString (AltNameShortListString_T ("NotAvailable")),
149  _tvlPORListString (iTvlPORListString),
150  _envelopeID (iEnvelopeID),
151  _dateFrom (iDateFrom), _dateEnd (iDateEnd),
152  _comment (iComment),
153  _cityCode (iCityCode),
154  _cityUtfName (iCityUtfName), _cityAsciiName (iCityAsciiName),
155  _cityGeonamesID (iCityGeonamesID),
156  _stateCode (iStateCode),
157  _countryCode (iCountryCode), _altCountryCode (iAltCountryCode),
158  _countryName (iCountryName),
159  _continentCode ("NA"), _continentName (iContinentName),
160  _latitude (iLatitude), _longitude (iLongitude),
161  _featClass (iFeatureClass), _featCode (iFeatureCode),
162  _admin1Code (iAdmin1Code),
163  _admin1UtfName (Admin1UTFName_T (iAdmin1UtfName)),
164  _admin1AsciiName (Admin1ASCIIName_T (iAdmin1AsciiName)),
165  _admin2Code (iAdmin2Code),
166  _admin2UtfName (Admin2UTFName_T (iAdmin2UtfName)),
167  _admin2AsciiName (Admin2ASCIIName_T (iAdmin2AsciiName)),
168  _admin3Code (iAdmin3Code), _admin4Code (iAdmin4Code),
169  _population (iPopulation), _elevation (iElevation), _gTopo30 (iGTopo30),
170  _timeZone (iTimeZone),
171  _gmtOffset (iGMTOffset), _dstOffset (iDSTOffset), _rawOffset (iRawOffset),
172  _modificationDate (iModDate),
173  _wikiLink (iWikiLink), _pageRank (iPageRank),
174  _originalKeywords (iOriginalKeywords),
175  _correctedKeywords (iCorrectedKeywords),
176  _percentage (iPercentage), _editDistance (iEditDistance),
177  _allowableEditDistance (iAllowableEditDistance),
178  _rawDataString (iRawDataString),
179  _itLanguageCodeNum (Language::LAST_VALUE),
180  _itLanguageCode (LanguageCode_T ("")) {
181  }
182 
183  // //////////////////////////////////////////////////////////////////////
185  }
186 
187  // //////////////////////////////////////////////////////////////////////
188  void Location::toStream (std::ostream& ioOut) const {
189  ioOut << toString();
190  }
191 
192  // //////////////////////////////////////////////////////////////////////
193  void Location::fromStream (std::istream&) {
194  }
195 
196  // //////////////////////////////////////////////////////////////////////
197  std::string Location::describeShortKey() const {
198  std::ostringstream oStr;
199  oStr << _key.describe();
200  return oStr.str();
201  }
202 
203  // //////////////////////////////////////////////////////////////////////
204  std::string Location::describeKey() const {
205  return describeShortKey();
206  }
207 
208  // //////////////////////////////////////////////////////////////////////
209  std::string Location::toBasicString() const {
210  std::ostringstream oStr;
211  oStr << describeShortKey();
212 
213  oStr << ", " << _pageRank << "%"
214  << ", " << _commonName << ", " << _asciiName
215  << ", " << _icaoCode << ", " << _faaCode
216  << ", " << _envelopeID
217  << ", " << _dateFrom << ", " << _dateEnd << ", " << _comment
218  << ", " << _cityCode << ", " << _cityUtfName << ", " << _cityAsciiName
219  << ", " << _cityGeonamesID
220  << ", " << _stateCode
221  << ", " << _countryCode << ", " << _altCountryCode
222  << ", " << _countryName
223  << ", " << _continentCode << ", " << _continentName
224  << ", " << _latitude << ", " << _longitude
225  << ", " << _featClass << ", " << _featCode
226  << ", " << _admin1Code
227  << ", " << _admin1UtfName << ", " << _admin1AsciiName
228  << ", " << _admin2Code
229  << ", " << _admin2UtfName << ", " << _admin2AsciiName
230  << ", " << _admin3Code << ", " << _admin4Code
231  << ", " << _population << ", " << _elevation << ", " << _gTopo30
232  << ", " << _timeZone
233  << ", " << _gmtOffset << ", " << _dstOffset << ", " << _rawOffset
234  << ", " << _modificationDate
235  << ", " << _tvlPORListString
236  << ", " << _wikiLink
237  << ", " << _originalKeywords << ", " << _correctedKeywords
238  << ", " << _percentage << "%"
239  << ", " << _editDistance << ", " << _allowableEditDistance;
240 
241  return oStr.str();
242  }
243 
244  // //////////////////////////////////////////////////////////////////////
245  std::string Location::toShortString() const {
246  std::ostringstream oStr;
247  oStr << toBasicString();
248 
249  if (_extraLocationList.empty() == false) {
250  oStr << " with " << _extraLocationList.size() << " extra match(es)";
251  }
252 
253  if (_alternateLocationList.empty() == false) {
254  oStr << " with " << _alternateLocationList.size()
255  << " alternate match(es)";
256  }
257 
258  return oStr.str();
259  }
260 
261  // //////////////////////////////////////////////////////////////////////
262  std::string Location::toSingleLocationString() const {
263  std::ostringstream oStr;
264  oStr << toBasicString();
265  return oStr.str();
266  }
267 
268  // //////////////////////////////////////////////////////////////////////
269  std::string Location::toString() const {
270  std::ostringstream oStr;
271  oStr << toSingleLocationString();
272  oStr << "; name matrix {" << _nameMatrix.describe() << "}";
273 
274  if (_extraLocationList.empty() == false) {
275  oStr << "; Extra matches: {";
276  unsigned short idx = 0;
277  for (LocationList_T::const_iterator itLoc = _extraLocationList.begin();
278  itLoc != _extraLocationList.end(); ++itLoc, ++idx) {
279  if (idx != 0) {
280  oStr << ". ";
281  }
282  const Location& lExtraLocation = *itLoc;
283  oStr << lExtraLocation.toShortString();
284  }
285  oStr << "}";
286  }
287 
288  if (_alternateLocationList.empty() == false) {
289  oStr << "; Alternate matches: {";
290  unsigned short idx = 0;
291  for (LocationList_T::const_iterator itLoc =
292  _alternateLocationList.begin();
293  itLoc != _alternateLocationList.end(); ++itLoc, ++idx) {
294  if (idx != 0) {
295  oStr << ". ";
296  }
297  const Location& lAlternateLocation = *itLoc;
298  oStr << lAlternateLocation.toShortString();
299  }
300  oStr << "}";
301  }
302 
303  return oStr.str();
304  }
305 
306  // ////////////////////////////////////////////////////////////////////
310  }
311 
312  // ////////////////////////////////////////////////////////////////////
314  std::ostringstream oStr;
315  unsigned short idx = 0;
316  for (AltNameShortList_T::const_iterator itName = _itAltNameShortList.begin();
317  itName != _itAltNameShortList.end(); ++itName, ++idx) {
318  if (idx != 0) {
319  oStr << ",";
320  }
321  const AltNameShortListString_T& lAlternateLocation = *itName;
322  oStr << lAlternateLocation;
323  }
324 
325  // Store the short list of alternative names
326  const std::string lAltNameShortListString (oStr.str());
327  setAltNameShortListString (lAltNameShortListString);
328  }
329 
330  // ////////////////////////////////////////////////////////////////////
332  std::ostringstream oStr;
333  unsigned short idx = 0;
334  for (TvlPORList_T::const_iterator itCode = _itTvlPORList.begin();
335  itCode != _itTvlPORList.end(); ++itCode, ++idx) {
336  if (idx != 0) {
337  oStr << ",";
338  }
339  const TvlPORListString_T& lTvlPORCode = *itCode;
340  oStr << lTvlPORCode;
341  }
342 
343  // Store the list of IATA codes of the travel-related POR
344  const std::string lTvlPORCodeList (oStr.str());
345  setTvlPORListString (lTvlPORCodeList);
346  }
347 
348  // ////////////////////////////////////////////////////////////////////
350  FeatureNameList_T oList;
351 
352  // Extract the first two/three characters of the feature code (e.g.,
353  // 'MN' for 'MNCU', 'PPL' for 'PPLA'/'PPLC' or 'ADM' for 'ADM1'/'ADM2')
354  const std::string l2CharFeatCode = iFeatureCode.substr (0, 2);
355  const std::string l3CharFeatCode = iFeatureCode.substr (0, 3);
356 
357  if (iFeatureCode == "AIRP" || iFeatureCode == "AIRF"
358  || iFeatureCode == "AIRQ") {
359  oList.push_back (FeatureName_T ("airport"));
360  oList.push_back (FeatureName_T ("apt"));
361  oList.push_back (FeatureName_T ("airdrome"));
362  oList.push_back (FeatureName_T ("aerodrome"));
363  oList.push_back (FeatureName_T ("airfield"));
364  oList.push_back (FeatureName_T ("air field"));
365  oList.push_back (FeatureName_T ("field"));
366  oList.push_back (FeatureName_T ("airstrip"));
367  oList.push_back (FeatureName_T ("air strip"));
368  oList.push_back (FeatureName_T ("strip"));
369 
370  } else if (iFeatureCode == "AIRB") {
371  oList.push_back (FeatureName_T ("airport"));
372  oList.push_back (FeatureName_T ("apt"));
373  oList.push_back (FeatureName_T ("airbase"));
374  oList.push_back (FeatureName_T ("air base"));
375  oList.push_back (FeatureName_T ("ab"));
376  oList.push_back (FeatureName_T ("base"));
377 
378  } else if (iFeatureCode == "AIRS") {
379  oList.push_back (FeatureName_T ("airport"));
380  oList.push_back (FeatureName_T ("apt"));
381  oList.push_back (FeatureName_T ("spb"));
382  oList.push_back (FeatureName_T ("sea plane base"));
383  oList.push_back (FeatureName_T ("sea plane"));
384  oList.push_back (FeatureName_T ("waterdrome"));
385  oList.push_back (FeatureName_T ("aerodrome"));
386  oList.push_back (FeatureName_T ("water aerodrome"));
387 
388  } else if (iFeatureCode == "AIRH") {
389  oList.push_back (FeatureName_T ("airport"));
390  oList.push_back (FeatureName_T ("apt"));
391  oList.push_back (FeatureName_T ("heliport"));
392  oList.push_back (FeatureName_T ("hpt"));
393 
394  } else if (iFeatureCode == "RSTN") {
395  oList.push_back (FeatureName_T ("railway"));
396  oList.push_back (FeatureName_T ("railroad"));
397  oList.push_back (FeatureName_T ("train"));
398  oList.push_back (FeatureName_T ("station"));
399  oList.push_back (FeatureName_T ("railway station"));
400  oList.push_back (FeatureName_T ("railroad station"));
401  oList.push_back (FeatureName_T ("train station"));
402 
403  } else if (l3CharFeatCode == "BUS") {
404  oList.push_back (FeatureName_T ("bus"));
405  oList.push_back (FeatureName_T ("autobus"));
406  oList.push_back (FeatureName_T ("station"));
407  oList.push_back (FeatureName_T ("stn"));
408  oList.push_back (FeatureName_T ("stop"));
409  oList.push_back (FeatureName_T ("bus station"));
410  oList.push_back (FeatureName_T ("bus stop"));
411  oList.push_back (FeatureName_T ("autobus station"));
412  oList.push_back (FeatureName_T ("autobus stop"));
413 
414  } else if (iFeatureCode == "MTRO") {
415  oList.push_back (FeatureName_T ("metro"));
416  oList.push_back (FeatureName_T ("station"));
417  oList.push_back (FeatureName_T ("stn"));
418  oList.push_back (FeatureName_T ("stop"));
419  oList.push_back (FeatureName_T ("metro station"));
420  oList.push_back (FeatureName_T ("metro stop"));
421 
422  } else if (iFeatureCode == "FY" || iFeatureCode == "PRT"
423  || iFeatureCode == "PORT" || iFeatureCode == "HBR") {
424  oList.push_back (FeatureName_T ("ferry"));
425  oList.push_back (FeatureName_T ("maritime"));
426  oList.push_back (FeatureName_T ("port"));
427  oList.push_back (FeatureName_T ("prt"));
428  oList.push_back (FeatureName_T ("harbor"));
429  oList.push_back (FeatureName_T ("harbour"));
430  oList.push_back (FeatureName_T ("hbr"));
431  oList.push_back (FeatureName_T ("ferry port"));
432  oList.push_back (FeatureName_T ("maritime port"));
433 
434  } else if (l3CharFeatCode == "PPL" || l3CharFeatCode == "ADM"
435  || iFeatureCode == "LCTY") {
436  oList.push_back (FeatureName_T ("city"));
437  oList.push_back (FeatureName_T ("cty"));
438  oList.push_back (FeatureName_T ("town"));
439  oList.push_back (FeatureName_T ("downtown"));
440  oList.push_back (FeatureName_T ("down town"));
441  oList.push_back (FeatureName_T ("center"));
442  oList.push_back (FeatureName_T ("centre"));
443 
444  } else if (l3CharFeatCode == "PCL" || iFeatureCode == "AREA") {
445  oList.push_back (FeatureName_T ("city"));
446  oList.push_back (FeatureName_T ("cty"));
447  oList.push_back (FeatureName_T ("country"));
448  oList.push_back (FeatureName_T ("town"));
449  oList.push_back (FeatureName_T ("downtown"));
450  oList.push_back (FeatureName_T ("down town"));
451  oList.push_back (FeatureName_T ("center"));
452  oList.push_back (FeatureName_T ("centre"));
453  oList.push_back (FeatureName_T ("district"));
454  oList.push_back (FeatureName_T ("prefecture"));
455 
456  } else if (iFeatureCode == "MT") {
457  oList.push_back (FeatureName_T ("city"));
458  oList.push_back (FeatureName_T ("cty"));
459  oList.push_back (FeatureName_T ("mount"));
460  oList.push_back (FeatureName_T ("mt"));
461 
462  } else if (iFeatureCode == "PLAT") {
463  oList.push_back (FeatureName_T ("city"));
464  oList.push_back (FeatureName_T ("cty"));
465  oList.push_back (FeatureName_T ("plateau"));
466 
467  } else if (iFeatureCode == "OAS") {
468  oList.push_back (FeatureName_T ("city"));
469  oList.push_back (FeatureName_T ("cty"));
470  oList.push_back (FeatureName_T ("oasis"));
471 
472  } else if (iFeatureCode == "PRK") {
473  oList.push_back (FeatureName_T ("city"));
474  oList.push_back (FeatureName_T ("cty"));
475  oList.push_back (FeatureName_T ("park"));
476  oList.push_back (FeatureName_T ("prk"));
477 
478  } else if (l3CharFeatCode == "RES") {
479  oList.push_back (FeatureName_T ("city"));
480  oList.push_back (FeatureName_T ("cty"));
481  oList.push_back (FeatureName_T ("reserve"));
482  oList.push_back (FeatureName_T ("rsv"));
483 
484  } else if (iFeatureCode == "CMP") {
485  oList.push_back (FeatureName_T ("city"));
486  oList.push_back (FeatureName_T ("cty"));
487  oList.push_back (FeatureName_T ("camp"));
488  oList.push_back (FeatureName_T ("cmp"));
489 
490  } else if (l2CharFeatCode == "MN") {
491  oList.push_back (FeatureName_T ("city"));
492  oList.push_back (FeatureName_T ("cty"));
493  oList.push_back (FeatureName_T ("mine"));
494 
495  } else if (iFeatureCode == "HMSD") {
496  oList.push_back (FeatureName_T ("city"));
497  oList.push_back (FeatureName_T ("cty"));
498  oList.push_back (FeatureName_T ("homestead"));
499 
500  } else if (l2CharFeatCode == "RK") {
501  oList.push_back (FeatureName_T ("city"));
502  oList.push_back (FeatureName_T ("cty"));
503  oList.push_back (FeatureName_T ("rock"));
504 
505  } else if (iFeatureCode == "PT") {
506  oList.push_back (FeatureName_T ("city"));
507  oList.push_back (FeatureName_T ("cty"));
508  oList.push_back (FeatureName_T ("point"));
509  oList.push_back (FeatureName_T ("pt"));
510 
511  } else if (l3CharFeatCode == "RSV") {
512  oList.push_back (FeatureName_T ("city"));
513  oList.push_back (FeatureName_T ("cty"));
514  oList.push_back (FeatureName_T ("reservoir"));
515  oList.push_back (FeatureName_T ("rsv"));
516 
517  } else if (iFeatureCode == "LK") {
518  oList.push_back (FeatureName_T ("city"));
519  oList.push_back (FeatureName_T ("cty"));
520  oList.push_back (FeatureName_T ("lake"));
521  oList.push_back (FeatureName_T ("lk"));
522 
523  } else if (iFeatureCode == "BAY") {
524  oList.push_back (FeatureName_T ("city"));
525  oList.push_back (FeatureName_T ("cty"));
526  oList.push_back (FeatureName_T ("bay"));
527 
528  } else if (iFeatureCode == "CHN") {
529  oList.push_back (FeatureName_T ("city"));
530  oList.push_back (FeatureName_T ("cty"));
531  oList.push_back (FeatureName_T ("channel"));
532  oList.push_back (FeatureName_T ("chn"));
533 
534  } else if (l3CharFeatCode == "ISL") {
535  oList.push_back (FeatureName_T ("city"));
536  oList.push_back (FeatureName_T ("cty"));
537  oList.push_back (FeatureName_T ("island"));
538  oList.push_back (FeatureName_T ("isl"));
539  oList.push_back (FeatureName_T ("country"));
540 
541  } else if (iFeatureCode == "ATOL") {
542  oList.push_back (FeatureName_T ("city"));
543  oList.push_back (FeatureName_T ("cty"));
544  oList.push_back (FeatureName_T ("island"));
545  oList.push_back (FeatureName_T ("isl"));
546  oList.push_back (FeatureName_T ("atoll"));
547  oList.push_back (FeatureName_T ("atl"));
548  oList.push_back (FeatureName_T ("country"));
549  }
550 
551  //
552  return oList;
553  }
554 
555 }
void fromStream(std::istream &)
Definition: Location.cpp:193
const Percentage_T K_DEFAULT_PAGE_RANK
TvlPORList_T _itTvlPORList
Definition: Location.hpp:1288
void consolidateAltNameShortListString()
Definition: Location.cpp:313
std::string toSingleLocationString() const
Definition: Location.cpp:262
Date_T calculateDate() const
Definition: Location.cpp:307
Structure modelling a (geographical) location.
Definition: Location.hpp:24
double PageRank_T
std::string toShortString() const
Definition: Location.cpp:245
static FeatureNameList_T getFeatureList(const FeatureCode_T &)
Definition: Location.cpp:349
std::list< FeatureName_T > FeatureNameList_T
boost::gregorian::date Date_T
float GMTOffset_T
unsigned int Population_T
std::string describeKey() const
Definition: Location.cpp:204
float RawOffset_T
float DSTOffset_T
unsigned short NbOfErrors_T
std::string describeShortKey() const
Definition: Location.cpp:197
void setTvlPORListString(const std::string &iPORListString)
Definition: Location.hpp:505
std::string toString() const
Definition: Location.cpp:269
std::string toBasicString() const
Definition: Location.cpp:209
AltNameShortList_T _itAltNameShortList
Definition: Location.hpp:1287
std::string describe() const
Definition: LocationKey.cpp:51
GeoCoord_T Longitude_T
void consolidateTvlPORListString()
Definition: Location.cpp:331
void setAltNameShortListString(const std::string &iNameListString)
Definition: Location.hpp:498
Enumeration of output types.
Definition: IATAType.hpp:22
GeoCoord_T Latitude_T
std::string describe() const
Definition: NameMatrix.cpp:33
double MatchingPercentage_T
void toStream(std::ostream &) const
Definition: Location.cpp:188