KItinerary::LocationUtil

KItinerary::LocationUtil Namespace Reference

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 (float lat1, float lon1, float lat2, float lon2)
 
GeoCoordinates geo (const QVariant &location)
 
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 (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 60 of file locationutil.h.

Function Documentation

◆ address()

PostalAddress KItinerary::LocationUtil::address ( const QVariant location)

Returns the address of the given location.

Definition at line 129 of file locationutil.cpp.

◆ arrivalLocation()

QVariant KItinerary::LocationUtil::arrivalLocation ( const QVariant res)

Returns the arrival location of the given reservation.

This assumes isLocationChange(res) == true.

Definition at line 53 of file locationutil.cpp.

◆ departureLocation()

QVariant KItinerary::LocationUtil::departureLocation ( const QVariant res)

Returns the departure location of the given reservation.

This assumes isLocationChange(res) == true.

Definition at line 73 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 157 of file locationutil.cpp.

◆ distance() [2/2]

int KItinerary::LocationUtil::distance ( float  lat1,
float  lon1,
float  lat2,
float  lon2 
)

Computes the distance between to geo coordinates in meters.

Definition at line 163 of file locationutil.cpp.

◆ geo()

GeoCoordinates KItinerary::LocationUtil::geo ( const QVariant location)

Returns the geo coordinates of a given location.

Definition at line 117 of file locationutil.cpp.

◆ geoUri()

QUrl KItinerary::LocationUtil::geoUri ( const QVariant location)

Returns a geo: URI for the given location.

Definition at line 312 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 40 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
lhsThe left hand side in the location condition.
rhsThe right hand side in the location condition.
accuracyDefines how closely the locations have to match.

Definition at line 264 of file locationutil.cpp.

◆ location()

QVariant KItinerary::LocationUtil::location ( const QVariant res)

Returns the location of a non-transport reservation.

This assumes isLocationChange(res) == false.

Definition at line 96 of file locationutil.cpp.

◆ QString()

KItinerary::LocationUtil::QString ( const QVariant location)

Returns a description of the location.

This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Wed Jun 29 2022 03:59:50 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.