CartoType Android API 7.8.2, 2022-03-25
for Java development on Android
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
com.cartotype.RouteProfile Class Reference

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ RouteProfile() [1/3]

com.cartotype.RouteProfile.RouteProfile ( )

Creates a standard route profile for private car journeys. It can then be modified as desired.

◆ RouteProfile() [2/3]

com.cartotype.RouteProfile.RouteProfile ( RouteProfileType  aProfileType)

Creates a route profile of a predefined type. It can then be modified as desired.

◆ RouteProfile() [3/3]

com.cartotype.RouteProfile.RouteProfile ( Route  aRoute)

Creates a route profile that is the profile used by a Route.

Member Function Documentation

◆ readFromXmlFile()

native int com.cartotype.RouteProfile.readFromXmlFile ( String  aFileName)

Reads a route profile from an XML file. Returns a CartoType result code; 0 = success.

◆ readFromXmlString()

native int com.cartotype.RouteProfile.readFromXmlString ( String  aString)

Reads a route profile from an XML string. Returns a CartoType result code; 0 = success.

◆ writeAsXmlFile()

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.

◆ writeAsXmlString()

native String com.cartotype.RouteProfile.writeAsXmlString ( )

Writes a route profile to a string in XML form.

Member Data Documentation

◆ BICYCLE_ACCESS_FLAG

final int com.cartotype.RouteProfile.BICYCLE_ACCESS_FLAG = 0x0020000
static

Bit value for iVehicleType: this vehicle is a bicycle.

◆ BRIDLEWAY

final int com.cartotype.RouteProfile.BRIDLEWAY = 20
static

The index for bridleways in the speed and bonus arrays.

◆ BUS_ACCESS_FLAG

final int com.cartotype.RouteProfile.BUS_ACCESS_FLAG = 0x08000000
static

Bit value for iVehicleType: this vehicle is a bus.

◆ CAR_ACCESS_FLAG

final int com.cartotype.RouteProfile.CAR_ACCESS_FLAG = 0x0080000
static

Bit value for iVehicleType: this vehicle is a car.

◆ CYCLEWAY

final int com.cartotype.RouteProfile.CYCLEWAY = 17
static

The index for cycleways in the speed and bonus arrays.

◆ EMERGENCY_ACCESS_FLAG

final int com.cartotype.RouteProfile.EMERGENCY_ACCESS_FLAG = 0x40000000
static

Bit value for iVehicleType: this vehicle is an emergency vehicle.

◆ FOOTWAY

final int com.cartotype.RouteProfile.FOOTWAY = 19
static

The index for footways in the speed and bonus arrays.

◆ GRADIENT_COUNT

final int com.cartotype.RouteProfile.GRADIENT_COUNT = 8
static

The size of the gradient arrays.

◆ GRADIENT_DOWN_0

final int com.cartotype.RouteProfile.GRADIENT_DOWN_0 = 4
static

The index for a very slight downhill gradient, or no gradient, in the gradient arrays.

◆ GRADIENT_DOWN_1

final int com.cartotype.RouteProfile.GRADIENT_DOWN_1 = 5
static

The index for a gentle downhill gradient in the gradient arrays.

◆ GRADIENT_DOWN_2

final int com.cartotype.RouteProfile.GRADIENT_DOWN_2 = 6
static

The index for a steep downhill gradient in the gradient arrays.

◆ GRADIENT_DOWN_3

final int com.cartotype.RouteProfile.GRADIENT_DOWN_3 = 7
static

The index for a very steep downhill gradient in the gradient arrays.

◆ GRADIENT_UP_0

final int com.cartotype.RouteProfile.GRADIENT_UP_0 = 0
static

The index for a very slight uphill gradient, or no gradient, in the gradient arrays.

◆ GRADIENT_UP_1

final int com.cartotype.RouteProfile.GRADIENT_UP_1 = 1
static

The index for a gentle uphill gradient in the gradient arrays.

◆ GRADIENT_UP_2

final int com.cartotype.RouteProfile.GRADIENT_UP_2 = 2
static

The index for a steep uphill gradient in the gradient arrays.

◆ GRADIENT_UP_3

final int com.cartotype.RouteProfile.GRADIENT_UP_3 = 3
static

The index for a very steep uphill gradient in the gradient arrays.

◆ HEAVY_GOODS_ACCESS_FLAG

final int com.cartotype.RouteProfile.HEAVY_GOODS_ACCESS_FLAG = 0x04000000
static

Bit value for iVehicleType: this vehicle is a heavy goods vehicle.

