CartoType Android API 8.8-7-gb35e4dc71
for Java development on Android
|
Public Member Functions | |
RouteProfile () | |
RouteProfile (RouteProfileType aProfileType) | |
RouteProfile (Route aRoute) | |
native int | readFromXmlFile (String aFileName) |
native int | readFromXmlString (String aString) |
native int | writeAsXmlFile (String aFileName) |
native String | writeAsXmlString () |
Public Attributes | |
String | name |
int | vehicleType |
double | weight = 0 |
double | axleLoad = 0 |
double | doubleAxleLoad = 0 |
double | tripleAxleLoad = 0 |
double | height = 0 |
double | width = 0 |
double | length = 0 |
boolean | hazMat = false |
double[] | speed = new double[ROUTE_TYPE_COUNT] |
double[] | bonus = new double[ROUTE_TYPE_COUNT] |
int[] | restrictionOverride = new int[ROUTE_TYPE_COUNT] |
int | turnTime = 4 |
int | uTurnTime = 300 |
int | crossTrafficTurnTime = 10 |
int | trafficLightTime = 30 |
boolean | shortest = false |
boolean | shortestByTime = false |
double | tollPenalty = 0 |
double[] | gradientSpeed = new double[GRADIENT_COUNT] |
double[] | gradientBonus = new double[GRADIENT_COUNT] |
int | gradientFlags = 0 |
Static Public Attributes | |
static final int | ROUTE_TYPE_COUNT = 32 |
static final int | GRADIENT_UP_0 = 0 |
static final int | GRADIENT_UP_1 = 1 |
static final int | GRADIENT_UP_2 = 2 |
static final int | GRADIENT_UP_3 = 3 |
static final int | GRADIENT_DOWN_0 = 4 |
static final int | GRADIENT_DOWN_1 = 5 |
static final int | GRADIENT_DOWN_2 = 6 |
static final int | GRADIENT_DOWN_3 = 7 |
static final int | GRADIENT_COUNT = 8 |
A route profile controls the way a route is calculated. It provides average speeds and weightings for different types of roads and specifies restrictions to be obeyed.
com.cartotype.RouteProfile.RouteProfile | ( | ) |
Creates a standard route profile for private car journeys. It can then be modified as desired.
com.cartotype.RouteProfile.RouteProfile | ( | RouteProfileType | aProfileType | ) |
Creates a route profile of a predefined type. It can then be modified as desired.
com.cartotype.RouteProfile.RouteProfile | ( | Route | aRoute | ) |
Creates a route profile that is the profile used by a Route.
native int com.cartotype.RouteProfile.readFromXmlFile | ( | String | aFileName | ) |
Reads a route profile from an XML file. Returns a CartoType result code; 0 = success.
native int com.cartotype.RouteProfile.readFromXmlString | ( | String | aString | ) |
Reads a route profile from an XML string. Returns a CartoType result code; 0 = success.
native int com.cartotype.RouteProfile.writeAsXmlFile | ( | String | aFileName | ) |
Writes a route profile to a file in XML form. Returns a CartoType result code; 0 = success.
native String com.cartotype.RouteProfile.writeAsXmlString | ( | ) |
Writes a route profile to a string in XML form.
double com.cartotype.RouteProfile.axleLoad = 0 |
The vehicle's axle load in metric tons. Values of zero or less mean 'unknown'.
double [] com.cartotype.RouteProfile.bonus = new double[ROUTE_TYPE_COUNT] |
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.
int com.cartotype.RouteProfile.crossTrafficTurnTime = 10 |
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.
double com.cartotype.RouteProfile.doubleAxleLoad = 0 |
The vehicle's double axle load in metric tons. Values of zero or less mean 'unknown'.
|
static |
The size of the gradient arrays.
|
static |
The index for a very slight downhill gradient, or no gradient, in the gradient arrays.
|
static |
The index for a gentle downhill gradient in the gradient arrays.
|
static |
The index for a steep downhill gradient in the gradient arrays.
|
static |
The index for a very steep downhill gradient in the gradient arrays.
|
static |
The index for a very slight uphill gradient, or no gradient, in the gradient arrays.
|
static |
The index for a gentle uphill gradient in the gradient arrays.
|
static |
The index for a steep uphill gradient in the gradient arrays.
|
static |
The index for a very steep uphill gradient in the gradient arrays.
double [] com.cartotype.RouteProfile.gradientBonus = new double[GRADIENT_COUNT] |
Bonuses applied to roads with a particular gradient.
int com.cartotype.RouteProfile.gradientFlags = 0 |
Flags indicating which roads are affected by gradient speeds and bonuses; normally steps, etc., are excluded. Each bit is 1 shifted left by the road type.
double [] com.cartotype.RouteProfile.gradientSpeed = new double[GRADIENT_COUNT] |
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.
boolean com.cartotype.RouteProfile.hazMat = false |
True if the vehicle is carrying hazardous materials.
double com.cartotype.RouteProfile.height = 0 |
The vehicle's height in meters. Values of zero or less mean 'unknown'.
double com.cartotype.RouteProfile.length = 0 |
The vehicle's length in meters. Values of zero or less mean 'unknown'.
String com.cartotype.RouteProfile.name |
The optional name of the profile.
int [] com.cartotype.RouteProfile.restrictionOverride = new int[ROUTE_TYPE_COUNT] |
This array of bit masks allows restrictions to be overridden for certain types of road.
|
static |
The size of the speed and bonus arrays, which are indexed by the route feature types from 0 to 31.
boolean com.cartotype.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.
boolean com.cartotype.RouteProfile.shortestByTime = false |
Set this flag to true if iShortest should produce the shortest route by time rather than distance.
double [] com.cartotype.RouteProfile.speed = new double[ROUTE_TYPE_COUNT] |
Speeds along roads in kilometres per hour.
double com.cartotype.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.
int com.cartotype.RouteProfile.trafficLightTime = 30 |
The estimated delay in seconds caused by traffic lights.
double com.cartotype.RouteProfile.tripleAxleLoad = 0 |
The vehicle's triple axle load in metric tons. Values of zero or less mean 'unknown'.
int com.cartotype.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.
int com.cartotype.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).
int com.cartotype.RouteProfile.vehicleType |
Flags taken from WRONG_WAY_FLAG ... OTHER_ACCESS_FLAG indicating the vehicle type. Route sections with restrictions matching any of these flags will not be taken.
double com.cartotype.RouteProfile.weight = 0 |
The vehicle's weight in metric tons. Values of zero or less mean 'unknown'.
double com.cartotype.RouteProfile.width = 0 |
The vehicle's width in meters. Values of zero or less mean 'unknown'.