class QGeoRouteSegment

The QGeoRouteSegment class represents a segment of a route. More

Synopsis

Properties

  • distanceᅟ - The distance covered by this segment of the route, in meters

  • maneuverᅟ - The maneuver for this route segment

  • pathᅟ - The geometric shape of this route segment of the route

  • travelTimeᅟ - The estimated amount of time, in seconds, that it will take to traverse this segment

Methods

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 QGeoRouteSegment instance has information about the physical layout of the route segment, the length of the route and estimated time required to traverse the route segment and an optional QGeoManeuver associated with the beginning of the route segment.

QGeoRouteSegment instances can be thought of as edges on a routing graph, with QGeoManeuver instances as optional labels attached to the vertices of the graph.

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property distanceᅟ: float

This property holds the distance covered by this segment of the route, in meters..

Access functions:
property maneuverᅟ: QGeoManeuver

This property holds the maneuver for this route segment..

Holds an invalid QGeoManeuver if no information has been attached to the starting point of this route segment.

Access functions:
property pathᅟ: list of QGeoCoordinate

This property holds the geometric shape of this route segment 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.

Access functions:
property travelTimeᅟ: int

This property holds the estimated amount of time, in seconds, that it will take to traverse this segment..

Access functions:
__init__()

Constructs an invalid route segment object.

The route segment will remain invalid until one of setNextRouteSegment() , setTravelTime(), setDistance(), setPath() or setManeuver() is called.

__init__(other)
Parameters:

otherQGeoRouteSegment

Constructs a route segment object from the contents of other.

distance()
Return type:

float

Getter of property distanceᅟ .

isLegLastSegment()
Return type:

bool

Returns whether this route segment is the last segment of a route leg.

isValid()
Return type:

bool

Returns whether this route segment is valid or not.

If nextRouteSegment() is called on the last route segment of a route, the returned value will be an invalid route segment.

maneuver()
Return type:

QGeoManeuver

Getter of property maneuverᅟ .

nextRouteSegment()
Return type:

QGeoRouteSegment

Returns the next route segment in the route.

Will return an invalid route segment if this is the last route segment in the route.

__ne__(rhs)
Parameters:

rhsQGeoRouteSegment

Return type:

bool

Returns whether the route segments lhs and rhs are not equal.

The value of nextRouteSegment() is not considered in the comparison.

__eq__(rhs)
Parameters:

rhsQGeoRouteSegment

Return type:

bool

Returns whether the route segments lhs and rhs are equal.

The value of nextRouteSegment() is not considered in the comparison.

path()
Return type:

.list of QGeoCoordinate

Getter of property pathᅟ .

setDistance(distance)
Parameters:

distance – float

setManeuver(maneuver)
Parameters:

maneuverQGeoManeuver

setNextRouteSegment(routeSegment)
Parameters:

routeSegmentQGeoRouteSegment

Sets the next route segment in the route to routeSegment.

setPath(path)
Parameters:

path – .list of QGeoCoordinate

setTravelTime(secs)
Parameters:

secs – int

swap(other)
Parameters:

otherQGeoRouteSegment

travelTime()
Return type:

int

Getter of property travelTimeᅟ .