CartoType C++ API 8.8-7-gb35e4dc71
for Windows, Linux, Qt and other platforms supporting C++ development
|
#include <cartotype_navigation.h>
Public Member Functions | |
RouteProfile (RouteProfileType aProfileType=RouteProfileType::Car) | |
RouteProfile (InputStream &aInput) | |
Result | ReadFromXml (InputStream &aInput) |
Result | WriteAsXml (OutputStream &aOutput) const |
bool | operator== (const RouteProfile &aOther) const |
bool | operator!= (const RouteProfile &aOther) const |
Public Attributes | |
std::string | Name |
CartoTypeCore::VehicleType | VehicleType |
std::array< double, FeatureInfo::KRouteTypeCount > | Speed = { } |
std::array< double, FeatureInfo::KRouteTypeCount > | Bonus = { } |
std::array< uint32_t, FeatureInfo::KRouteTypeCount > | RestrictionOverride = { } |
int32_t | TurnTime = 4 |
int32_t | UTurnTime = 300 |
int32_t | CrossTrafficTurnTime = 12 |
int32_t | TrafficLightTime = 10 |
bool | Shortest = false |
bool | ShortestByTime = false |
double | TollPenalty = 0 |
std::array< double, FeatureInfo::KGradientCount > | GradientSpeed = { } |
std::array< double, FeatureInfo::KGradientCount > | GradientBonus = { } |
uint32_t | GradientFlags = 0xFFFFFFFF & ~((1 << int(FeatureType::Steps)) | (1 << int(FeatureType::PassengerFerry)) | (1 << int(FeatureType::VehicularFerry))) |
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.
CartoTypeCore::RouteProfile::RouteProfile | ( | RouteProfileType | aProfileType = RouteProfileType::Car | ) |
Creates a route profile. If the profile type is not supplied the default value is the car profile type.
|
explicit |
Creates a route profile from XML format by reading a CartoTypeRouteProfile element. Throws an exception on error.
|
inline |
The inequality operator.
bool CartoTypeCore::RouteProfile::operator== | ( | const RouteProfile & | aOther | ) | const |
The equality operator.
Result CartoTypeCore::RouteProfile::ReadFromXml | ( | InputStream & | aInput | ) |
Reads a route profile from XML format by reading a CartoTypeRouteProfile element..
Result CartoTypeCore::RouteProfile::WriteAsXml | ( | OutputStream & | aOutput | ) | const |
Writes the route profile in XML format as a CartoTypeRouteProfile element.
std::array<double,FeatureInfo::KRouteTypeCount> CartoTypeCore::RouteProfile::Bonus = { } |
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.
int32_t CartoTypeCore::RouteProfile::CrossTrafficTurnTime = 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.
std::array<double,FeatureInfo::KGradientCount> CartoTypeCore::RouteProfile::GradientBonus = { } |
Bonuses applied to roads with a particular gradient.
uint32_t CartoTypeCore::RouteProfile::GradientFlags = 0xFFFFFFFF & ~((1 << int(FeatureType::Steps)) | (1 << int(FeatureType::PassengerFerry)) | (1 << int(FeatureType::VehicularFerry))) |
Flags indicating which roads are affected by gradient speeds and bonuses; normally steps, etc., are excluded. Each bit is (1 << route type).
std::array<double,FeatureInfo::KGradientCount> CartoTypeCore::RouteProfile::GradientSpeed = { } |
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.
std::string CartoTypeCore::RouteProfile::Name |
The optional name of the profile.
std::array<uint32_t,FeatureInfo::KRouteTypeCount> CartoTypeCore::RouteProfile::RestrictionOverride = { } |
This array of bit masks allows restrictions to be overridden for certain types of road. For example, to allow routing of motor vehicles along tracks that are normally forbidden to motor vehicles, set iRestrictionOverride[size_t(FeatureType::Track)] to FeatureInfo::KRouteAccessMotorVehicle.
bool CartoTypeCore::RouteProfile::Shortest = 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.
bool CartoTypeCore::RouteProfile::ShortestByTime = false |
Set this flag to true if iShortest should produce the shortest route by time rather than distance.
std::array<double,FeatureInfo::KRouteTypeCount> CartoTypeCore::RouteProfile::Speed = { } |
Speeds along roads in kilometres per hour.
double CartoTypeCore::RouteProfile::TollPenalty = 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.
int32_t CartoTypeCore::RouteProfile::TrafficLightTime = 10 |
The estimated delay in seconds caused by traffic lights.
int32_t CartoTypeCore::RouteProfile::TurnTime = 4 |
The estimated time in seconds taken for any turn at a junction that is not a slight turn or simply going straight ahead.
int32_t CartoTypeCore::RouteProfile::UTurnTime = 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).
CartoTypeCore::VehicleType CartoTypeCore::RouteProfile::VehicleType |
The vehicle type, defined using access flags, dimensions, weight, etc.