QGeoRouteRequest

The QGeoRouteRequest class represents the parameters and restrictions which define a request for routing information. More

Inheritance diagram of PySide2.QtLocation.QGeoRouteRequest

Synopsis

Functions

Detailed Description

The default state of a QGeoRouteRequest instance will result in a request for basic route segment and navigation maneuvers describing the fastest route by car which covers the given waypoints.

There may be significant variation in the features supported by different providers of routing information, or even in the features supported by the same provider if different levels of authorization are used.

There are several functions in QGeoRoutingManager which can be used to check which features are supported with the current provider and authorization level.

See also

QGeoRoutingManager

class QGeoRouteRequest(origin, destination)

QGeoRouteRequest(other)

QGeoRouteRequest([waypoints=list()])

param origin

QGeoCoordinate

param destination

QGeoCoordinate

param other

QGeoRouteRequest

param waypoints

Constructs a request to calculate a route between origin and destination .

PySide2.QtLocation.QGeoRouteRequest.TravelMode

Defines modes of travel to be used for a route.

Constant

Description

QGeoRouteRequest.CarTravel

The route will be optimized for someone who is driving a car.

QGeoRouteRequest.PedestrianTravel

The route will be optimized for someone who is walking.

QGeoRouteRequest.BicycleTravel

The route will be optimized for someone who is riding a bicycle.

QGeoRouteRequest.PublicTransitTravel

The route will be optimized for someone who is making use of public transit.

QGeoRouteRequest.TruckTravel

The route will be optimized for someone who is driving a truck.

PySide2.QtLocation.QGeoRouteRequest.FeatureType

Defines a feature which is important to the planning of a route.

These values will be used in combination with FeatureWeight to determine if they should or should not be part of the route.

Constant

Description

QGeoRouteRequest.NoFeature

Used by supportedFeatureTypes() to indicate that no features will be taken into account when planning the route.

QGeoRouteRequest.TollFeature

Consdier tollways when planning the route.

QGeoRouteRequest.HighwayFeature

Consider highways when planning the route.

QGeoRouteRequest.PublicTransitFeature

Consider public transit when planning the route.

QGeoRouteRequest.FerryFeature

Consider ferries when planning the route.

QGeoRouteRequest.TunnelFeature

Consider tunnels when planning the route.

QGeoRouteRequest.DirtRoadFeature

Consider dirt roads when planning the route.

QGeoRouteRequest.ParksFeature

Consider parks when planning the route.

QGeoRouteRequest.MotorPoolLaneFeature

Consider motor pool lanes when planning the route.

QGeoRouteRequest.TrafficFeature

Consider the current traffic situation when planning the route. Since QtLocation 5.10

PySide2.QtLocation.QGeoRouteRequest.FeatureWeight

Defines the weight to associate with a feature during the planning of a route.

These values will be used in combination with QGeoRouteRequest::Feature to determine if they should or should not be part of the route.

Constant

Description

QGeoRouteRequest.NeutralFeatureWeight

The presence or absence of the feature will not affect the planning of the route.

QGeoRouteRequest.PreferFeatureWeight

Routes which contain the feature will be preferred over those that do not.

QGeoRouteRequest.RequireFeatureWeight

Only routes which contain the feature will be considered, otherwise no route will be returned.

QGeoRouteRequest.AvoidFeatureWeight

Routes which do not contain the feature will be preferred over those that do.

QGeoRouteRequest.DisallowFeatureWeight

Only routes which do not contain the feature will be considered, otherwise no route will be returned.

PySide2.QtLocation.QGeoRouteRequest.RouteOptimization

Defines the type of optimization which is applied to the planning of the route.

Constant

Description

QGeoRouteRequest.ShortestRoute

Minimize the length of the journey.

QGeoRouteRequest.FastestRoute

Minimize the traveling time for the journey.

QGeoRouteRequest.MostEconomicRoute

Minimize the cost of the journey.

QGeoRouteRequest.MostScenicRoute

Maximize the scenic potential of the journey.

PySide2.QtLocation.QGeoRouteRequest.SegmentDetail

Defines the amount of route segment information that should be included with the route.

Constant

Description

QGeoRouteRequest.NoSegmentData

No segment data should be included with the route. A route requested with this level of segment detail will initialize path() as a straight line between the positions of the previous and next QGeoManeuver instances.

QGeoRouteRequest.BasicSegmentData

Basic segment data will be included with the route. This will include path() .

PySide2.QtLocation.QGeoRouteRequest.ManeuverDetail

Defines the amount of maneuver information that should be included with the route.

Constant

Description

QGeoRouteRequest.NoManeuvers

No maneuvers should be included with the route.

QGeoRouteRequest.BasicManeuvers

Basic manevuers will be included with the route. This will include instructionText() .

PySide2.QtLocation.QGeoRouteRequest.excludeAreas()
Return type

Returns areas the route must not cross.

