CartoType C++ API 7.8.2, 2022-03-25
for Windows, Linux, Qt and other platforms supporting C++ development
Public Member Functions | Public Attributes | List of all members
CartoType::TRouteProfile Class Reference

#include <cartotype_navigation.h>

Public Member Functions

 TRouteProfile (TRouteProfileType aProfileType=TRouteProfileType::Car)
 TRouteProfile (MInputStream &aInput)
TResult ReadFromXml (MInputStream &aInput)
TResult WriteAsXml (MOutputStream &aOutput) const
bool operator== (const TRouteProfile &aOther) const
bool operator!= (const TRouteProfile &aOther) const

Public Attributes

std::string iName
TVehicleType iVehicleType
std::array< double, KArcRoadTypeCountiSpeed = { }
std::array< double, KArcRoadTypeCountiBonus = { }
std::array< uint32_t, KArcRoadTypeCountiRestrictionOverride = { }
int32_t iTurnTime = 4
int32_t iUTurnTime = 300
int32_t iCrossTrafficTurnTime = 12
int32_t iTrafficLightTime = 10
bool iShortest = false
bool iShortestByTime = false
double iTollPenalty = 0
std::array< double, KArcGradientCountiGradientSpeed = { }
std::array< double, KArcGradientCountiGradientBonus = { }
uint32_t iGradientFlags = 0xFFFFFFFF & ~((1 << KArcSteps) | (1 << KArcPassengerFerry) | (1 << KArcVehicularFerry))

Detailed Description

A routing profile: parameters determining the type of route, including road speeds, bonuses and penalties, and vehicle type. A road type will not normally be used if its speed plus bonus is equal to or less than zero.

However, if the speed is positive and the bonus is negative, and their sum is zero, this type of road will be allowed at the beginning or end of a route, allowing travel over farm tracks, for instance, to leave or to arrive at a destination.

Similarly, restricted road types such as private roads are allowed at the beginning or end of a route.

Constructor & Destructor Documentation

◆ TRouteProfile() [1/2]

CartoType::TRouteProfile::TRouteProfile ( TRouteProfileType  aProfileType = TRouteProfileType::Car)

Creates a route profile. If the profile type is not supplied the default value is the car profile type.

◆ TRouteProfile() [2/2]

CartoType::TRouteProfile::TRouteProfile ( MInputStream aInput)

Creates a route profile from XML format by reading a CartoTypeRouteProfile element. Throws an exception on error.

Member Function Documentation

◆ operator!=()

bool CartoType::TRouteProfile::operator!= ( const TRouteProfile aOther) const

The inequality operator.

◆ operator==()

bool CartoType::TRouteProfile::operator== ( const TRouteProfile aOther) const

The equality operator.

◆ ReadFromXml()

TResult CartoType::TRouteProfile::ReadFromXml ( MInputStream aInput)

Reads a route profile from XML format by reading a CartoTypeRouteProfile element..

◆ WriteAsXml()

TResult CartoType::TRouteProfile::WriteAsXml ( MOutputStream aOutput) const

Writes the route profile in XML format as a CartoTypeRouteProfile element.

Member Data Documentation

◆ iBonus

std::array<double,KArcRoadTypeCount> CartoType::TRouteProfile::iBonus = { }

Bonuses or penalties in notional km per hour to be added to road types to make them more or less likely to be used. For example, a penalty of 1kph is applied to walking routes along major roads because it is pleasanter to walk along quieter minor roads.

◆ iCrossTrafficTurnTime

int32_t CartoType::TRouteProfile::iCrossTrafficTurnTime = 12

The estimated time in seconds taken for a turn across the traffic: that is, a left turn in drive-on-right countries, or a right turn in drive-on-left countries.

◆ iGradientBonus

std::array<double,KArcGradientCount> CartoType::TRouteProfile::iGradientBonus = { }

Bonuses applied to roads with a particular gradient.

◆ iGradientFlags

uint32_t CartoType::TRouteProfile::iGradientFlags = 0xFFFFFFFF & ~((1 << KArcSteps) | (1 << KArcPassengerFerry) | (1 << KArcVehicularFerry))

Flags indicating which roads are affected by gradient speeds and bonuses; normally steps, etc., are excluded. Each bit is (1 << road type).

◆ iGradientSpeed

std::array<double,KArcGradientCount> CartoType::TRouteProfile::iGradientSpeed = { }

Speeds added to roads with a particular gradient. These values are intended for cycling, walking, hiking and running profiles, where speeds are generally the same for different types of road, but can change according to the gradient.

◆ iName

std::string CartoType::TRouteProfile::iName

The optional name of the profile.

◆ iRestrictionOverride

std::array<uint32_t,KArcRoadTypeCount> CartoType::TRouteProfile::iRestrictionOverride = { }

This array of bit masks allows restrictions to be overridden for certain types of road. For example, to allow routing of heavy goods vehicles along tracks, even if they are forbidden to motor vehicles, set iRestrictionOverride[KArcTrack] to KArcHeavyGoodsAccessFlag.

◆ iShortest

bool CartoType::TRouteProfile::iShortest = false

Set this flag to true to get the shortest route by distance or time, ignoring weightings. Whether distance or time is used depends on the setting of iShortestByTime.

◆ iShortestByTime

bool CartoType::TRouteProfile::iShortestByTime = false

Set this flag to true if iShortest should produce the shortest route by time rather than distance.

◆ iSpeed

std::array<double,KArcRoadTypeCount> CartoType::TRouteProfile::iSpeed = { }

Speeds along roads in kilometres per hour.

◆ iTollPenalty

double CartoType::TRouteProfile::iTollPenalty = 0

The penalty applied to toll roads as a number between zero and one. The value 1 means that no toll roads will be used, 0.5 makes toll roads half as desirable as non-toll roads of the same road type, and so on. The value 0 means that no penalty is applied to toll roads. Values outside the range 0...1 are clamped to that range.

◆ iTrafficLightTime

int32_t CartoType::TRouteProfile::iTrafficLightTime = 10

The estimated delay in seconds caused by traffic lights.

◆ iTurnTime

int32_t CartoType::TRouteProfile::iTurnTime = 4

The estimated time in seconds taken for any turn at a junction that is not a slight turn or simply going straight ahead.

◆ iUTurnTime

int32_t CartoType::TRouteProfile::iUTurnTime = 300

The estimated time in seconds taken for a U-turn, defined as a turn very close to 180 degrees (within 1/32 of a circle = 11.75 degrees).

◆ iVehicleType

TVehicleType CartoType::TRouteProfile::iVehicleType

The vehicle type, defined using access flags, dimensions, weight, etc.

The documentation for this class was generated from the following file: