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