PySide2.QtLocation.QGeoRouteRequest.extraParameters()
Return type

QVariantMap

Returns the extra parameters set for this route request.

PySide2.QtLocation.QGeoRouteRequest.featureTypes()
Return type

Returns the list of features that will be considered when planning the route. Features with a weight of NeutralFeatureWeight will not be returned.

PySide2.QtLocation.QGeoRouteRequest.featureWeight(featureType)
Parameters

featureTypeFeatureType

Return type

FeatureWeight

Returns the weight assigned to featureType in the planning of the route.

If no feature weight has been specified for featureType then NeutralFeatureWeight will be returned.

PySide2.QtLocation.QGeoRouteRequest.maneuverDetail()
Return type

ManeuverDetail

Returns the level of detail which will be used in the representation of routing maneuvers.

PySide2.QtLocation.QGeoRouteRequest.numberAlternativeRoutes()
Return type

int

Returns the number of alternative routes which will be requested.

PySide2.QtLocation.QGeoRouteRequest.__ne__(other)
Parameters

otherQGeoRouteRequest

Return type

bool

Returns whether this route request and other are equal.

PySide2.QtLocation.QGeoRouteRequest.__eq__(other)
Parameters

otherQGeoRouteRequest

Return type

bool

Returns whether this route request and other are equal.

PySide2.QtLocation.QGeoRouteRequest.routeOptimization()
Return type

RouteOptimizations

Returns the optimization criteria which this request specifies should be used while planning the route.

PySide2.QtLocation.QGeoRouteRequest.segmentDetail()
Return type

SegmentDetail

Returns the level of detail which will be used in the representation of routing segments.

PySide2.QtLocation.QGeoRouteRequest.setExcludeAreas(areas)
Parameters

areas

Sets areas as excluded areas that the route must not cross.

See also

excludeAreas()

PySide2.QtLocation.QGeoRouteRequest.setExtraParameters(extraParameters)
Parameters

extraParametersQVariantMap

Sets the extra parameters extraParameters for the route request. The format of the extra parameters is plugin specific, and documented per plugin.

PySide2.QtLocation.QGeoRouteRequest.setFeatureWeight(featureType, featureWeight)
Parameters

Assigns the weight featureWeight to the feature featureType during the planning of the route.

By default all features are assigned a weight of NeutralFeatureWeight .

It is impossible to assign a weight to NoFeature .

See also

featureWeight()

PySide2.QtLocation.QGeoRouteRequest.setManeuverDetail(maneuverDetail)
Parameters

maneuverDetailManeuverDetail

Sets the level of detail to use when representing routing maneuvers to maneuverDetail .

The default value is BasicManeuvers .

See also

maneuverDetail()

PySide2.QtLocation.QGeoRouteRequest.setNumberAlternativeRoutes(alternatives)
Parameters

alternativesint

Sets the number of alternative routes to request to alternatives . If alternatives is negative the number of alternative routes is set to 0.

The default value is 0.

PySide2.QtLocation.QGeoRouteRequest.setRouteOptimization(optimization)
Parameters

optimizationRouteOptimizations

Sets the optimization criteria to use while planning the route to optimization .

The default value is FastestRoute .

PySide2.QtLocation.QGeoRouteRequest.setSegmentDetail(segmentDetail)
Parameters

segmentDetailSegmentDetail

Sets the level of detail to use when representing routing segments to segmentDetail .

See also

segmentDetail()

PySide2.QtLocation.QGeoRouteRequest.setTravelModes(travelModes)
Parameters

travelModesTravelModes

Sets the travel modes which should be considered during the planning of the route to travelModes .

The default value is CarTravel .

See also

travelModes()

PySide2.QtLocation.QGeoRouteRequest.setWaypoints(waypoints)
Parameters

waypoints

Sets waypoints as the waypoints that the route should pass through.

The waypoints should be given in order from origin to destination.

This request will be invalid until the waypoints have been set to a list containing two or more coordinates.

See also

waypoints()

PySide2.QtLocation.QGeoRouteRequest.setWaypointsMetadata(waypointMetadata)
Parameters

waypointMetadata

Sets waypointMetadata as the metadata for the waypoints set in this request. The metadata are intended as one QVariantMap per waypoint, given in the same order as the waypoints.

The content of the QVariantMap is somehow backend-specific, but properties that can be specified using Waypoint elements in QML can be assumed to be named and to work the same way across plugins, where supported.

PySide2.QtLocation.QGeoRouteRequest.travelModes()
Return type

TravelModes

Returns the travel modes which this request specifies should be considered during the planning of the route.

See also

setTravelModes()

PySide2.QtLocation.QGeoRouteRequest.waypoints()
Return type

Returns the waypoints that the route will pass through.

See also

setWaypoints()

PySide2.QtLocation.QGeoRouteRequest.waypointsMetadata()
Return type

Returns the metadata for the waypoints in this request.