KPublicTransport
location.cpp
112 return !std::isnan(d->latitude) && !std::isnan(d->longitude) && std::abs(d->latitude) <= 90.0 && std::abs(d->longitude) <= 180.0;
117 return d->floorLevel > std::numeric_limits<int>::lowest() && d->floorLevel < std::numeric_limits<int>::max();
213 const auto entry = std::lower_bound(std::begin(name_normalization_map), std::end(name_normalization_map), b.constData(), [](const auto &lhs, const auto rhs) {
236 // if the character has a canonical decomposition use that and skip the combining diacritic markers following it
268 const auto it = std::lower_bound(std::begin(transliteration_map), std::end(transliteration_map), c, [](const auto &lhs, const auto rhs) {
313 const auto dist = Location::distance(lhs.latitude(), lhs.longitude(), rhs.latitude(), rhs.longitude());
323 // ids - IFOPT takes priority here due to its special hierarchical handling, but only for stations
326 if (!lhsIfopt.isEmpty() && !rhsIfopt.isEmpty() && (lhs.type() == Location::Stop || rhs.type() == Location::Stop)) {
383 std::transform(lhsNameFragments.begin(), lhsNameFragments.end(), std::back_inserter(lhsNormalized), stripDiacritics);
385 lhsNormalized.erase(std::unique(lhsNormalized.begin(), lhsNormalized.end()), lhsNormalized.end());
389 std::transform(rhsNameFragments.begin(), rhsNameFragments.end(), std::back_inserter(rhsNormalized), stripDiacritics);
391 rhsNormalized.erase(std::unique(rhsNormalized.begin(), rhsNormalized.end()), rhsNormalized.end());
399 std::transform(lhsNameFragments.begin(), lhsNameFragments.end(), std::back_inserter(lhsNormalized), applyTransliterations);
426 l.setIdentifier(IfoptUtil::identifierType(), IfoptUtil::merge(l.identifier(IfoptUtil::identifierType()), it.value()).toString());
521 obj.insert("rentalVehicleStation"_L1, RentalVehicleStation::toJson(loc.rentalVehicleStation()));
static KCountrySubdivision fromLocation(float latitude, float longitude)
static KCountry fromLocation(float latitude, float longitude)
Status information about equipment such as elevators or escalators.
Definition equipment.h:25
static QJsonObject toJson(const Equipment &equipment)
Serializes one object to JSON.
Definition equipment.cpp:58
static Equipment fromJson(const QJsonObject &obj)
Deserialize an object from JSON.
Definition equipment.cpp:63
Q_INVOKABLE QString identifier(const QString &identifierType) const
Location identifiers.
Definition location.cpp:144
KPublicTransport::Equipment equipment
Equipment information, if applicable for this location.
Definition location.h:88
KPublicTransport::RentalVehicle rentalVehicle
Rental vehicle information, if applicable for this location.
Definition location.h:86
static Location fromJson(const QJsonObject &obj)
Deserialize a Location object from JSON.
Definition location.cpp:559
KPublicTransport::RentalVehicleStation rentalVehicleStation
Rental vehicle dock information, if applicable for this location.
Definition location.h:84
static bool isSameName(const QString &lhs, const QString &rhs)
Checks if two location names refer to the same location.
Definition location.cpp:370
@ RentedVehicleStation
a pick-up/drop-off point for dock-based rental bike/scooter systems
Definition location.h:38
static QJsonObject toJson(const Location &loc)
Serializes one Location object to JSON.
Definition location.cpp:494
static double distance(double lat1, double lon1, double lat2, double lon2)
Compute the distance between two geo coordinates, in meters.
Definition location.cpp:474
static Location merge(const Location &lhs, const Location &rhs)
Merge two departure instances.
Definition location.cpp:417
QString country
Country of the location as ISO 3166-1 alpha 2 code, if known.
Definition location.h:67
bool isEmpty() const
Returns true if this is an default-constructed location object not specifying any location.
Definition location.cpp:120
static bool isSame(const Location &lhs, const Location &rhs)
Checks if to instances refer to the same location (which does not necessarily mean they are exactly e...
Definition location.cpp:311
Additional information for a vehicle renting station, attached to Location objects.
Definition rentalvehicle.h:90
static RentalVehicleStation fromJson(const QJsonObject &obj)
Deserialize an object from JSON.
Definition rentalvehicle.cpp:223
static bool isSame(const RentalVehicleStation &lhs, const RentalVehicleStation &rhs)
Checks if two instances refer to the same station.
Definition rentalvehicle.cpp:164
static QJsonObject toJson(const RentalVehicleStation &station)
Serializes one object to JSON.
Definition rentalvehicle.cpp:185
An individual rental vehicle used on a JourneySection, ie.
Definition rentalvehicle.h:28
static RentalVehicle fromJson(const QJsonObject &obj)
Deserialize an object from JSON.
Definition rentalvehicle.cpp:274
static QJsonObject toJson(const RentalVehicle &vehicle)
Serializes one object to JSON.
Definition rentalvehicle.cpp:262
bool isSameStopPlace(QStringView lhs, QStringView rhs)
Checks whether two valid IFOPT ids refer to the same stop place.
Definition ifoptutil.cpp:58
QString identifierType()
The identifier type for use in Location::identifer for IFOPT ids.
Definition ifoptutil.cpp:83
QStringView merge(QStringView lhs, QStringView rhs)
Merge two IFOPT ids that refer to the same stop place while retaining the maximum level of detail.
Definition ifoptutil.cpp:63
QStringView countryCode(QStringView coachNumber)
Returns the UIC country code from coachNumber.
Definition uicrailwaycoach.cpp:13
Query operations and data types for accessing realtime public transport information from online servi...
Definition attribution.cpp:16
KI18NLOCALEDATA_EXPORT const char * fromLocation(float latitude, float longitude)
Canonical
iterator insert(QLatin1StringView key, const QJsonValue &value)
QJsonValue value(QLatin1StringView key) const const
QJsonObject toObject() const const
QString toString() const const
const QChar at(qsizetype position) const const
QString fromUtf8(QByteArrayView str)
QString & insert(qsizetype position, QChar ch)
bool isEmpty() const const
void push_back(QChar ch)
void reserve(qsizetype size)
qsizetype size() const const
bool startsWith(QChar c, Qt::CaseSensitivity cs) const const
QString toString() const const
CaseInsensitive
SkipEmptyParts
QByteArray id() const const
bool isValid() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:57:19 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:57:19 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.