KItinerary::LocationUtil
Enumerations | |
enum | Accuracy { Exact , CityLevel , WalkingDistance } |
Functions | |
PostalAddress | address (const QVariant &location) |
QVariant | arrivalLocation (const QVariant &res) |
QVariant | departureLocation (const QVariant &res) |
int | distance (const GeoCoordinates &coord1, const GeoCoordinates &coord2) |
int | distance (double lat1, double lon1, double lat2, double lon2) |
GeoCoordinates | geo (const QVariant &location) |
GeoCoordinates | geoFromUrl (const QUrl &url) |
QUrl | geoUri (const QVariant &location) |
bool | isLocationChange (const QVariant &res) |
bool | isSameLocation (const QVariant &lhs, const QVariant &rhs, Accuracy accuracy=Exact) |
QVariant | location (const QVariant &res) |
QString | name (const QVariant &location) |
Detailed Description
Utility functions related to location information.
Enumeration Type Documentation
◆ Accuracy
Location comparison accuracy.
Enumerator | |
---|---|
Exact | Locations match exactly. |
CityLevel | Locations are in the same city. |
WalkingDistance | Locations are close enough together to not need transportation. |
Definition at line 63 of file locationutil.h.
Function Documentation
◆ address()
PostalAddress KItinerary::LocationUtil::address | ( | const QVariant & | location | ) |
Returns the address of the given location.
Definition at line 152 of file locationutil.cpp.
◆ arrivalLocation()
Returns the arrival location of the given reservation.
This assumes isLocationChange(res) == true.
Definition at line 55 of file locationutil.cpp.
◆ departureLocation()
Returns the departure location of the given reservation.
This assumes isLocationChange(res) == true.
Definition at line 75 of file locationutil.cpp.
◆ distance() [1/2]
int KItinerary::LocationUtil::distance | ( | const GeoCoordinates & | coord1, |
const GeoCoordinates & | coord2 ) |
Computes the distance between to geo coordinates in meters.
Definition at line 180 of file locationutil.cpp.
◆ distance() [2/2]
int KItinerary::LocationUtil::distance | ( | double | lat1, |
double | lon1, | ||
double | lat2, | ||
double | lon2 ) |
Computes the distance between to geo coordinates in meters.
Definition at line 186 of file locationutil.cpp.
◆ geo()
GeoCoordinates KItinerary::LocationUtil::geo | ( | const QVariant & | location | ) |
Returns the geo coordinates of a given location.
Definition at line 119 of file locationutil.cpp.
◆ geoFromUrl()
GeoCoordinates KItinerary::LocationUtil::geoFromUrl | ( | const QUrl & | url | ) |
Parses geo coordinates from a given mapping service URLs, such as Google Maps links.
Definition at line 131 of file locationutil.cpp.
◆ geoUri()
Returns a geo: URI for the given location.
Definition at line 355 of file locationutil.cpp.
◆ isLocationChange()
bool KItinerary::LocationUtil::isLocationChange | ( | const QVariant & | res | ) |
Returns true
if the given reservation is a location change.
That is, some form of transport reservation with different departure and arrival locations.
Definition at line 42 of file locationutil.cpp.
◆ isSameLocation()
bool KItinerary::LocationUtil::isSameLocation | ( | const QVariant & | lhs, |
const QVariant & | rhs, | ||
LocationUtil::Accuracy | accuracy = Exact ) |
Returns true
if the given locations are the same.
- Parameters
-
lhs The left hand side in the location condition. rhs The right hand side in the location condition. accuracy Defines how closely the locations have to match.
Definition at line 302 of file locationutil.cpp.
◆ location()
Returns the location of a non-transport reservation.
This assumes isLocationChange(res) == false.
Definition at line 98 of file locationutil.cpp.
◆ name()
Returns a description of the location.
Definition at line 164 of file locationutil.cpp.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:37 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.