KItinerary::KnowledgeDb Namespace Reference


struct  Airport
class  AlphaId
struct  Coordinate
struct  Country
class  IBNR
class  SncfStationId
struct  TrainStation
struct  TrainStationIdIndex
class  TrainStationIndex
class  UICStation
class  UnalignedNumber
class  VRStationCode


using CountryId = AlphaId< uint16_t, 2 >
using CountryId3 = AlphaId< uint16_t, 3 >
using IataCode = AlphaId< uint16_t, 3 >
typedef QFlags< PowerPlugTypePowerPlugTypes


enum  DrivingSide : uint8_t { Unknown, Left, Right }
enum  PowerPlugType : uint16_t {
  Unknown = 0, Unknown, TypeA = 1 << 0, TypeB = 1 << 1,
  TypeC = 1 << 2, TypeD = 1 << 3, TypeE = 1 << 4, TypeF = 1 << 5,
  TypeG = 1 << 6, TypeH = 1 << 7, TypeI = 1 << 8, TypeJ = 1 << 9,
  TypeK = 1 << 10, TypeL = 1 << 11, TypeM = 1 << 12, TypeN = 1 << 13
enum  Tz : uint16_t {
  Undefined, Africa_Abidjan, Africa_Accra, Africa_Addis_Ababa,
  Africa_Algiers, Africa_Asmara, Africa_Bamako, Africa_Bangui,
  Africa_Banjul, Africa_Bissau, Africa_Blantyre, Africa_Brazzaville,
  Africa_Bujumbura, Africa_Cairo, Africa_Casablanca, Africa_Ceuta,
  Africa_Conakry, Africa_Dakar, Africa_Dar_es_Salaam, Africa_Djibouti,
  Africa_Douala, Africa_El_Aaiun, Africa_Freetown, Africa_Gaborone,
  Africa_Harare, Africa_Johannesburg, Africa_Juba, Africa_Kampala,
  Africa_Khartoum, Africa_Kigali, Africa_Kinshasa, Africa_Lagos,
  Africa_Libreville, Africa_Lome, Africa_Luanda, Africa_Lubumbashi,
  Africa_Lusaka, Africa_Malabo, Africa_Maputo, Africa_Maseru,
  Africa_Mbabane, Africa_Mogadishu, Africa_Monrovia, Africa_Nairobi,
  Africa_Ndjamena, Africa_Niamey, Africa_Nouakchott, Africa_Ouagadougou,
  Africa_Porto_Novo, Africa_Sao_Tome, Africa_Tripoli, Africa_Tunis,
  Africa_Windhoek, America_Adak, America_Anchorage, America_Anguilla,
  America_Antigua, America_Araguaina, America_Argentina_Buenos_Aires, America_Argentina_Catamarca,
  America_Argentina_Cordoba, America_Argentina_Jujuy, America_Argentina_La_Rioja, America_Argentina_Mendoza,
  America_Argentina_Rio_Gallegos, America_Argentina_Salta, America_Argentina_San_Juan, America_Argentina_San_Luis,
  America_Argentina_Tucuman, America_Argentina_Ushuaia, America_Aruba, America_Asuncion,
  America_Atikokan, America_Bahia, America_Bahia_Banderas, America_Barbados,
  America_Belem, America_Belize, America_Blanc_Sablon, America_Boa_Vista,
  America_Bogota, America_Boise, America_Cambridge_Bay, America_Campo_Grande,
  America_Cancun, America_Caracas, America_Cayenne, America_Cayman,
  America_Chicago, America_Chihuahua, America_Costa_Rica, America_Creston,
  America_Cuiaba, America_Curacao, America_Danmarkshavn, America_Dawson,
  America_Dawson_Creek, America_Denver, America_Detroit, America_Dominica,
  America_Edmonton, America_Eirunepe, America_El_Salvador, America_Fort_Nelson,
  America_Fortaleza, America_Glace_Bay, America_Goose_Bay, America_Grand_Turk,
  America_Grenada, America_Guadeloupe, America_Guatemala, America_Guayaquil,
  America_Guyana, America_Halifax, America_Havana, America_Hermosillo,
  America_Indiana_Indianapolis, America_Indiana_Knox, America_Indiana_Marengo, America_Indiana_Petersburg,
  America_Indiana_Tell_City, America_Indiana_Vevay, America_Indiana_Vincennes, America_Indiana_Winamac,
  America_Inuvik, America_Iqaluit, America_Jamaica, America_Juneau,
  America_Kentucky_Louisville, America_Kentucky_Monticello, America_Kralendijk, America_La_Paz,
  America_Lima, America_Los_Angeles, America_Lower_Princes, America_Maceio,
  America_Managua, America_Manaus, America_Marigot, America_Martinique,
  America_Matamoros, America_Mazatlan, America_Menominee, America_Merida,
  America_Metlakatla, America_Mexico_City, America_Miquelon, America_Moncton,
  America_Monterrey, America_Montevideo, America_Montserrat, America_Nassau,
  America_New_York, America_Nipigon, America_Nome, America_Noronha,
  America_North_Dakota_Beulah, America_North_Dakota_Center, America_North_Dakota_New_Salem, America_Nuuk,
  America_Ojinaga, America_Panama, America_Pangnirtung, America_Paramaribo,
  America_Phoenix, America_Port_au_Prince, America_Port_of_Spain, America_Porto_Velho,
  America_Puerto_Rico, America_Punta_Arenas, America_Rainy_River, America_Rankin_Inlet,
  America_Recife, America_Regina, America_Resolute, America_Rio_Branco,
  America_Santarem, America_Santiago, America_Santo_Domingo, America_Sao_Paulo,
  America_Scoresbysund, America_Sitka, America_St_Barthelemy, America_St_Johns,
  America_St_Kitts, America_St_Lucia, America_St_Thomas, America_St_Vincent,
  America_Swift_Current, America_Tegucigalpa, America_Thule, America_Thunder_Bay,
  America_Tijuana, America_Toronto, America_Tortola, America_Vancouver,
  America_Whitehorse, America_Winnipeg, America_Yakutat, America_Yellowknife,
  Antarctica_Casey, Antarctica_Davis, Antarctica_DumontDUrville, Antarctica_Macquarie,
  Antarctica_Mawson, Antarctica_McMurdo, Antarctica_Palmer, Antarctica_Rothera,
  Antarctica_Syowa, Antarctica_Troll, Antarctica_Vostok, Arctic_Longyearbyen,
  Asia_Aden, Asia_Almaty, Asia_Amman, Asia_Anadyr,
  Asia_Aqtau, Asia_Aqtobe, Asia_Ashgabat, Asia_Atyrau,
  Asia_Baghdad, Asia_Bahrain, Asia_Baku, Asia_Bangkok,
  Asia_Barnaul, Asia_Beijing, Asia_Beirut, Asia_Bishkek,
  Asia_Brunei, Asia_Chita, Asia_Choibalsan, Asia_Colombo,
  Asia_Damascus, Asia_Dhaka, Asia_Dili, Asia_Dubai,
  Asia_Dushanbe, Asia_Famagusta, Asia_Gaza, Asia_Hebron,
  Asia_Ho_Chi_Minh, Asia_Hong_Kong, Asia_Hovd, Asia_Irkutsk,
  Asia_Jakarta, Asia_Jayapura, Asia_Jerusalem, Asia_Kabul,
  Asia_Kamchatka, Asia_Karachi, Asia_Kathmandu, Asia_Khandyga,
  Asia_Kolkata, Asia_Krasnoyarsk, Asia_Kuala_Lumpur, Asia_Kuching,
  Asia_Kuwait, Asia_Macau, Asia_Magadan, Asia_Makassar,
  Asia_Manila, Asia_Muscat, Asia_Nicosia, Asia_Novokuznetsk,
  Asia_Novosibirsk, Asia_Omsk, Asia_Oral, Asia_Phnom_Penh,
  Asia_Pontianak, Asia_Pyongyang, Asia_Qatar, Asia_Qostanay,
  Asia_Qyzylorda, Asia_Riyadh, Asia_Sakhalin, Asia_Samarkand,
  Asia_Seoul, Asia_Shanghai, Asia_Singapore, Asia_Srednekolymsk,
  Asia_Taipei, Asia_Tashkent, Asia_Tbilisi, Asia_Tehran,
  Asia_Thimphu, Asia_Tokyo, Asia_Tomsk, Asia_Ulaanbaatar,
  Asia_Urumqi, Asia_Ust_Nera, Asia_Vientiane, Asia_Vladivostok,
  Asia_Yakutsk, Asia_Yangon, Asia_Yekaterinburg, Asia_Yerevan,
  Atlantic_Azores, Atlantic_Bermuda, Atlantic_Canary, Atlantic_Cape_Verde,
  Atlantic_Faroe, Atlantic_Madeira, Atlantic_Reykjavik, Atlantic_South_Georgia,
  Atlantic_St_Helena, Atlantic_Stanley, Australia_Adelaide, Australia_Brisbane,
  Australia_Broken_Hill, Australia_Currie, Australia_Darwin, Australia_Eucla,
  Australia_Hobart, Australia_Lindeman, Australia_Lord_Howe, Australia_Melbourne,
  Australia_Perth, Australia_Sydney, Europe_Amsterdam, Europe_Andorra,
  Europe_Astrakhan, Europe_Athens, Europe_Belgrade, Europe_Berlin,
  Europe_Bratislava, Europe_Brussels, Europe_Bucharest, Europe_Budapest,
  Europe_Busingen, Europe_Chisinau, Europe_Copenhagen, Europe_Dublin,
  Europe_Gibraltar, Europe_Guernsey, Europe_Helsinki, Europe_Isle_of_Man,
  Europe_Istanbul, Europe_Jersey, Europe_Kaliningrad, Europe_Kiev,
  Europe_Kirov, Europe_Lisbon, Europe_Ljubljana, Europe_London,
  Europe_Luxembourg, Europe_Madrid, Europe_Malta, Europe_Mariehamn,
  Europe_Minsk, Europe_Monaco, Europe_Moscow, Europe_Oslo,
  Europe_Paris, Europe_Podgorica, Europe_Prague, Europe_Riga,
  Europe_Rome, Europe_Samara, Europe_San_Marino, Europe_Sarajevo,
  Europe_Saratov, Europe_Simferopol, Europe_Skopje, Europe_Sofia,
  Europe_Stockholm, Europe_Tallinn, Europe_Tirane, Europe_Ulyanovsk,
  Europe_Uzhgorod, Europe_Vaduz, Europe_Vatican, Europe_Vienna,
  Europe_Vilnius, Europe_Volgograd, Europe_Warsaw, Europe_Zagreb,
  Europe_Zaporozhye, Europe_Zurich, Indian_Antananarivo, Indian_Chagos,
  Indian_Christmas, Indian_Cocos, Indian_Comoro, Indian_Kerguelen,
  Indian_Mahe, Indian_Maldives, Indian_Mauritius, Indian_Mayotte,
  Indian_Reunion, Pacific_Apia, Pacific_Auckland, Pacific_Bougainville,
  Pacific_Chatham, Pacific_Chuuk, Pacific_Easter, Pacific_Efate,
  Pacific_Enderbury, Pacific_Fakaofo, Pacific_Fiji, Pacific_Funafuti,
  Pacific_Galapagos, Pacific_Gambier, Pacific_Guadalcanal, Pacific_Guam,
  Pacific_Honolulu, Pacific_Kiritimati, Pacific_Kosrae, Pacific_Kwajalein,
  Pacific_Majuro, Pacific_Marquesas, Pacific_Midway, Pacific_Nauru,
  Pacific_Niue, Pacific_Norfolk, Pacific_Noumea, Pacific_Pago_Pago,
  Pacific_Palau, Pacific_Pitcairn, Pacific_Pohnpei, Pacific_Port_Moresby,
  Pacific_Rarotonga, Pacific_Saipan, Pacific_Tahiti, Pacific_Tarawa,
  Pacific_Tongatapu, Pacific_Wake, Pacific_Wallis


Coordinate coordinateForAirport (IataCode iataCode)
const CountrycountriesBegin ()
const CountrycountriesEnd ()
KnowledgeDb::CountryId countryForAirport (IataCode iataCode)
CountryId countryForCoordinate (float lat, float lon)
Country countryForId (CountryId id)
CountryId countryForTimezone (Tz tz)
CountryId countryIdForUicCode (uint16_t uicCountryCode)
CountryId countryIdFromIso3166_1alpha3 (CountryId3 iso3Code)
IataCode iataCodeFromName (const QString &name)
std::vector< IataCodeiataCodesFromName (const QString &name)
PowerPlugTypes incompatiblePowerPlugs (PowerPlugTypes plugs, PowerPlugTypes sockets)
PowerPlugTypes incompatiblePowerSockets (PowerPlugTypes plugs, PowerPlugTypes sockets)
TrainStation stationForIbnr (IBNR ibnr)
TrainStation stationForIndianRailwaysStationCode (const QString &code)
TrainStation stationForSncfStationId (SncfStationId sncfId)
TrainStation stationForUic (UICStation uic)
TrainStation stationForVRStationCode (VRStationCode vrStation)
QTimeZone timezoneForAirport (IataCode iataCode)
Tz timezoneForCoordinate (float lat, float lon, bool *ambiguous=nullptr)
Tz timezoneForCountry (CountryId country)
Tz timezoneForLocation (float lat, float lon, CountryId country)
QTimeZone toQTimeZone (Tz tz)
const char * tzId (Tz tz)

Detailed Description

Lookup functions, utilities and data types for the static knowledge database.

The content accessible by this functions is extracted from Wikidata and compiled into this library.

The types in this namespace match the binary storage structure and thus are not intented for use in binary compatible APIs.

Typedef Documentation

using KItinerary::KnowledgeDb::CountryId = typedef AlphaId<uint16_t, 2>

ISO 3166-1 alpha 2 country identifier.

Definition at line 35 of file countrydb.h.

using KItinerary::KnowledgeDb::CountryId3 = typedef AlphaId<uint16_t, 3>

ISO 3166-1 alpha 3 country identifier.

Definition at line 37 of file countrydb.h.

using KItinerary::KnowledgeDb::IataCode = typedef AlphaId<uint16_t, 3>

IATA airport code.

Definition at line 31 of file iatacode.h.

Enumeration Type Documentation

enum KItinerary::KnowledgeDb::DrivingSide : uint8_t

Driving side.

Definition at line 40 of file countrydb.h.

Power plug types.

This cannot be an enum class due to QTBUG-47652.

US two-pin plugs.


US three-pin plugs.




Type D.


French plug.


Schuko plug.


UK plug.


Israel plug.


Australian plug.


Swiss plug.


Danish plug.


Type L.


Type M.


Type N (Brasilian)

Definition at line 50 of file countrydb.h.

enum KItinerary::KnowledgeDb::Tz : uint16_t

Enum representing all timezones.

Definition at line 16 of file timezonedb_data.h.

Function Documentation

Coordinate KItinerary::KnowledgeDb::coordinateForAirport ( IataCode  iataCode)

Returns the geographical coordinates the airport with IATA code iataCode is in.

Definition at line 43 of file airportdb.cpp.

const Country * KItinerary::KnowledgeDb::countriesBegin ( )

Iterator access for the country information table.

Definition at line 42 of file countrydb.cpp.

const Country * KItinerary::KnowledgeDb::countriesEnd ( )

Iterator access for the country information table.

Definition at line 47 of file countrydb.cpp.

CountryId KItinerary::KnowledgeDb::countryForAirport ( IataCode  iataCode)

Returns the country the airport with IATA code iataCode is in.

Definition at line 63 of file airportdb.cpp.

KnowledgeDb::CountryId KItinerary::KnowledgeDb::countryForCoordinate ( float  lat,
float  lon 

Returns the country for the given coordinate.

The result will be the country identifier only if the underlying spatial index has no ambiguity at the requested locations, ie. this will return less results than timezoneForCoordinate() for example.

Definition at line 164 of file timezonedb.cpp.

Country KItinerary::KnowledgeDb::countryForId ( CountryId  id)

Look up contry infromation by id.

Definition at line 31 of file countrydb.cpp.

KnowledgeDb::CountryId KItinerary::KnowledgeDb::countryForTimezone ( KnowledgeDb::Tz  tz)

Returns the country for a given timezone.

This is unique for most IANA timezones, but not guaranteed to be so, in which case an invalid country is returned.

Definition at line 50 of file timezonedb.cpp.

KnowledgeDb::CountryId KItinerary::KnowledgeDb::countryIdForUicCode ( uint16_t  uicCountryCode)

Look up country ISO code from a UIC country code.

Definition at line 114 of file countrydb.cpp.

KnowledgeDb::CountryId KItinerary::KnowledgeDb::countryIdFromIso3166_1alpha3 ( CountryId3  iso3Code)

Look up country ISO 3166-1 alpha 2 code from an ISO 3166-1 alpha 3 code.

Definition at line 102 of file countrydb.cpp.

KnowledgeDb::IataCode KItinerary::KnowledgeDb::iataCodeFromName ( const QString name)

Attempts to find the unique IATA code for the given airport name.

Definition at line 250 of file airportdb.cpp.

std::vector< KnowledgeDb::IataCode > KItinerary::KnowledgeDb::iataCodesFromName ( const QString name)

Returns all possible IATA code candidates for the given airport name.

Definition at line 214 of file airportdb.cpp.

PowerPlugTypes KItinerary::KnowledgeDb::incompatiblePowerPlugs ( PowerPlugTypes  plugs,
PowerPlugTypes  sockets 

Returns the power plugs out of plugs that wont fit into sockets.

Definition at line 74 of file countrydb.cpp.

PowerPlugTypes KItinerary::KnowledgeDb::incompatiblePowerSockets ( PowerPlugTypes  plugs,
PowerPlugTypes  sockets 

Returns the power sockets out pf sockets that are unable to receive plugs out of plugs, excluding those in plugs.

Definition at line 88 of file countrydb.cpp.

TrainStation KItinerary::KnowledgeDb::stationForIbnr ( IBNR  ibnr)

Lookup train station data by IBNR.

Definition at line 62 of file trainstationdb.cpp.

TrainStation KItinerary::KnowledgeDb::stationForIndianRailwaysStationCode ( const QString code)

Lookup train station data by Indian Railways station code.

Definition at line 91 of file trainstationdb.cpp.

TrainStation KItinerary::KnowledgeDb::stationForSncfStationId ( SncfStationId  sncfId)

Lookup train station data by SNCF station id.

Definition at line 81 of file trainstationdb.cpp.

TrainStation KItinerary::KnowledgeDb::stationForUic ( UICStation  uic)

Lookup train station data by UIC station id.

Definition at line 72 of file trainstationdb.cpp.

TrainStation KItinerary::KnowledgeDb::stationForVRStationCode ( VRStationCode  vrStation)

Lookup train station data by VR (Finland) station code.

Definition at line 104 of file trainstationdb.cpp.

QTimeZone KItinerary::KnowledgeDb::timezoneForAirport ( IataCode  iataCode)

Returns the timezone the airport with IATA code iataCode is in.

Definition at line 53 of file airportdb.cpp.

KnowledgeDb::Tz KItinerary::KnowledgeDb::timezoneForCoordinate ( float  lat,
float  lon,
bool *  ambiguous = nullptr 

Returns the timezone for the given coordinate.

The result can be Tz::Undefined if this cannot be clearly determined.

Definition at line 55 of file timezonedb.cpp.

KnowledgeDb::Tz KItinerary::KnowledgeDb::timezoneForCountry ( CountryId  country)

Returns the timezone for the given country, as long as there is exactly one timezone used in that country.

Definition at line 40 of file timezonedb.cpp.

KnowledgeDb::Tz KItinerary::KnowledgeDb::timezoneForLocation ( float  lat,
float  lon,
CountryId  country 

Returns the timezone for the given location consisting of coordinates and country.

This combines the results of the two above individual queries to obtain better results close to borders.

Definition at line 110 of file timezonedb.cpp.

QTimeZone KItinerary::KnowledgeDb::toQTimeZone ( Tz  tz)

Returns the corresponding QTimeZone.

Definition at line 32 of file timezonedb.cpp.

const char * KItinerary::KnowledgeDb::tzId ( KnowledgeDb::Tz  tz)

Returns the IANA timezone id for tz.

Definition at line 27 of file timezonedb.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Jun 5 2020 23:05:05 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.