CartoType Android API 7.8.2, 2022-03-25
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 | iName |
int | iVehicleType |
double | iWeight = 0 |
double | iAxleLoad = 0 |
double | iDoubleAxleLoad = 0 |
double | iTripleAxleLoad = 0 |
double | iHeight = 0 |
double | iWidth = 0 |
double | iLength = 0 |
boolean | iHazMat = false |
double[] | iSpeed = new double[ROAD_TYPE_COUNT] |
double[] | iBonus = new double[ROAD_TYPE_COUNT] |
int[] | iRestrictionOverride = new int[ROAD_TYPE_COUNT] |
int | iTurnTime = 4 |
int | iUTurnTime = 300 |
int | iCrossTrafficTurnTime = 10 |
int | iTrafficLightTime = 30 |
boolean | iShortest = false |
boolean | iShortestByTime = false |
double | iTollPenalty = 0 |
double[] | iGradientSpeed = new double[GRADIENT_COUNT] |
double[] | iGradientBonus = new double[GRADIENT_COUNT] |
int | iGradientFlags = 0 |
Static Public Attributes | |
static final int | WRONG_WAY_FLAG = 0x00100000 |
static final int | BICYCLE_ACCESS_FLAG = 0x0020000 |
static final int | MOTORCYCLE_ACCESS_FLAG = 0x0040000 |
static final int | CAR_ACCESS_FLAG = 0x0080000 |
static final int | HIGH_OCCUPANCY_ACCESS_FLAG = 0x0100000 |
static final int | LIGHT_GOODS_ACCESS_FLAG = 0x02000000 |
static final int | HEAVY_GOODS_ACCESS_FLAG = 0x04000000 |
static final int | BUS_ACCESS_FLAG = 0x08000000 |
static final int | TAXI_ACCESS_FLAG = 0x10000000 |
static final int | PEDESTRIAN_ACCESS_FLAG = 0x20000000 |
static final int | EMERGENCY_ACCESS_FLAG = 0x40000000 |
static final int | OTHER_ACCESS_FLAG = 0x80000000 |
static final int | MOTORWAY = 0 |
static final int | MOTORWAY_LINK = 1 |
static final int | TRUNK_ROAD = 2 |
static final int | TRUNK_ROAD_LINK = 3 |
static final int | PRIMARY_ROAD = 4 |
static final int | PRIMARY_ROAD_LINK = 5 |
static final int | SECONDARY_ROAD = 6 |
static final int | SECONDARY_ROAD_LINK = 7 |
static final int | TERTIARY_ROAD = 8 |
static final int | UNCLASSIFIED_ROAD = 9 |
static final int | RESIDENTIAL_ROAD = 10 |
static final int | TRACK = 11 |
static final int | SERVICE_ROAD = 12 |
static final int | PEDESTRIAN_ROAD = 13 |
static final int | VEHICULAR_FERRY = 14 |
static final int | PASSENGER_FERRY = 15 |
static final int | LIVING_STREET = 16 |
static final int | CYCLEWAY = 17 |
static final int | PATH = 18 |
static final int | FOOTWAY = 19 |
static final int | BRIDLEWAY = 20 |
static final int | STEPS = 21 |
static final int | UNKNOWN_ROAD_TYPE = 22 |
static final int | UNPAVED_ROAD = 23 |
static final int | OTHER_ROAD_TYPE_0 = 24 |
static final int | OTHER_ROAD_TYPE_1 = 25 |
static final int | OTHER_ROAD_TYPE_2 = 26 |
static final int | OTHER_ROAD_TYPE_3 = 27 |
static final int | OTHER_ROAD_TYPE_4 = 28 |
static final int | OTHER_ROAD_TYPE_5 = 29 |
static final int | OTHER_ROAD_TYPE_6 = 30 |
static final int | OTHER_ROAD_TYPE_7 = 31 |
static final int | ROAD_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.
|
static |
Bit value for iVehicleType: this vehicle is a bicycle.
|
static |
The index for bridleways in the speed and bonus arrays.
|
static |
Bit value for iVehicleType: this vehicle is a bus.
|
static |
Bit value for iVehicleType: this vehicle is a car.
|
static |
The index for cycleways in the speed and bonus arrays.
|
static |
Bit value for iVehicleType: this vehicle is an emergency vehicle.
|
static |
The index for footways in the speed and bonus arrays.
|
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.
|
static |
Bit value for iVehicleType: this vehicle is a heavy goods vehicle.
|
static |
Bit value for iVehicleType: this vehicle is a high occupancy vehicle.
double com.cartotype.RouteProfile.iAxleLoad = 0 |
The vehicle's axle load in metric tons. Values of zero or less mean 'unknown'.
double [] com.cartotype.RouteProfile.iBonus = new double[ROAD_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.iCrossTrafficTurnTime = 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.iDoubleAxleLoad = 0 |
The vehicle's double axle load in metric tons. Values of zero or less mean 'unknown'.
double [] com.cartotype.RouteProfile.iGradientBonus = new double[GRADIENT_COUNT] |
Bonuses applied to roads with a particular gradient.
int com.cartotype.RouteProfile.iGradientFlags = 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.iGradientSpeed = 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.iHazMat = false |
True if the vehicle is carrying hazardous materials.
double com.cartotype.RouteProfile.iHeight = 0 |
The vehicle's height in meters. Values of zero or less mean 'unknown'.
double com.cartotype.RouteProfile.iLength = 0 |
The vehicle's length in meters. Values of zero or less mean 'unknown'.
String com.cartotype.RouteProfile.iName |
The optional name of the profile.
int [] com.cartotype.RouteProfile.iRestrictionOverride = new int[ROAD_TYPE_COUNT] |
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[TRACK] to HEAVY_GOODS_ACCESS_FLAG.
boolean com.cartotype.RouteProfile.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.
boolean com.cartotype.RouteProfile.iShortestByTime = false |
Set this flag to true if iShortest should produce the shortest route by time rather than distance.
double [] com.cartotype.RouteProfile.iSpeed = new double[ROAD_TYPE_COUNT] |
Speeds along roads in kilometres per hour.
double com.cartotype.RouteProfile.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.
int com.cartotype.RouteProfile.iTrafficLightTime = 30 |
The estimated delay in seconds caused by traffic lights.
double com.cartotype.RouteProfile.iTripleAxleLoad = 0 |
The vehicle's triple axle load in metric tons. Values of zero or less mean 'unknown'.
int com.cartotype.RouteProfile.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.
int com.cartotype.RouteProfile.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).
int com.cartotype.RouteProfile.iVehicleType |
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.iWeight = 0 |
The vehicle's weight in metric tons. Values of zero or less mean 'unknown'.
double com.cartotype.RouteProfile.iWidth = 0 |
The vehicle's width in meters. Values of zero or less mean 'unknown'.
|
static |
Bit value for iVehicleType: this vehicle is a light goods vehicle.
|
static |
The index for living streets in the speed and bonus arrays.
|
static |
Bit value for iVehicleType: this vehicle is a motorcycles.
|
static |
The index for motorways in the speed and bonus arrays.
|
static |
The index for motorway links (ramps) in the speed and bonus arrays.
|
static |
Bit value for iVehicleType: other access restrictions exist such as weight, length, width, height or for vehicles carrying hazardous materials.
|
static |
The index for other road type 0 in the speed and bonus arrays.
|
static |
The index for other road type 1 in the speed and bonus arrays.
|
static |
The index for other road type 2 in the speed and bonus arrays.
|
static |
The index for other road type 3 in the speed and bonus arrays.
|
static |
The index for other road type 4 in the speed and bonus arrays.
|
static |
The index for other road type 5 in the speed and bonus arrays.
|
static |
The index for other road type 6 in the speed and bonus arrays.
|
static |
The index for other road type 7 in the speed and bonus arrays.
|
static |
The index for passenger ferries in the speed and bonus arrays.
|
static |
The index for paths in the speed and bonus arrays.
|
static |
Bit value for iVehicleType: the traveller is a pedestrian.
|
static |
The index for pedestrian roads in the speed and bonus arrays.
|
static |
The index for primary roads in the speed and bonus arrays.
|
static |
The index for primary road links (ramps) in the speed and bonus arrays.
|
static |
The index for residential roads in the speed and bonus arrays.
|
static |
The size of the speed and bonus arrays.
|
static |
The index for secondary roads in the speed and bonus arrays.
|
static |
The index for secondary road links (ramps) in the speed and bonus arrays.
|
static |
The index for service roads and access roads in the speed and bonus arrays.
|
static |
The index for steps in the speed and bonus arrays.
|
static |
Bit value for iVehicleType: this vehicle is a taxi.
|
static |
The index for tertiary roads in the speed and bonus arrays.
|
static |
The index for tracks in the speed and bonus arrays.
|
static |
The index for trunk roads in the speed and bonus arrays.
|
static |
The index for trunk road links (ramps) in the speed and bonus arrays.
|
static |
The index for unclassified roads in the speed and bonus arrays.
|
static |
The index for roads of unknown type in the speed and bonus arrays.
|
static |
The index for unpaved (unsurfaced) roads in the speed and bonus arrays.
|
static |
The index for vehicular ferries in the speed and bonus arrays.
|
static |
Bit value for iVehicleType: this vehicle cannot go the wrong way along a one-way road. This flag should be cleared for pedestrian routing.