◆ HIGH_OCCUPANCY_ACCESS_FLAG

final int com.cartotype.RouteProfile.HIGH_OCCUPANCY_ACCESS_FLAG = 0x0100000
static

Bit value for iVehicleType: this vehicle is a high occupancy vehicle.

◆ iAxleLoad

double com.cartotype.RouteProfile.iAxleLoad = 0

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

◆ iBonus

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.

◆ iCrossTrafficTurnTime

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.

◆ iDoubleAxleLoad

double com.cartotype.RouteProfile.iDoubleAxleLoad = 0

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

◆ iGradientBonus

double [] com.cartotype.RouteProfile.iGradientBonus = new double[GRADIENT_COUNT]

Bonuses applied to roads with a particular gradient.

◆ iGradientFlags

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.

◆ iGradientSpeed

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.

◆ iHazMat

boolean com.cartotype.RouteProfile.iHazMat = false

True if the vehicle is carrying hazardous materials.

◆ iHeight

double com.cartotype.RouteProfile.iHeight = 0

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

◆ iLength

double com.cartotype.RouteProfile.iLength = 0

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

◆ iName

String com.cartotype.RouteProfile.iName

The optional name of the profile.

◆ iRestrictionOverride

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.

◆ iShortest

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.

◆ iShortestByTime

boolean com.cartotype.RouteProfile.iShortestByTime = false

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

◆ iSpeed

double [] com.cartotype.RouteProfile.iSpeed = new double[ROAD_TYPE_COUNT]

Speeds along roads in kilometres per hour.

◆ iTollPenalty

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.

◆ iTrafficLightTime

int com.cartotype.RouteProfile.iTrafficLightTime = 30

The estimated delay in seconds caused by traffic lights.

◆ iTripleAxleLoad

double com.cartotype.RouteProfile.iTripleAxleLoad = 0

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

◆ iTurnTime

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.

◆ iUTurnTime

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

◆ iVehicleType

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.

◆ iWeight

double com.cartotype.RouteProfile.iWeight = 0

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

◆ iWidth

double com.cartotype.RouteProfile.iWidth = 0

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

◆ LIGHT_GOODS_ACCESS_FLAG

final int com.cartotype.RouteProfile.LIGHT_GOODS_ACCESS_FLAG = 0x02000000
static

Bit value for iVehicleType: this vehicle is a light goods vehicle.

◆ LIVING_STREET

final int com.cartotype.RouteProfile.LIVING_STREET = 16
static

The index for living streets in the speed and bonus arrays.

◆ MOTORCYCLE_ACCESS_FLAG

final int com.cartotype.RouteProfile.MOTORCYCLE_ACCESS_FLAG = 0x0040000
static

Bit value for iVehicleType: this vehicle is a motorcycles.

◆ MOTORWAY

final int com.cartotype.RouteProfile.MOTORWAY = 0
static

The index for motorways in the speed and bonus arrays.

◆ MOTORWAY_LINK

final int com.cartotype.RouteProfile.MOTORWAY_LINK = 1
static

The index for motorway links (ramps) in the speed and bonus arrays.

◆ OTHER_ACCESS_FLAG

final int com.cartotype.RouteProfile.OTHER_ACCESS_FLAG = 0x80000000
static

Bit value for iVehicleType: other access restrictions exist such as weight, length, width, height or for vehicles carrying hazardous materials.

◆ OTHER_ROAD_TYPE_0

final int com.cartotype.RouteProfile.OTHER_ROAD_TYPE_0 = 24
static

The index for other road type 0 in the speed and bonus arrays.

◆ OTHER_ROAD_TYPE_1

final int com.cartotype.RouteProfile.OTHER_ROAD_TYPE_1 = 25
static

The index for other road type 1 in the speed and bonus arrays.

◆ OTHER_ROAD_TYPE_2

final int com.cartotype.RouteProfile.OTHER_ROAD_TYPE_2 = 26
static

The index for other road type 2 in the speed and bonus arrays.

◆ OTHER_ROAD_TYPE_3

final int com.cartotype.RouteProfile.OTHER_ROAD_TYPE_3 = 27
static

The index for other road type 3 in the speed and bonus arrays.

◆ OTHER_ROAD_TYPE_4

final int com.cartotype.RouteProfile.OTHER_ROAD_TYPE_4 = 28
static

The index for other road type 4 in the speed and bonus arrays.

◆ OTHER_ROAD_TYPE_5

final int com.cartotype.RouteProfile.OTHER_ROAD_TYPE_5 = 29
static

The index for other road type 5 in the speed and bonus arrays.

◆ OTHER_ROAD_TYPE_6

final int com.cartotype.RouteProfile.OTHER_ROAD_TYPE_6 = 30
static

The index for other road type 6 in the speed and bonus arrays.

◆ OTHER_ROAD_TYPE_7

final int com.cartotype.RouteProfile.OTHER_ROAD_TYPE_7 = 31
static

The index for other road type 7 in the speed and bonus arrays.

◆ PASSENGER_FERRY

final int com.cartotype.RouteProfile.PASSENGER_FERRY = 15
static

The index for passenger ferries in the speed and bonus arrays.

◆ PATH

final int com.cartotype.RouteProfile.PATH = 18
static

The index for paths in the speed and bonus arrays.

◆ PEDESTRIAN_ACCESS_FLAG

final int com.cartotype.RouteProfile.PEDESTRIAN_ACCESS_FLAG = 0x20000000
static

Bit value for iVehicleType: the traveller is a pedestrian.

◆ PEDESTRIAN_ROAD

final int com.cartotype.RouteProfile.PEDESTRIAN_ROAD = 13
static

The index for pedestrian roads in the speed and bonus arrays.

◆ PRIMARY_ROAD

final int com.cartotype.RouteProfile.PRIMARY_ROAD = 4
static

The index for primary roads in the speed and bonus arrays.

◆ PRIMARY_ROAD_LINK

final int com.cartotype.RouteProfile.PRIMARY_ROAD_LINK = 5
static

The index for primary road links (ramps) in the speed and bonus arrays.

◆ RESIDENTIAL_ROAD

final int com.cartotype.RouteProfile.RESIDENTIAL_ROAD = 10
static

The index for residential roads in the speed and bonus arrays.

◆ ROAD_TYPE_COUNT

final int com.cartotype.RouteProfile.ROAD_TYPE_COUNT = 32
static

The size of the speed and bonus arrays.

◆ SECONDARY_ROAD

final int com.cartotype.RouteProfile.SECONDARY_ROAD = 6
static

The index for secondary roads in the speed and bonus arrays.

◆ SECONDARY_ROAD_LINK

final int com.cartotype.RouteProfile.SECONDARY_ROAD_LINK = 7
static

The index for secondary road links (ramps) in the speed and bonus arrays.

◆ SERVICE_ROAD

final int com.cartotype.RouteProfile.SERVICE_ROAD = 12
static

The index for service roads and access roads in the speed and bonus arrays.

◆ STEPS

final int com.cartotype.RouteProfile.STEPS = 21
static

The index for steps in the speed and bonus arrays.

◆ TAXI_ACCESS_FLAG

final int com.cartotype.RouteProfile.TAXI_ACCESS_FLAG = 0x10000000
static

Bit value for iVehicleType: this vehicle is a taxi.

◆ TERTIARY_ROAD

final int com.cartotype.RouteProfile.TERTIARY_ROAD = 8
static

The index for tertiary roads in the speed and bonus arrays.

◆ TRACK

final int com.cartotype.RouteProfile.TRACK = 11
static

The index for tracks in the speed and bonus arrays.

◆ TRUNK_ROAD

final int com.cartotype.RouteProfile.TRUNK_ROAD = 2
static

The index for trunk roads in the speed and bonus arrays.

◆ TRUNK_ROAD_LINK

final int com.cartotype.RouteProfile.TRUNK_ROAD_LINK = 3
static

The index for trunk road links (ramps) in the speed and bonus arrays.

◆ UNCLASSIFIED_ROAD

final int com.cartotype.RouteProfile.UNCLASSIFIED_ROAD = 9
static

The index for unclassified roads in the speed and bonus arrays.

◆ UNKNOWN_ROAD_TYPE

final int com.cartotype.RouteProfile.UNKNOWN_ROAD_TYPE = 22
static

The index for roads of unknown type in the speed and bonus arrays.

◆ UNPAVED_ROAD

final int com.cartotype.RouteProfile.UNPAVED_ROAD = 23
static

The index for unpaved (unsurfaced) roads in the speed and bonus arrays.

◆ VEHICULAR_FERRY

final int com.cartotype.RouteProfile.VEHICULAR_FERRY = 14
static

The index for vehicular ferries in the speed and bonus arrays.

◆ WRONG_WAY_FLAG

final int com.cartotype.RouteProfile.WRONG_WAY_FLAG = 0x00100000
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.


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