The QGeoRouteRequest class represents the parameters and restrictions which define a request for routing information. More...
#include <QGeoRouteRequest>
This class was introduced in Qt Mobility 1.1.
enum | FeatureType { NoFeature, TollFeature, HighwayFeature, PublicTransitFeature, ..., MotorPoolLaneFeature } |
flags | FeatureTypes |
enum | FeatureWeight { NeutralFeatureWeight, PreferFeatureWeight, RequireFeatureWeight, AvoidFeatureWeight, DisallowFeatureWeight } |
flags | FeatureWeights |
enum | ManeuverDetail { NoManeuvers, BasicManeuvers } |
flags | ManeuverDetails |
enum | RouteOptimization { ShortestRoute, FastestRoute, MostEconomicRoute, MostScenicRoute } |
flags | RouteOptimizations |
enum | SegmentDetail { NoSegmentData, BasicSegmentData } |
flags | SegmentDetails |
enum | TravelMode { CarTravel, PedestrianTravel, BicycleTravel, PublicTransitTravel, TruckTravel } |
flags | TravelModes |
QGeoRouteRequest ( const QList<QGeoCoordinate> & waypoints = QList<QGeoCoordinate> () ) | |
QGeoRouteRequest ( const QGeoCoordinate & origin, const QGeoCoordinate & destination ) | |
QGeoRouteRequest ( const QGeoRouteRequest & other ) | |
~QGeoRouteRequest () | |
QList<QGeoBoundingBox> | excludeAreas () const |
QList<FeatureType> | featureTypes () const |
FeatureWeight | featureWeight ( FeatureType featureType ) const |
ManeuverDetail | maneuverDetail () const |
int | numberAlternativeRoutes () const |
RouteOptimizations | routeOptimization () const |
SegmentDetail | segmentDetail () const |
void | setExcludeAreas ( const QList<QGeoBoundingBox> & areas ) |
void | setFeatureWeight ( FeatureType featureType, FeatureWeight featureWeight ) |
void | setManeuverDetail ( ManeuverDetail maneuverDetail ) |
void | setNumberAlternativeRoutes ( int alternatives ) |
void | setRouteOptimization ( RouteOptimizations optimization ) |
void | setSegmentDetail ( SegmentDetail segmentDetail ) |
void | setTravelModes ( TravelModes travelModes ) |
void | setWaypoints ( const QList<QGeoCoordinate> & waypoints ) |
TravelModes | travelModes () const |
QList<QGeoCoordinate> | waypoints () const |
bool | operator!= ( const QGeoRouteRequest & other ) const |
QGeoRouteRequest & | operator= ( const QGeoRouteRequest & other ) |
bool | operator== ( const QGeoRouteRequest & other ) const |
The QGeoRouteRequest class represents the parameters and restrictions which define a request for routing information.
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 signifcant 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.
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. |
The FeatureTypes type is a typedef for QFlags<FeatureType>. It stores an OR combination of FeatureType values.
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. |
The FeatureWeights type is a typedef for QFlags<FeatureWeight>. It stores an OR combination of FeatureWeight values.
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(). |
The ManeuverDetails type is a typedef for QFlags<ManeuverDetail>. It stores an OR combination of ManeuverDetail values.
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. |
The RouteOptimizations type is a typedef for QFlags<RouteOptimization>. It stores an OR combination of RouteOptimization values.
Defines the amount of route segment information that shoudl 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 initialise 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(). |
The SegmentDetails type is a typedef for QFlags<SegmentDetail>. It stores an OR combination of SegmentDetail values.
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. |
The TravelModes type is a typedef for QFlags<TravelMode>. It stores an OR combination of TravelMode values.
Constructs a request to calculate a route through the coordinates waypoints.
The route will traverse the elements of waypoints in order.
This function was introduced in Qt Mobility 1.1.
Constructs a request to calculate a route between origin and destination.
This function was introduced in Qt Mobility 1.1.
Constructs a route request object from the contents of other.
This function was introduced in Qt Mobility 1.1.
Destroys the request.
Returns areas the route must not cross.
This function was introduced in Qt Mobility 1.1.
See also setExcludeAreas().
Returns the list of features that will be considered when planning the route. Features with a weight of NeutralFeatureWeight will not be returned.
This function was introduced in Qt Mobility 1.1.
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.
This function was introduced in Qt Mobility 1.1.
See also setFeatureWeight().
Returns the level of detail which will be used in the representation of routing maneuvers.
This function was introduced in Qt Mobility 1.1.
See also setManeuverDetail().
Returns the number of alternative routes which will be requested.
This function was introduced in Qt Mobility 1.1.
See also setNumberAlternativeRoutes().
Returns the optimization criteria which this request specifies should be used while planning the route.
This function was introduced in Qt Mobility 1.1.
See also setRouteOptimization().
Returns the level of detail which will be used in the representation of routing segments.
This function was introduced in Qt Mobility 1.1.
See also setSegmentDetail().
Sets areas as excluded areas that the route must not cross.
This function was introduced in Qt Mobility 1.1.
See also excludeAreas().
Assigns the weight featureWeight to the feauture 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 QGeoRouteRequest::NoFeature.
This function was introduced in Qt Mobility 1.1.
See also featureWeight().
Sets the level of detail to use when representing routing maneuvers to maneuverDetail.
The default value is QGeoRouteRequest::BasicManeuvers.
This function was introduced in Qt Mobility 1.1.
See also maneuverDetail().
Sets the number of alternative routes to request to alternatives.
The default value is 0.
This function was introduced in Qt Mobility 1.1.
See also numberAlternativeRoutes().
Sets the optimization criteria to use while planning the route to optimization.
The default value is QGeoRouteRequest::FastestRoute.
This function was introduced in Qt Mobility 1.1.
See also routeOptimization().
Sets the level of detail to use when representing routing segments to segmentDetail.
This function was introduced in Qt Mobility 1.1.
See also segmentDetail().
Sets the travel modes which should be considered during the planning of the route to travelModes.
The default value is QGeoRouteRequest::CarTravel.
This function was introduced in Qt Mobility 1.1.
See also travelModes().
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.
This function was introduced in Qt Mobility 1.1.
See also waypoints().
Returns the travel modes which this request specifies should be considered during the planning of the route.
This function was introduced in Qt Mobility 1.1.
See also setTravelModes().
Returns the waypoints that the route will pass through.
This function was introduced in Qt Mobility 1.1.
See also setWaypoints().
Returns whether this route request and other are equal.
This function was introduced in Qt Mobility 1.1.
Assigns other to this route request object and then returns a reference to this route request object.
This function was introduced in Qt Mobility 1.1.
Returns whether this route request and other are equal.
This function was introduced in Qt Mobility 1.1.
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.