Qt Mobility Reference Documentation

QGeoRouteRequest Class Reference

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

 #include <QGeoRouteRequest>

Public Types

enum AvoidFeatureType { AvoidNothing, AvoidTolls, AvoidHighways, AvoidPublicTransit, ..., AvoidMotorPoolLanes }
flags AvoidFeatureTypes
enum InstructionDetail { NoInstructions, BasicInstructions }
flags InstructionDetails
enum RouteOptimization { ShortestRoute, FastestRoute, MostEconomicRoute, MostScenicRoute }
flags RouteOptimizations
enum SegmentDetail { NoSegmentData, BasicSegmentData }
flags SegmentDetails
enum TravelMode { CarTravel, PedestrianTravel, BicycleTravel, PublicTransitTravel, TruckTravel }
flags TravelModes

Public Functions

QGeoRouteRequest ( const QList<QGeoCoordinate> & waypoints = QList<QGeoCoordinate> () )
QGeoRouteRequest ( const QGeoCoordinate & origin, const QGeoCoordinate & destination )
QGeoRouteRequest ( const QGeoRouteRequest & other )
~QGeoRouteRequest ()
AvoidFeatureTypes avoidFeatureTypes () const
QList<QGeoBoundingBox> excludeAreas () const
InstructionDetail instructionDetail () const
int numberAlternativeRoutes () const
RouteOptimizations routeOptimization () const
SegmentDetail segmentDetail () const
void setAvoidFeatureTypes ( AvoidFeatureTypes avoidFeatureTypes )
void setExcludeAreas ( const QList<QGeoBoundingBox> & areas )
void setInstructionDetail ( InstructionDetail instructionDetail )
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

Detailed Description

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 instructions 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.


Member Type Documentation

enum QGeoRouteRequest::AvoidFeatureType
flags QGeoRouteRequest::AvoidFeatureTypes

Defines features to be avoided while planning a route.

ConstantValueDescription
QGeoRouteRequest::AvoidNothing0x00000000The route can be planned without considering features to be avoided.
QGeoRouteRequest::AvoidTolls0x00000001Avoid routes that require the use of tollways.
QGeoRouteRequest::AvoidHighways0x00000002Avoid routes that require the use of highways.
QGeoRouteRequest::AvoidPublicTransit0x00000004Avoid routes that require the use of public transit.
QGeoRouteRequest::AvoidFerries0x00000008Avoid routes that require the use of ferries.
QGeoRouteRequest::AvoidTunnels0x00000010Avoid routes that require the use of tunnels.
QGeoRouteRequest::AvoidDirtRoads0x00000020Avoid routes that require the use of dirt roads.
QGeoRouteRequest::AvoidPark0x00000040Avoid routes that require the travel through parks.
QGeoRouteRequest::AvoidMotorPoolLanes0x00000080Avoid routes that require the use of motor pool lanes.

The AvoidFeatureTypes type is a typedef for QFlags<AvoidFeatureType>. It stores an OR combination of AvoidFeatureType values.

enum QGeoRouteRequest::InstructionDetail
flags QGeoRouteRequest::InstructionDetails

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

ConstantValueDescription
QGeoRouteRequest::NoInstructions0x0000No instructions should be included with the route.
QGeoRouteRequest::BasicInstructions0x0001Basic instructions will be included with the route. This will include QGeoInstruction::instructionText().

The InstructionDetails type is a typedef for QFlags<InstructionDetail>. It stores an OR combination of InstructionDetail values.

enum QGeoRouteRequest::RouteOptimization
flags QGeoRouteRequest::RouteOptimizations

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

ConstantValueDescription
QGeoRouteRequest::ShortestRoute0x0001Minimize the length of the journey.
QGeoRouteRequest::FastestRoute0x0002Minimize the travelling time for the journey.
QGeoRouteRequest::MostEconomicRoute0x0004Minimize the cost of the journey.
QGeoRouteRequest::MostScenicRoute0x0008Maximize the scenic potential of the journey.

The RouteOptimizations type is a typedef for QFlags<RouteOptimization>. It stores an OR combination of RouteOptimization values.

enum QGeoRouteRequest::SegmentDetail
flags QGeoRouteRequest::SegmentDetails

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

