PySide6.QtLocation.QGeoRoute¶
- class QGeoRoute¶
The
QGeoRoute
class represents a route between two points. More…Synopsis¶
Properties¶
boundsᅟ
- The bounding box which encompasses the entire routedistanceᅟ
- The distance covered by this route, in metersextendedAttributesᅟ
- The extended attributes associated with this routelegIndexᅟ
- The leg index of this routeoverallRouteᅟ
- The route that contains this route legpathᅟ
- The geometric shape of the routerouteIdᅟ
- The identifier of this routerouteLegsᅟ
- The route legs for a multi-waypoint routesegmentsᅟ
- The list of QGeoRouteSegment objects of this routesegmentsCountᅟ
- The number of segments in the routetravelTimeᅟ
- The estimated amount of time it will take to traverse this route, in seconds
Methods¶
def
__init__()
def
bounds()
def
distance()
def
legIndex()
def
__ne__()
def
__eq__()
def
overallRoute()
def
path()
def
request()
def
routeId()
def
routeLegs()
def
segments()
def
segmentsCount()
def
setBounds()
def
setDistance()
def
setLegIndex()
def
setPath()
def
setRequest()
def
setRouteId()
def
setRouteLegs()
def
setTravelMode()
def
setTravelTime()
def
swap()
def
travelMode()
def
travelTime()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
A
QGeoRoute
object contains high level information about a route, such as the length the route, the estimated travel time for the route, and enough information to render a basic image of the route on a map.The
QGeoRoute
object also contains a list ofQGeoRouteSegment
objecs which describe subsections of the route in greater detail.Routing information is normally requested using
calculateRoute()
, which returns aQGeoRouteReply
instance. If the operation is completed successfully the routing information can be accessed withroutes()
See also
Note
Properties can be used directly when
from __feature__ import true_property
is used or via accessor functions otherwise.- property boundsᅟ: QGeoRectangle¶
This property holds the bounding box which encompasses the entire route.
- Access functions:
- property distanceᅟ: float¶
This property holds the distance covered by this route, in meters.
- Access functions:
- property extendedAttributesᅟ: Dictionary with keys of type .QString and values of type QVariant.¶
This property holds the extended attributes associated with this route.
- Access functions:
- property legIndexᅟ: int¶
This property holds the leg index of this route.
The index of the leg inside the containing
routeLegs
list can be used to find the next legs.- Access functions:
This property holds the route that contains this route leg.
This this route is not a leg within an overall route, then this property holds an empty route.
- Access functions:
- property pathᅟ: list of QGeoCoordinate¶
This property holds the geometric shape of the route.
The coordinates should be listed in the order in which they would be traversed by someone traveling along this segment of the route.
- property routeIdᅟ: str¶
This property holds the identifier of this route.
Service providers which support the updating of routes commonly assign identifiers to routes. If this route came from such a service provider, then changing the identifier will probably cause route updates to stop working.
- Access functions:
- property routeLegsᅟ: list of QGeoRoute¶
This property holds the route
legs
for a multi-waypoint route.- Access functions:
- property segmentsᅟ: list of QGeoRouteSegment¶
This property holds the list of
QGeoRouteSegment
objects of this route.- Access functions:
- property segmentsCountᅟ: int¶
This property holds the number of segments in the route.
- Access functions:
- property travelTimeᅟ: int¶
This property holds the estimated amount of time it will take to traverse this route, in seconds.
- Access functions:
- __init__()¶
Constructs a route object.
- __init__(other)
- Parameters:
other –
QGeoRoute
Constructs a route object from the contents of
other
.- bounds()¶
- Return type:
Getter of property
boundsᅟ
.- distance()¶
- Return type:
float
Getter of property
distanceᅟ
.- extendedAttributes()¶
- Return type:
Dictionary with keys of type .QString and values of type QVariant.
Getter of property
extendedAttributesᅟ
.- firstRouteSegment()¶
- Return type:
Returns the first route segment in the route.
Will return an invalid route segment if there are no route segments associated with the route.
The remaining route segments can be accessed sequentially with
nextRouteSegment
.See also
- legIndex()¶
- Return type:
int
Getter of property
legIndexᅟ
.Returns whether the routes
lhs
andrhs
are not equal.Returns whether the routes
lhs
andrhs
are equal.Getter of property
overallRouteᅟ
.- path()¶
- Return type:
.list of QGeoCoordinate
See also
Getter of property
pathᅟ
.- request()¶
- Return type:
- routeId()¶
- Return type:
str
Getter of property
routeIdᅟ
.Getter of property
routeLegsᅟ
.- segments()¶
- Return type:
.list of QGeoRouteSegment
Getter of property
segmentsᅟ
.- segmentsCount()¶
- Return type:
int
Getter of property
segmentsCountᅟ
.- setBounds(bounds)¶
- Parameters:
bounds –
QGeoRectangle
- setDistance(distance)¶
- Parameters:
distance – float
- setExtendedAttributes(extendedAttributes)¶
- Parameters:
extendedAttributes – Dictionary with keys of type .QString and values of type QVariant.
- setFirstRouteSegment(routeSegment)¶
- Parameters:
routeSegment –
QGeoRouteSegment
Sets the first route segment in the route to
routeSegment
.See also
- setLegIndex(idx)¶
- Parameters:
idx – int
Setter of property
pathᅟ
.- setRequest(request)¶
- Parameters:
request –
QGeoRouteRequest
- setRouteId(id)¶
- Parameters:
id – str
- setRouteLegs(legs)¶
- Parameters:
legs – .list of QGeoRoute
- setTravelMode(mode)¶
- Parameters:
mode –
TravelMode
Sets the travel mode for this route to
mode
.This should be one of the travel modes returned by request().travelModes().
See also
- setTravelTime(secs)¶
- Parameters:
secs – int
- travelMode()¶
- Return type:
Returns the travel mode for the this route.
This should be one of the travel modes returned by request().travelModes().
See also
- travelTime()¶
- Return type:
int
Getter of property
travelTimeᅟ
.