CartoType iOS API 7.8.2, 2022-03-25
for development in Swift and Objective C for iOS and Mac OS
Instance Methods | Properties | List of all members
CartoTypeRouteProfile Class Reference

#import <CartoTypeRouter.h>

Inheritance diagram for CartoTypeRouteProfile:

Instance Methods

(id) - init
 
(id) - initWithProfileType:
 
(double) - speed:
 
(void) - setSpeed:to:
 
(double) - bonus:
 
(void) - setBonus:to:
 
(uint32_t) - restrictionOverride:
 
(void) - setRestrictionOverride:to:
 
(double) - gradientSpeed:
 
(void) - setGradientSpeed:to:
 
(double) - gradientBonus:
 
(void) - setGradientBonus:to:
 
(void *) - getProfile
 

Properties

NSString * name
 
uint32_t vehicleType
 
double weight
 
double axleLoad
 
double doubleAxleLoad
 
double tripleAxleLoad
 
double height
 
double width
 
double length
 
bool hazMat
 
int turnTime
 
int uTurnTime
 
int crossTrafficTurnTime
 
int trafficLightTime
 
bool shortest
 
bool shortestByTime
 
double tollPenalty
 
uint32_t gradientFlags
 

Detailed Description

A route profile: parameters determining the type of route, including road speeds, bonuses and penalties, and vehicle type.

Method Documentation

◆ bonus:

- (double) bonus: (unsigned int)  aIndex

Gets the bonus or penalty in notional km per hour to be added to a road type to make it more or less likely to be used. The road type aIndex must be in the the range KArcMotorway...KArcOtherRoadType7. For example, a penalty of 1kph is applied to walking routes along major roads because it is pleasanter to walk along quieter minor roads.

◆ getProfile

- (void *) getProfile

(for internal use) Gets a pointer to the underlying C++ profile object.

◆ gradientBonus:

- (double) gradientBonus: (unsigned int)  aIndex

Gets the bonus added to a road with a particular gradient. The gradient type aIndex must be in the range KArcGradientUp0Index...KArcGradientDown3Index.

◆ gradientSpeed:

- (double) gradientSpeed: (unsigned int)  aIndex

Gets the speed added to a road with a particular gradient. The gradient type aIndex must be in the range KArcGradientUp0Index...KArcGradientDown3Index. 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.

◆ init

- (id) init

Creates a standard route profile for a car.

◆ initWithProfileType:

- (id) initWithProfileType: (CartoTypeRouteProfileType aProfileType

Creates a route profile with one of the standard types.

◆ restrictionOverride:

- (uint32_t) restrictionOverride: (unsigned int)  aIndex

Gets the restriction override bit mask for a road type. The road type aIndex must be in the the range KArcMotorway...KArcOtherRoadType7. The bit mask 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, call setRestrictionOverride(KArcTrack,KArcHeavyGoodsAccessFlag).

◆ setBonus:to:

- (void) setBonus: (unsigned int)  aIndex
to: (double)  aValue 

Sets the bonus for a road type. The road type aIndex must be in the the range KArcMotorway...KArcOtherRoadType7.

◆ setGradientBonus:to:

- (void) setGradientBonus: (unsigned int)  aIndex
to: (double)  aValue 

Sets the bonus added to a road with a particular gradient. The gradient type aIndex must be in the range KArcGradientUp0Index...KArcGradientDown3Index.

◆ setGradientSpeed:to:

- (void) setGradientSpeed: (unsigned int)  aIndex
to: (double)  aValue 

Sets the speed added to a road with a particular gradient. The gradient type aIndex must be in the range KArcGradientUp0Index...KArcGradientDown3Index.

◆ setRestrictionOverride:to:

- (void) setRestrictionOverride: (unsigned int)  aIndex
to: (uint32_t)  aValue 

Gets the restriction override bit mask for a road type. The road type aIndex must be in the the range KArcMotorway...KArcOtherRoadType7.

◆ setSpeed:to:

- (void) setSpeed: (unsigned int)  aIndex
to: (double)  aValue 

Sets the expected speed for a road type in kilometres per hour. The road type aIndex must be in the the range KArcMotorway...KArcOtherRoadType7.

◆ speed:

- (double) speed: (unsigned int)  aIndex

Gets the expected speed for a road type in kilometres per hour. The road type aIndex must be in the the range KArcMotorway...KArcOtherRoadType7.

Property Documentation

◆ axleLoad

- (double) axleLoad
readwritenonatomicassign

The vehicle's axle load in metric tons. Values of zero or less mean 'unknown'.

◆ crossTrafficTurnTime

- (int) crossTrafficTurnTime
readwritenonatomicassign

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. The time is used when turning from the right of way to a lower-rank road. It is doubled when turning from a lower-rank road on to the right of way.

◆ doubleAxleLoad

- (double) doubleAxleLoad
readwritenonatomicassign

The vehicle's double axle load in metric tons. Values of zero or less mean 'unknown'.

◆ gradientFlags

- (uint32_t) gradientFlags
readwritenonatomicassign

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

◆ hazMat

- (bool) hazMat
readwritenonatomicassign

True if the vehicle is carrying hazardous materials.

◆ height

- (double) height
readwritenonatomicassign

The vehicle's height in meters. Values of zero or less mean 'unknown'.

◆ length

- (double) length
readwritenonatomicassign

The vehicle's length in meters. Values of zero or less mean 'unknown'.

◆ name

- (NSString*) name
readwritenonatomicstrong

The optional name of the profile.

◆ shortest

- (bool) shortest
readwritenonatomicassign

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

◆ shortestByTime

- (bool) shortestByTime
readwritenonatomicassign

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

◆ tollPenalty

- (double) tollPenalty
readwritenonatomicassign

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.

◆ trafficLightTime

- (int) trafficLightTime
readwritenonatomicassign

The estimated delay in seconds caused by traffic lights.

◆ tripleAxleLoad

- (double) tripleAxleLoad
readwritenonatomicassign

The vehicle's triple axle load in metric tons. Values of zero or less mean 'unknown'.

◆ turnTime

- (int) turnTime
readwritenonatomicassign

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

◆ uTurnTime

- (int) uTurnTime
readwritenonatomicassign

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

◆ vehicleType

- (uint32_t) vehicleType
readwritenonatomicassign

Flags taken from KArcWrongWayFlag ... KArcOtherAccessFlag indicating the vehicle type. Arcs with restrictions matching any of these flags will not be taken.

◆ weight

- (double) weight
readwritenonatomicassign

The vehicle's weight in metric tons. Values of zero or less mean 'unknown'.

◆ width

- (double) width
readwritenonatomicassign

The vehicle's width in meters. Values of zero or less mean 'unknown'.


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