内容表

上一话题

QGeoRouteReply

下一话题

QGeoRouteSegment

QGeoRouteRequest

QGeoRouteRequest class represents the parameters and restrictions which define a request for routing information. 更多

Inheritance diagram of PySide2.QtLocation.QGeoRouteRequest

概要

函数

详细描述

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.

另请参阅

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.

常量

描述

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.

常量

描述

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.

常量

描述

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.

常量

描述

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.

常量

描述

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 实例。

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.

常量

描述

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. departureTime ( )
返回类型

QDateTime

Returns the departure time in the request.

PySide2.QtLocation.QGeoRouteRequest. excludeAreas ( )
返回类型

Returns areas the route must not cross.

另请参阅

setExcludeAreas()

PySide2.QtLocation.QGeoRouteRequest. extraParameters ( )
返回类型

Returns the extra parameters set for this route request.

PySide2.QtLocation.QGeoRouteRequest. featureTypes ( )
返回类型

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 )
参数

featureType FeatureType

返回类型

FeatureWeight

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

If no feature weight has been specified for featureType then NeutralFeatureWeight 将被返回。

PySide2.QtLocation.QGeoRouteRequest. maneuverDetail ( )
返回类型

ManeuverDetail

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

PySide2.QtLocation.QGeoRouteRequest. numberAlternativeRoutes ( )
返回类型

int

Returns the number of alternative routes which will be requested.

PySide2.QtLocation.QGeoRouteRequest. __ne__ ( other )
参数

other QGeoRouteRequest

返回类型

bool

Returns whether this route request and other are equal.

PySide2.QtLocation.QGeoRouteRequest. __eq__ ( other )
参数

other QGeoRouteRequest

返回类型

bool

Returns whether this route request and other are equal.

PySide2.QtLocation.QGeoRouteRequest. routeOptimization ( )
返回类型

RouteOptimizations

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

PySide2.QtLocation.QGeoRouteRequest. segmentDetail ( )
返回类型

SegmentDetail

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

PySide2.QtLocation.QGeoRouteRequest. setDepartureTime ( departureTime )
参数

departureTime QDateTime

Sets the departure time departureTime for the route calculation. This information can be used by the backend to calculate a faster route, for example, by avoiding traffic congestion during rush hour.

The default value is an invalid QDateTime .

另请参阅

departureTime()

PySide2.QtLocation.QGeoRouteRequest. setExcludeAreas ( areas )
参数

areas

areas as excluded areas that the route must not cross.

另请参阅

excludeAreas()

PySide2.QtLocation.QGeoRouteRequest. setExtraParameters ( extraParameters )
参数

extraParameters

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

另请参阅

extraParameters()

PySide2.QtLocation.QGeoRouteRequest. setFeatureWeight ( featureType , featureWeight )
参数

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 .

另请参阅

featureWeight()

PySide2.QtLocation.QGeoRouteRequest. setManeuverDetail ( maneuverDetail )
参数

maneuverDetail ManeuverDetail

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

默认值为 BasicManeuvers .

另请参阅

maneuverDetail()

PySide2.QtLocation.QGeoRouteRequest. setNumberAlternativeRoutes ( alternatives )
参数

alternatives int

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

默认值为 0。

PySide2.QtLocation.QGeoRouteRequest. setRouteOptimization ( optimization )
参数

optimization RouteOptimizations

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

默认值为 FastestRoute .

PySide2.QtLocation.QGeoRouteRequest. setSegmentDetail ( segmentDetail )
参数

segmentDetail SegmentDetail

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

另请参阅

segmentDetail()

PySide2.QtLocation.QGeoRouteRequest. setTravelModes ( travelModes )
参数

travelModes TravelModes

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

默认值为 CarTravel .

另请参阅

travelModes()

PySide2.QtLocation.QGeoRouteRequest. setWaypoints ( waypoints )
参数

waypoints

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.

另请参阅

waypoints()

PySide2.QtLocation.QGeoRouteRequest. setWaypointsMetadata ( waypointMetadata )
参数

waypointMetadata

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 ( )
返回类型

TravelModes

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

另请参阅

setTravelModes()

PySide2.QtLocation.QGeoRouteRequest. waypoints ( )
返回类型

Returns the waypoints that the route will pass through.

另请参阅

setWaypoints()

PySide2.QtLocation.QGeoRouteRequest. waypointsMetadata ( )
返回类型

Returns the metadata for the waypoints in this request.