19 void type_conversion<OPENTREP::Place>::
20 from_base (values
const& iPlaceValues, indicator ,
61 const std::string lIataCodeStr =
62 iPlaceValues.get<std::string> (
"iata_code",
"");
66 const std::string lIataTypeStr =
67 iPlaceValues.get<std::string> (
"location_type",
"");
71 iPlaceValues.get<
int> (
"geoname_id", 0);
79 if (lNewPlaceKey != lPlaceKey) {
103 iPlaceValues.get<
int> (
"envelope_id");
107 const std::string lDateFromStr =
109 const OPENTREP::Date_T lDateFrom (boost::gregorian::from_string (lDateFromStr));
113 const std::string lDateUntilStr =
115 const OPENTREP::Date_T lDateUntil (boost::gregorian::from_string (lDateUntilStr));
120 ioPlace.
setComment (iPlaceValues.get<std::string> (
"comment",
""));
124 ioPlace.
setCommonName (iPlaceValues.get<std::string> (
"utf_name",
""));
128 ioPlace.
setAsciiName (iPlaceValues.get<std::string> (
"asciiname",
""));
132 ioPlace.
setFaaCode (iPlaceValues.get<std::string> (
"faa_code",
""));
135 const std::string lFeatClass = iPlaceValues.get<std::string>(
"fclass",
"");
138 const std::string lFeatCode = iPlaceValues.get<std::string> (
"fcode",
"");
143 ioPlace.
setStateCode (iPlaceValues.get<std::string> (
"state_code",
""));
144 ioPlace.
setCountryCode (iPlaceValues.get<std::string> (
"country_code"));
145 ioPlace.
setCountryName (iPlaceValues.get<std::string> (
"country_name"));
148 ioPlace.
setLatitude (iPlaceValues.get<
double> (
"latitude"));
149 ioPlace.
setLongitude (iPlaceValues.get<
double> (
"longitude"));
150 ioPlace.
setPageRank (iPlaceValues.get<
double> (
"page_rank",
155 ioPlace.
setAdmin1Code (iPlaceValues.get<std::string> (
"admin1_code",
""));
156 ioPlace.
setAdmin1UtfName (iPlaceValues.get<std::string> (
"admin1_UTF8_name",
""));
161 ioPlace.
setAdmin2Code (iPlaceValues.get<std::string> (
"admin2_code",
""));
162 ioPlace.
setAdmin2UtfName (iPlaceValues.get<std::string> (
"admin2_UTF8_name",
""));
167 ioPlace.
setAdmin3Code (iPlaceValues.get<std::string> (
"admin3_code",
""));
171 ioPlace.
setAdmin4Code (iPlaceValues.get<std::string> (
"admin4_code",
""));
175 iPlaceValues.get<
int> (
"population");
180 iPlaceValues.get<
int> (
"elevation");
189 ioPlace.
setTimeZone (iPlaceValues.get<std::string> (
"time_zone",
""));
194 iPlaceValues.get<
int> (
"gmt_offset", 0.0);
197 iPlaceValues.get<
int> (
"dst_offset", 0.0);
200 iPlaceValues.get<
int> (
"raw_offset", 0.0);
204 const std::string lModDateStr =
206 const OPENTREP::Date_T lModDate (boost::gregorian::from_string (lModDateStr));
211 ioPlace.
setWAC (iPlaceValues.get<
int> (
"wac", 0));
215 ioPlace.
setWACName (iPlaceValues.get<std::string> (
"wac_name",
""));
219 ioPlace.
setWikiLink (iPlaceValues.get<std::string> (
"wiki_link",
""));
223 const std::string& lLanguageString =
224 iPlaceValues.get<std::string> (
"alt_lang_code",
"");
245 const std::string& lUtfName =
246 iPlaceValues.get<std::string> (
"alt_name",
"");
247 ioPlace.
addName (lLanguageStr, lUtfName);
273 void type_conversion<OPENTREP::Place>::
275 indicator& ioIndicator) {
278 const std::string lIataCodeStr (lIataCode);
279 const indicator lIataCodeIndicator = lIataCodeStr.empty() ? i_null : i_ok;
283 const std::string lIcaoCodeStr (lIcaoCode);
284 const indicator lIcaoCodeIndicator = lIcaoCodeStr.empty() ? i_null : i_ok;
288 const std::string lFaaCodeStr (lFaaCode);
289 const indicator lFaaCodeIndicator = lFaaCodeStr.empty() ? i_null : i_ok;
298 const std::string lStateCodeStr (lStateCode);
299 const indicator lStateCodeIndicator = lStateCodeStr.empty() ? i_null : i_ok;
303 const std::string lCountryCodeStr (lCountryCode);
307 const std::string lCountryNameStr (lCountryName);
311 const std::string lContinentNameStr (lContinentName);
315 const std::string lTimeZoneStr (lTimeZone);
319 const std::string lWACNameStr (lWACName);
323 const std::string lWikiLinkStr (lWikiLink);
326 ioPlaceValues.set (
"iata_code", lIataCodeStr, lIataCodeIndicator);
327 ioPlaceValues.set (
"icao_code", lIcaoCodeStr, lIcaoCodeIndicator);
329 ioPlaceValues.set (
"faa_code", lFaaCodeStr, lFaaCodeIndicator);
331 ioPlaceValues.set (
"state_code", lStateCodeStr, lStateCodeIndicator);
332 ioPlaceValues.set (
"country_code", lCountryCodeStr);
333 ioPlaceValues.set (
"country_name", lCountryNameStr);
334 ioPlaceValues.set (
"continent_name", lContinentNameStr);
335 ioPlaceValues.set (
"time_zone", lTimeZoneStr);
336 ioPlaceValues.set (
"latitude", iPlace.
getLatitude());
338 ioPlaceValues.set (
"page_rank", iPlace.
getPageRank());
339 ioPlaceValues.set (
"wac", iPlace.
getWAC());
340 ioPlaceValues.set (
"wac_name", lWACNameStr);
341 ioPlaceValues.set (
"wiki_link", lWikiLinkStr);
Class modelling a place/POR (point of reference).
const Latitude_T & getLatitude() const
void setWACName(const std::string &iWACName)
const WAC_T & getWAC() const
const PageRank_T & getPageRank() const
void setAdmin3Code(const std::string &iAdminCode)
void setGMTOffset(const GMTOffset_T &iOffset)
const WACName_T & getWACName() const
const WikiLink_T & getWikiLink() const
void setAdmin1AsciiName(const std::string &iAdminName)
const ICAOCode_T & getIcaoCode() const
void setPopulation(const Population_T &iPopulation)
const CountryCode_T & getCountryCode() const
const FAACode_T & getFaaCode() const
const GeonamesID_T & getGeonamesID() const
void setAdmin4Code(const std::string &iAdminCode)
const ContinentName_T & getContinentName() const
void setStateCode(const std::string &iStateCode)
void setContinentName(const std::string &iContinentName)
const TimeZone_T & getTimeZone() const
void setComment(const std::string &iComment)
void setWAC(const WAC_T &iWAC)
void setAdmin2Code(const std::string &iAdminCode)
void setAltCountryCode(const std::string &iCountryCode)
void setDSTOffset(const DSTOffset_T &iOffset)
void setLatitude(const Latitude_T &iLatitude)
void setGeonamesID(const GeonamesID_T &iGeonamesID)
void setFaaCode(const std::string &iFaaCode)
void setAdmin1Code(const std::string &iAdminCode)
void setAdmin2UtfName(const std::string &iAdminName)
void setAdmin1UtfName(const std::string &iAdminName)
const Longitude_T & getLongitude() const
void setAsciiName(const std::string &iName)
const StateCode_T & getStateCode() const
void setEnvelopeID(const EnvelopeID_T &iEnvelopeID)
const IATACode_T & getIataCode() const
void setElevation(const Elevation_T &iElevation)
void setRawOffset(const RawOffset_T &iOffset)
void setModificationDate(const Date_T &iModDate)
void setLongitude(const Longitude_T &iLongitude)
void setCommonName(const std::string &iName)
void setIataCode(const std::string &iIataCode)
void addName(const LanguageCode_T &iLanguageCode, const std::string &iName)
void setCountryCode(const std::string &iCountryCode)
const LocationKey & getKey() const
void setFeatureCode(const std::string &iFeatCode)
void setTimeZone(const std::string &iTimeZone)
void setIataType(const std::string &iIATAType)
void setCountryName(const std::string &iCountryName)
const CountryName_T & getCountryName() const
void setGTopo30(const GTopo30_T &iGTopo30)
void setAdmin2AsciiName(const std::string &iAdminName)
void setWikiLink(const std::string &iWikiLink)
void setDateFrom(const Date_T &iDate)
void setFeatureClass(const std::string &iFeatClass)
void setDateEnd(const Date_T &iDate)
void setPageRank(const PageRank_T &iPageRank)
const std::string DEFAULT_DATE_STR
const Percentage_T K_DEFAULT_PAGE_RANK
boost::gregorian::date Date_T
unsigned int EnvelopeID_T
unsigned int Population_T
unsigned int GeonamesID_T
Enumeration of place/location types with respect to their use for transportation purposes.
Class modelling the primary key of a location/POR (point of reference).