QGeoRoute

The QGeoRoute class represents a route between two points. More

Inheritance diagram of PySide2.QtLocation.QGeoRoute

Synopsis

Functions

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 of QGeoRouteSegment objecs which describe subsections of the route in greater detail.

Routing information is normally requested using calculateRoute() , which returns a QGeoRouteReply instance. If the operation is completed successfully the routing information can be accessed with routes()

class PySide2.QtLocation.QGeoRoute

PySide2.QtLocation.QGeoRoute(other)

param other:

PySide2.QtLocation.QGeoRoute

Constructs a route object.

PySide2.QtLocation.QGeoRoute.bounds()
Return type:

PySide2.QtPositioning.QGeoRectangle

Returns a bounding box which encompasses the entire route.

See also

setBounds()

PySide2.QtLocation.QGeoRoute.distance()
Return type:

float

Returns the distance covered by this route, in meters.

See also

setDistance()

PySide2.QtLocation.QGeoRoute.extendedAttributes()
Return type:

Returns the extended attributes associated with this route.

PySide2.QtLocation.QGeoRoute.firstRouteSegment()
Return type:

PySide2.QtLocation.QGeoRouteSegment

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 .

PySide2.QtLocation.QGeoRoute.__ne__(other)
Parameters:

otherPySide2.QtLocation.QGeoRoute

Return type:

bool

Returns whether this route and other are not equal.

PySide2.QtLocation.QGeoRoute.__eq__(other)
Parameters:

otherPySide2.QtLocation.QGeoRoute

Return type:

bool

Returns whether this route and other are equal.

PySide2.QtLocation.QGeoRoute.path()
Return type:

Returns 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.

See also

setPath()

PySide2.QtLocation.QGeoRoute.request()
Return type:

PySide2.QtLocation.QGeoRouteRequest

Returns the route request which describes the criteria used in the calculation of this route.

See also

setRequest()

PySide2.QtLocation.QGeoRoute.routeId()
Return type:

str

Returns the identifier of this route.

Service providers which support the updating of routes commonly assign identifiers to routes. If this route did not come from such a service provider the function will return an empty string.

See also

setRouteId()

PySide2.QtLocation.QGeoRoute.setBounds(bounds)
Parameters:

boundsPySide2.QtPositioning.QGeoRectangle

Sets the bounding box which encompasses the entire route to bounds .

See also

bounds()

PySide2.QtLocation.QGeoRoute.setDistance(distance)
Parameters:

distance – float

Sets the distance covered by this route, in meters, to distance .

See also

distance()

PySide2.QtLocation.QGeoRoute.setExtendedAttributes(extendedAttributes)
Parameters:

extendedAttributes

Sets the extended attributes extendedAttributes associated with this route.

PySide2.QtLocation.QGeoRoute.setFirstRouteSegment(routeSegment)
Parameters:

routeSegmentPySide2.QtLocation.QGeoRouteSegment

Sets the first route segment in the route to routeSegment .

PySide2.QtLocation.QGeoRoute.setPath(path)
Parameters:

path

Sets the geometric shape of the route to path .

The coordinates in path should be listed in the order in which they would be traversed by someone traveling along this segment of the route.

See also

path()

PySide2.QtLocation.QGeoRoute.setRequest(request)
Parameters:

requestPySide2.QtLocation.QGeoRouteRequest

Sets the route request which describes the criteria used in the calculcation of this route to request .

See also

request()

PySide2.QtLocation.QGeoRoute.setRouteId(id)
Parameters:

id – str

Sets the identifier of this route to id .

Service providers which support the updating of routes commonly assign identifiers to routes. If this route came from such a service provider changing the identifier will probably cause route updates to stop working.

See also

routeId()

PySide2.QtLocation.QGeoRoute.setTravelMode(mode)
Parameters:

modeTravelMode

Sets the travel mode for this route to mode .

This should be one of the travel modes returned by request() .travelModes().

See also

travelMode()

PySide2.QtLocation.QGeoRoute.setTravelTime(secs)
Parameters:

secs – int

Sets the estimated amount of time it will take to traverse this route, in seconds, to secs .

See also

travelTime()

PySide2.QtLocation.QGeoRoute.travelMode()
Return type:

TravelMode

Returns the travel mode for the this route.

This should be one of the travel modes returned by request() .travelModes().

See also

setTravelMode()

PySide2.QtLocation.QGeoRoute.travelTime()
Return type:

int

Returns the estimated amount of time it will take to traverse this route, in seconds.

See also

setTravelTime()