20 _unLOCodeList(), _uicCodeList(),
26 _dateFrom (1970, 01, 01), _dateEnd (2999, 12, 31), _comment (
""),
30 _currencyCode (
"ZZZ"),
33 _latitude (0), _longitude (0),
42 _population (0), _elevation (0), _gTopo30 (0),
44 _gmtOffset (0), _dstOffset (0), _rawOffset (0),
45 _modificationDate (2000, 01, 01),
46 _wikiLink (
WikiLink_T (
"http://en.wikipedia.org")),
48 _originalKeywords (
"NA"), _correctedKeywords (
"NA"),
49 _percentage (0), _editDistance (0), _allowableEditDistance (0),
50 _rawDataString (
"NA"),
57 _key (iLocation._key),
58 _icaoCode (iLocation._icaoCode), _faaCode (iLocation._faaCode),
59 _unLOCodeList (iLocation._unLOCodeList),
60 _uicCodeList (iLocation._uicCodeList),
61 _commonName (iLocation._commonName), _asciiName (iLocation._asciiName),
62 _altNameShortListString (iLocation._altNameShortListString),
63 _tvlPORListString (iLocation._tvlPORListString),
64 _envelopeID (iLocation.getEnvelopeID()),
65 _dateFrom (iLocation.getDateFrom()), _dateEnd (iLocation.getDateEnd()),
66 _comment (iLocation.getComment()),
67 _cityList (iLocation._cityList),
68 _stateCode (iLocation._stateCode), _countryCode (iLocation._countryCode),
69 _altCountryCode (iLocation._altCountryCode),
70 _countryName (iLocation._countryName),
71 _wac (iLocation._wac), _wacName (iLocation._wacName),
72 _currencyCode (iLocation._currencyCode),
73 _continentCode (iLocation._continentCode),
74 _continentName (iLocation._continentName),
75 _latitude (iLocation._latitude), _longitude (iLocation._longitude),
76 _featClass (iLocation._featClass), _featCode (iLocation._featCode),
77 _admin1Code (iLocation._admin1Code),
78 _admin1UtfName (iLocation._admin1UtfName),
79 _admin1AsciiName (iLocation._admin1AsciiName),
80 _admin2Code (iLocation._admin2Code),
81 _admin2UtfName (iLocation._admin2UtfName),
82 _admin2AsciiName (iLocation._admin2AsciiName),
83 _admin3Code (iLocation._admin3Code), _admin4Code (iLocation._admin4Code),
84 _population (iLocation._population), _elevation (iLocation._elevation),
85 _gTopo30 (iLocation._gTopo30),
86 _timeZone (iLocation._timeZone), _gmtOffset (iLocation._gmtOffset),
87 _dstOffset (iLocation._dstOffset), _rawOffset (iLocation._rawOffset),
88 _modificationDate (iLocation._modificationDate),
89 _wikiLink (iLocation._wikiLink), _pageRank (iLocation._pageRank),
90 _nameMatrix (iLocation._nameMatrix),
91 _originalKeywords (iLocation._originalKeywords),
92 _correctedKeywords (iLocation._correctedKeywords),
93 _percentage (iLocation._percentage),
94 _editDistance (iLocation._editDistance),
95 _allowableEditDistance (iLocation._allowableEditDistance),
96 _extraLocationList (iLocation._extraLocationList),
97 _alternateLocationList (iLocation._alternateLocationList),
98 _rawDataString (iLocation._rawDataString),
99 _itLanguageCodeNum (iLocation._itLanguageCodeNum),
140 const std::string& iOriginalKeywords,
141 const std::string& iCorrectedKeywords,
146 _key (iIataCode, iIataType, iGeonamesID),
147 _icaoCode (iIcaoCode), _faaCode (iFaaCode),
148 _commonName (iCommonName),_asciiName (iASCIIName),
150 _tvlPORListString (iTvlPORListString),
151 _envelopeID (iEnvelopeID),
152 _dateFrom (iDateFrom), _dateEnd (iDateEnd),
154 _cityList (iCityDetailsList),
155 _stateCode (iStateCode),
156 _countryCode (iCountryCode), _altCountryCode (iAltCountryCode),
157 _countryName (iCountryName),
158 _wac (iWAC), _wacName (iWACName),
159 _currencyCode (iCurrencyCode),
160 _continentCode (
"NA"), _continentName (iContinentName),
161 _latitude (iLatitude), _longitude (iLongitude),
162 _featClass (iFeatureClass), _featCode (iFeatureCode),
163 _admin1Code (iAdmin1Code),
166 _admin2Code (iAdmin2Code),
169 _admin3Code (iAdmin3Code), _admin4Code (iAdmin4Code),
170 _population (iPopulation), _elevation (iElevation), _gTopo30 (iGTopo30),
171 _timeZone (iTimeZone),
172 _gmtOffset (iGMTOffset), _dstOffset (iDSTOffset), _rawOffset (iRawOffset),
173 _modificationDate (iModDate),
174 _wikiLink (iWikiLink), _pageRank (iPageRank),
175 _originalKeywords (iOriginalKeywords),
176 _correctedKeywords (iCorrectedKeywords),
177 _percentage (iPercentage), _editDistance (iEditDistance),
178 _allowableEditDistance (iAllowableEditDistance),
179 _rawDataString (iRawDataString),
199 std::ostringstream oStr;
211 std::ostringstream oStr;
214 oStr <<
", " << _pageRank <<
"%" 215 <<
", " << _commonName <<
", " << _asciiName
216 <<
", " << _icaoCode <<
", " << _faaCode
219 <<
", " << _envelopeID
220 <<
", " << _dateFrom <<
", " << _dateEnd <<
", " << _comment
222 <<
", " << _stateCode
223 <<
", " << _countryCode <<
", " << _altCountryCode
224 <<
", " << _countryName
225 <<
", " << _wac <<
", " << _wacName
226 <<
", " << _currencyCode
227 <<
", " << _continentCode <<
", " << _continentName
228 <<
", " << _latitude <<
", " << _longitude
229 <<
", " << _featClass <<
", " << _featCode
230 <<
", " << _admin1Code
231 <<
", " << _admin1UtfName <<
", " << _admin1AsciiName
232 <<
", " << _admin2Code
233 <<
", " << _admin2UtfName <<
", " << _admin2AsciiName
234 <<
", " << _admin3Code <<
", " << _admin4Code
235 <<
", " << _population <<
", " << _elevation <<
", " << _gTopo30
237 <<
", " << _gmtOffset <<
", " << _dstOffset <<
", " << _rawOffset
238 <<
", " << _modificationDate
239 <<
", " << _tvlPORListString
241 <<
", " << _originalKeywords <<
", " << _correctedKeywords
242 <<
", " << _percentage <<
"%" 243 <<
", " << _editDistance <<
", " << _allowableEditDistance;
250 std::ostringstream oStr;
253 if (_extraLocationList.empty() ==
false) {
254 oStr <<
" with " << _extraLocationList.size() <<
" extra match(es)";
257 if (_alternateLocationList.empty() ==
false) {
258 oStr <<
" with " << _alternateLocationList.size()
259 <<
" alternate match(es)";
267 std::ostringstream oStr;
274 std::ostringstream oStr;
276 oStr <<
"; name matrix {" << _nameMatrix.
describe() <<
"}";
278 if (_extraLocationList.empty() ==
false) {
279 oStr <<
"; Extra matches: {";
280 unsigned short idx = 0;
281 for (LocationList_T::const_iterator itLoc = _extraLocationList.begin();
282 itLoc != _extraLocationList.end(); ++itLoc, ++idx) {
286 const Location& lExtraLocation = *itLoc;
292 if (_alternateLocationList.empty() ==
false) {
293 oStr <<
"; Alternate matches: {";
294 unsigned short idx = 0;
295 for (LocationList_T::const_iterator itLoc =
296 _alternateLocationList.begin();
297 itLoc != _alternateLocationList.end(); ++itLoc, ++idx) {
301 const Location& lAlternateLocation = *itLoc;
318 std::ostringstream oStr;
319 unsigned short idx = 0;
320 for (UNLOCodeList_T::const_iterator itUNLOCode = _unLOCodeList.begin();
321 itUNLOCode != _unLOCodeList.end(); ++itUNLOCode, ++idx) {
334 std::ostringstream oStr;
335 unsigned short idx = 0;
336 for (UICCodeList_T::const_iterator itUICCode = _uicCodeList.begin();
337 itUICCode != _uicCodeList.end(); ++itUICCode, ++idx) {
350 std::ostringstream oStr;
351 unsigned short idx = 0;
352 for (CityDetailsList_T::const_iterator itCity = _cityList.begin();
353 itCity != _cityList.end(); ++itCity, ++idx) {
358 oStr << lCityDetails;
370 _cityList.push_back (lCityDetails);
375 std::ostringstream oStr;
376 unsigned short idx = 0;
383 oStr << lAlternateLocation;
387 const std::string lAltNameShortListString (oStr.str());
393 std::ostringstream oStr;
394 unsigned short idx = 0;
395 for (IATACodeList_T::const_iterator itCode =
_itTvlPORList.begin();
405 const std::string lTvlPORCodeList (oStr.str());
415 const std::string l2CharFeatCode = iFeatureCode.substr (0, 2);
416 const std::string l3CharFeatCode = iFeatureCode.substr (0, 3);
418 if (iFeatureCode ==
"AIRP" || iFeatureCode ==
"AIRF" 419 || iFeatureCode ==
"AIRQ") {
431 }
else if (iFeatureCode ==
"AIRB") {
439 }
else if (iFeatureCode ==
"AIRS") {
449 }
else if (iFeatureCode ==
"AIRH") {
455 }
else if (iFeatureCode ==
"RSTN") {
464 }
else if (l3CharFeatCode ==
"BUS") {
475 }
else if (iFeatureCode ==
"MTRO") {
483 }
else if (iFeatureCode ==
"FY" || iFeatureCode ==
"PRT" 484 || iFeatureCode ==
"PORT" || iFeatureCode ==
"HBR") {
495 }
else if (l3CharFeatCode ==
"PPL" || l3CharFeatCode ==
"ADM" 496 || iFeatureCode ==
"LCTY") {
505 }
else if (l3CharFeatCode ==
"PCL" || iFeatureCode ==
"AREA") {
517 }
else if (iFeatureCode ==
"MT") {
523 }
else if (iFeatureCode ==
"PLAT") {
528 }
else if (iFeatureCode ==
"OAS") {
533 }
else if (iFeatureCode ==
"PRK") {
539 }
else if (l3CharFeatCode ==
"RES") {
545 }
else if (iFeatureCode ==
"CMP") {
551 }
else if (l2CharFeatCode ==
"MN") {
556 }
else if (iFeatureCode ==
"HMSD") {
561 }
else if (l2CharFeatCode ==
"RK") {
566 }
else if (iFeatureCode ==
"PT") {
572 }
else if (l3CharFeatCode ==
"RSV") {
578 }
else if (iFeatureCode ==
"LK") {
584 }
else if (iFeatureCode ==
"BAY") {
589 }
else if (iFeatureCode ==
"CHN") {
595 }
else if (l3CharFeatCode ==
"ISL") {
602 }
else if (iFeatureCode ==
"ATOL") {
void fromStream(std::istream &)
const Percentage_T K_DEFAULT_PAGE_RANK
unsigned int EnvelopeID_T
void consolidateCityDetailsList()
void consolidateAltNameShortListString()
Class modelling the elementary details of a city.
std::string describeUICCodeList() const
std::string describeUNLOCodeList() const
std::string toString() const
unsigned int GeonamesID_T
Structure modelling a (geographical) location.
std::string toShortString() const
std::string _itCityIataCode
static FeatureNameList_T getFeatureList(const FeatureCode_T &)
std::list< FeatureName_T > FeatureNameList_T
boost::gregorian::date Date_T
Date_T calculateDate() const
unsigned int Population_T
std::string describe() const
std::string describeShortKey() const
IATACodeList_T _itTvlPORList
unsigned short NbOfErrors_T
void toStream(std::ostream &) const
std::string toBasicString() const
void setTvlPORListString(const std::string &iPORListString)
AltNameShortList_T _itAltNameShortList
std::string toSingleLocationString() const
std::string describeCityDetailsList() const
void consolidateTvlPORListString()
void setAltNameShortListString(const std::string &iNameListString)
std::string _itCityUtfName
Enumeration of place/location types with respect to their use for transportation purposes.
std::string _itCityAsciiName
std::string describeKey() const
std::string describe() const
std::list< CityDetails > CityDetailsList_T
A list of cities, for instance the list of cities served by a travel-related POR (point of reference)...
double MatchingPercentage_T
GeonamesID_T _itCityGeonamesID