CartoType iOS API 7.8.2, 2022-03-25
for development in Swift and Objective C for iOS and Mac OS
|
#import <CartoTypeRouter.h>
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 |
A route profile: parameters determining the type of route, including road speeds, bonuses and penalties, and vehicle type.
- (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.
- (void *) getProfile |
(for internal use) Gets a pointer to the underlying C++ profile object.
- (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.
- (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.
- (id) init |
Creates a standard route profile for a car.
- (id) initWithProfileType: | (CartoTypeRouteProfileType) | aProfileType |
Creates a route profile with one of the standard types.
- (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).
- (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.
- (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.
- (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.
- (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.
- (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.
- (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.
|
readwritenonatomicassign |
The vehicle's axle load in metric tons. Values of zero or less mean 'unknown'.
|
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.
|
readwritenonatomicassign |
The vehicle's double axle load in metric tons. Values of zero or less mean 'unknown'.
|
readwritenonatomicassign |
Flags indicating which roads are affected by gradient speeds and bonuses; normally steps, etc., are excluded. Each bit is (1 << road type).
|
readwritenonatomicassign |
True if the vehicle is carrying hazardous materials.
|
readwritenonatomicassign |
The vehicle's height in meters. Values of zero or less mean 'unknown'.
|
readwritenonatomicassign |
The vehicle's length in meters. Values of zero or less mean 'unknown'.
|
readwritenonatomicstrong |
The optional name of the profile.
|
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.
|
readwritenonatomicassign |
Set this flag to true if iShortest should produce the shortest route by time rather than distance.
|
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.
|
readwritenonatomicassign |
The estimated delay in seconds caused by traffic lights.
|
readwritenonatomicassign |
The vehicle's triple axle load in metric tons. Values of zero or less mean 'unknown'.
|
readwritenonatomicassign |
The estimated time in seconds taken for any turn at a junction that is not a slight turn or simply going straight ahead.
|
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).
|
readwritenonatomicassign |
Flags taken from KArcWrongWayFlag ... KArcOtherAccessFlag indicating the vehicle type. Arcs with restrictions matching any of these flags will not be taken.
|
readwritenonatomicassign |
The vehicle's weight in metric tons. Values of zero or less mean 'unknown'.
|
readwritenonatomicassign |
The vehicle's width in meters. Values of zero or less mean 'unknown'.