QGeoRouteRequest Class
The QGeoRouteRequest class represents the parameters and restrictions which define a request for routing information. More...
| Header: | #include <QGeoRouteRequest> |
| qmake: | QT += location |
| Since: | Qt 5.6 |
This class was introduced in Qt 5.6.
Public Types
| enum | FeatureType { NoFeature, TollFeature, HighwayFeature, PublicTransitFeature, FerryFeature, …, TrafficFeature } |
| enum | FeatureWeight { NeutralFeatureWeight, PreferFeatureWeight, RequireFeatureWeight, AvoidFeatureWeight, DisallowFeatureWeight } |
| enum | ManeuverDetail { NoManeuvers, BasicManeuvers } |
| enum | RouteOptimization { ShortestRoute, FastestRoute, MostEconomicRoute, MostScenicRoute } |
| enum | SegmentDetail { NoSegmentData, BasicSegmentData } |
| enum | TravelMode { CarTravel, PedestrianTravel, BicycleTravel, PublicTransitTravel, TruckTravel } |
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.
Member Type Documentation
enum QGeoRouteRequest::FeatureType
Defines a feature which is important to the planning of a route.
These values will be used in combination with QGeoRouteRequest::FeatureWeight to determine if they should or should not be part of the route.
| Constant | Value | Description |
|---|---|---|
QGeoRouteRequest::NoFeature | 0x00000000 | Used by QGeoRoutingManager::supportedFeatureTypes() to indicate that no features will be taken into account when planning the route. |
QGeoRouteRequest::TollFeature | 0x00000001 | Consdier tollways when planning the route. |
QGeoRouteRequest::HighwayFeature | 0x00000002 | Consider highways when planning the route. |
QGeoRouteRequest::PublicTransitFeature | 0x00000004 | Consider public transit when planning the route. |
QGeoRouteRequest::FerryFeature | 0x00000008 | Consider ferries when planning the route. |
QGeoRouteRequest::TunnelFeature | 0x00000010 | Consider tunnels when planning the route. |
QGeoRouteRequest::DirtRoadFeature | 0x00000020 | Consider dirt roads when planning the route. |
QGeoRouteRequest::ParksFeature | 0x00000040 | Consider parks when planning the route. |
QGeoRouteRequest::MotorPoolLaneFeature | 0x00000080 | Consider motor pool lanes when planning the route. |
QGeoRouteRequest::TrafficFeature | 0x00000100 | Consider the current traffic situation when planning the route. Since QtLocation 5.10 |
enum 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 | Value | Description |
|---|---|---|
QGeoRouteRequest::NeutralFeatureWeight | 0x00000000 | The presence or absence of the feature will not affect the planning of the route. |
QGeoRouteRequest::PreferFeatureWeight | 0x00000001 | Routes which contain the feature will be preferred over those that do not. |
QGeoRouteRequest::RequireFeatureWeight | 0x00000002 | Only routes which contain the feature will be considered, otherwise no route will be returned. |
QGeoRouteRequest::AvoidFeatureWeight | 0x00000004 | Routes which do not contain the feature will be preferred over those that do. |
QGeoRouteRequest::DisallowFeatureWeight | 0x00000008 | Only routes which do not contain the feature will be considered, otherwise no route will be returned. |
enum QGeoRouteRequest::ManeuverDetail
Defines the amount of maneuver information that should be included with the route.
| Constant | Value | Description |
|---|---|---|
QGeoRouteRequest::NoManeuvers | 0x0000 | No maneuvers should be included with the route. |
QGeoRouteRequest::BasicManeuvers | 0x0001 | Basic manevuers will be included with the route. This will include QGeoManeuver::instructionText(). |
enum QGeoRouteRequest::RouteOptimization
Defines the type of optimization which is applied to the planning of the route.
| Constant | Value | Description |
|---|---|---|
QGeoRouteRequest::ShortestRoute | 0x0001 | Minimize the length of the journey. |
QGeoRouteRequest::FastestRoute | 0x0002 | Minimize the traveling time for the journey. |
QGeoRouteRequest::MostEconomicRoute | 0x0004 | Minimize the cost of the journey. |
QGeoRouteRequest::MostScenicRoute | 0x0008 | Maximize the scenic potential of the journey. |
enum QGeoRouteRequest::SegmentDetail
Defines the amount of route segment information that should be included with the route.
| Constant | Value | Description |
|---|---|---|
QGeoRouteRequest::NoSegmentData | 0x0000 | No segment data should be included with the route. A route requested with this level of segment detail will initialize QGeoRouteSegment::path() as a straight line between the positions of the previous and next QGeoManeuver instances. |
QGeoRouteRequest::BasicSegmentData | 0x0001 | Basic segment data will be included with the route. This will include QGeoRouteSegment::path(). |
enum QGeoRouteRequest::TravelMode
Defines modes of travel to be used for a route.
| Constant | Value | Description |
|---|---|---|
QGeoRouteRequest::CarTravel | 0x0001 | The route will be optimized for someone who is driving a car. |
QGeoRouteRequest::PedestrianTravel | 0x0002 | The route will be optimized for someone who is walking. |
QGeoRouteRequest::BicycleTravel | 0x0004 | The route will be optimized for someone who is riding a bicycle. |
QGeoRouteRequest::PublicTransitTravel | 0x0008 | The route will be optimized for someone who is making use of public transit. |
QGeoRouteRequest::TruckTravel | 0x0010 | The route will be optimized for someone who is driving a truck. |