- 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 metersmaneuverᅟ
- The maneuver for this route segmentpathᅟ
- The geometric shape of this route segment of the routetravelTimeᅟ
- The estimated amount of time, in seconds, that it will take to traverse this segment
Methods¶
def
__init__()
def
distance()
def
isValid()
def
maneuver()
def
__ne__()
def
__eq__()
def
path()
def
setDistance()
def
setManeuver()
def
setPath()
def
setTravelTime()
def
swap()
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
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 optionalQGeoManeuver
associated with the beginning of the route segment.QGeoRouteSegment
instances can be thought of as edges on a routing graph, withQGeoManeuver
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:
other –
QGeoRouteSegment
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:
Getter of property
maneuverᅟ
.- nextRouteSegment()¶
- Return type:
Returns the next route segment in the route.
Will return an invalid route segment if this is the last route segment in the route.
See also
- __ne__(rhs)¶
- Parameters:
rhs –
QGeoRouteSegment
- Return type:
bool
Returns whether the route segments
lhs
andrhs
are not equal.The value of
nextRouteSegment()
is not considered in the comparison.- __eq__(rhs)¶
- Parameters:
rhs –
QGeoRouteSegment
- Return type:
bool
Returns whether the route segments
lhs
andrhs
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:
maneuver –
QGeoManeuver
- setNextRouteSegment(routeSegment)¶
- Parameters:
routeSegment –
QGeoRouteSegment
Sets the next route segment in the route to
routeSegment
.See also
- setPath(path)¶
- Parameters:
path – .list of QGeoCoordinate
- setTravelTime(secs)¶
- Parameters:
secs – int
- swap(other)¶
- Parameters:
other –
QGeoRouteSegment
- travelTime()¶
- Return type:
int
Getter of property
travelTimeᅟ
.