ConstantValueDescription
QGeoRouteRequest::NoSegmentData0x0000No 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 QGeoInstruction instances.
QGeoRouteRequest::BasicSegmentData0x0001Basic 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.

enum QGeoRouteRequest::TravelMode
flags QGeoRouteRequest::TravelModes

Defines modes of travel to be used for a route.

ConstantValueDescription
QGeoRouteRequest::CarTravel0x0001The route will be optimized for someone who is driving a car.
QGeoRouteRequest::PedestrianTravel0x0002The route will be optimized for someone who is walking.
QGeoRouteRequest::BicycleTravel0x0004The route will be optimized for someone who is riding a bicycle.
QGeoRouteRequest::PublicTransitTravel0x0008The route will be optimized for someone who is making use of public transit.
QGeoRouteRequest::TruckTravel0x0010The 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.


Member Function Documentation

QGeoRouteRequest::QGeoRouteRequest ( const QList<QGeoCoordinate> & waypoints = QList<QGeoCoordinate> () )

Constructs a request to calculate a route through the coordinates waypoints.

The route will traverse the elements of waypoints in order.

QGeoRouteRequest::QGeoRouteRequest ( const QGeoCoordinate & origin, const QGeoCoordinate & destination )

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

QGeoRouteRequest::QGeoRouteRequest ( const QGeoRouteRequest & other )

Constructs a route request object from the contents of other.

QGeoRouteRequest::~QGeoRouteRequest ()

Destroys the request.

AvoidFeatureTypes QGeoRouteRequest::avoidFeatureTypes () const

Returns the features which this request specifies should be avoided during the planning of the route.

See also setAvoidFeatureTypes().

QList<QGeoBoundingBox> QGeoRouteRequest::excludeAreas () const

Returns areas the route must not cross.

See also setExcludeAreas().

InstructionDetail QGeoRouteRequest::instructionDetail () const

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

See also setInstructionDetail().

int QGeoRouteRequest::numberAlternativeRoutes () const

Returns the number of alternative routes which will be requested.

See also setNumberAlternativeRoutes().

RouteOptimizations QGeoRouteRequest::routeOptimization () const

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

See also setRouteOptimization().

SegmentDetail QGeoRouteRequest::segmentDetail () const

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

See also setSegmentDetail().

void QGeoRouteRequest::setAvoidFeatureTypes ( AvoidFeatureTypes avoidFeatureTypes )

Sets the features to be avoided during the planning of the route to avoidFeatureTypes.

The default value is QGeoRouteRequest::AvoidNothing.

See also avoidFeatureTypes().

void QGeoRouteRequest::setExcludeAreas ( const QList<QGeoBoundingBox> & areas )

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

See also excludeAreas().

void QGeoRouteRequest::setInstructionDetail ( InstructionDetail instructionDetail )

Sets the level of detail to use when representing routing instructions to instructionDetail.

The default value is QGeoRouteRequest::BasicInstructions.

See also instructionDetail().

void QGeoRouteRequest::setNumberAlternativeRoutes ( int alternatives )

Sets the number of alternative routes to request to alternatives.

The default value is 0.

See also numberAlternativeRoutes().

void QGeoRouteRequest::setRouteOptimization ( RouteOptimizations optimization )

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

The default value is QGeoRouteRequest::FastestRoute.

See also routeOptimization().

void QGeoRouteRequest::setSegmentDetail ( SegmentDetail segmentDetail )

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

See also segmentDetail().

void QGeoRouteRequest::setTravelModes ( TravelModes travelModes )

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

The default value is QGeoRouteRequest::CarTravel.

See also travelModes().

void QGeoRouteRequest::setWaypoints ( const QList<QGeoCoordinate> & 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().

TravelModes QGeoRouteRequest::travelModes () const

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

See also setTravelModes().

QList<QGeoCoordinate> QGeoRouteRequest::waypoints () const

Returns the waypoints that the route will pass through.

See also setWaypoints().

bool QGeoRouteRequest::operator!= ( const QGeoRouteRequest & other ) const

Returns whether this route request and other are equal.

QGeoRouteRequest & QGeoRouteRequest::operator= ( const QGeoRouteRequest & other )

Assigns other to this route request object and then returns a reference to this route request object.

bool QGeoRouteRequest::operator== ( const QGeoRouteRequest & other ) const

Returns whether this route request and other are equal.

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.