QGeoRouteRequestclass represents the parameters and restrictions which define a request for routing information. 更多 …
def
__eq__
(other)
def
__ne__
(other)
def
departureTime
()
def
excludeAreas
()
def
extraParameters
()
def
featureTypes
()
def
featureWeight
(featureType)
def
maneuverDetail
()
def
numberAlternativeRoutes
()
def
routeOptimization
()
def
segmentDetail
()
def
setDepartureTime
(departureTime)
def
setExcludeAreas
(areas)
def
setExtraParameters
(extraParameters)
def
setFeatureWeight
(featureType, featureWeight)
def
setManeuverDetail
(maneuverDetail)
def
setNumberAlternativeRoutes
(alternatives)
def
setRouteOptimization
(optimization)
def
setSegmentDetail
(segmentDetail)
def
setTravelModes
(travelModes)
def
setWaypoints
(waypoints)
def
setWaypointsMetadata
(waypointMetadata)
def
travelModes
()
def
waypoints
()
def
waypointsMetadata
()
The default state of a
QGeoRouteRequestinstance 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
QGeoRoutingManagerwhich can be used to check which features are supported with the current provider and authorization level.另请参阅
QGeoRoutingManager
QGeoRouteRequest
(
origin
,
destination
)
¶
QGeoRouteRequest(other)
QGeoRouteRequest([waypoints=list()])
- param origin
QGeoCoordinate- param destination
QGeoCoordinate- param other
- 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
|
|
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
|
|
QGeoRouteRequest.BasicSegmentData |
Basic segment data will be included with the route. This will include
|
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
|
PySide2.QtLocation.QGeoRouteRequest.
departureTime
(
)
¶
QDateTime
Returns the departure time in the request.
另请参阅
PySide2.QtLocation.QGeoRouteRequest.
excludeAreas
(
)
¶
Returns areas the route must not cross.
另请参阅
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
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
(
)
¶
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
(
)
¶
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
.
另请参阅
PySide2.QtLocation.QGeoRouteRequest.
setExcludeAreas
(
areas
)
¶
areas –
集
areas
as excluded areas that the route must not cross.
另请参阅
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.
另请参阅
PySide2.QtLocation.QGeoRouteRequest.
setFeatureWeight
(
featureType
,
featureWeight
)
¶
featureType
–
FeatureType
featureWeight
–
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
.
另请参阅
PySide2.QtLocation.QGeoRouteRequest.
setManeuverDetail
(
maneuverDetail
)
¶
maneuverDetail
–
ManeuverDetail
Sets the level of detail to use when representing routing maneuvers to
maneuverDetail
.
默认值为
BasicManeuvers
.
另请参阅
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
.
另请参阅
PySide2.QtLocation.QGeoRouteRequest.
setTravelModes
(
travelModes
)
¶
travelModes
–
TravelModes
Sets the travel modes which should be considered during the planning of the route to
travelModes
.
默认值为
CarTravel
.
另请参阅
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.
另请参阅
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.
另请参阅
PySide2.QtLocation.QGeoRouteRequest.
waypoints
(
)
¶
Returns the waypoints that the route will pass through.
另请参阅
PySide2.QtLocation.QGeoRouteRequest.
waypointsMetadata
(
)
¶
Returns the metadata for the waypoints in this request.