Permalink
1766 lines (1499 sloc) 74.6 KB
<?xml version="1.0" encoding="utf-8" ?>
<osmand_routing_config defaultProfile="car">
<!-- 1. parameters of routing and different tweaks Influence on A* : -->
<!-- f(x) + heuristicCoefficient*g(X) -->
<!-- TEMPORARY needs to be reverted to 1 -->
<attribute name="heuristicCoefficient" value="" />
<!-- 1.1 tile load parameters (should not affect routing) -->
<!-- by default 16 -->
<attribute name="zoomToLoadTiles" value="16" />
<!-- by default it is 30. Value specified here overwrites all others
(don't specify here ! it is device dependent) -->
<attribute name="memoryLimitInMB" value="" />
<attribute name="nativeMemoryLimitInMB" value="" />
<!-- 1.2 Build A* graph in backward/forward direction (can affect results) -->
<!-- 0 - 2 ways, 1 - direct way, -1 - reverse way -->
<attribute name="planRoadDirection" value="0" />
<!-- 1.3 When there is a query to recalculate route, -->
<!-- recalculate smart using old route within N-meters (0 recalculate fresh, default 10km) -->
<attribute name="recalculateDistanceHelp" value="10000" />
<!-- HELP INFORMATION ABOUT FILE -->
<!--
If you want to tweak the routing engine, read this carefully.
Deploying your own routing.xml
==============================
When you finish editing this document (or want to test on your Android device), copy this file over to your device.
Depending on your device and configuration, this could be one of the following paths:
sdcard/Android/data/net.osmand.plus/files/ (external memory setting, access via computer)
/storage/emulated/0/Android/data/net.osmand.plus/files (external memory setting, access via device itself)
/data/user/0/net.osmand.plus/no_backup (internal memory)
...
For iOS users, there is no known straightforward way. Please update this documentation if you find one.
Restart OsmAnd (e.g. by swiping it away in the recent app view) to activate the new routing.xml;
Overview of the document
++++++++++++++++++++++++
The document contains many big blocks, each describing a single profile.
OsmAnd has three default profiles: car, bicycle and foot.
Some others are described here as well but are hidden by default.
These profiles can be enabled using the 'OsmAnd development plugin'
## Routing profile
For starters, a profile can have a few parameter declarations, to finetune the profile:
<parameter name="some_toggle" ... />
<parameter name="some_other_preference" ... />
(Details on parameters are given later on)
A profile block contains at least the following segments:
1) access (which determines if a road can be taken)
2) speed (which determines what max speed a road allows)
A profile block might also contain following segments:
3) oneway (which determines in which direction a road can be taken)
4) priority (which determines how nice the road is to drive on)
5) obstacle (which determines the delay of an obstacle, in seconds for the routing engine)
6) obstacle_time (which determines the delay of an obstacle, in seconds for the human)
7) penalty_transition (which determines the penalty of transitioning from one highway to another, often a high-level road to a lower level road)
The routing time of a segment is the sum of values calculated by these blocks, as the following formula indicates:
distance/minimum(maxDefaultSpeed, speed*priority) + height penalty + obstacle penalties + turn penalties + ....
Where `maxDefaultSpeed` is defined by the XML (in the header of the profile), whereas max_speed can be given explicitly by the road or implicitly by law
## Block overviews
### 1) Access (specified on ways, obligated, -1 or 1)
Access states whether or not a road _can_ be taken by your mode of transport.
E.g. a pedestrian is not allowed on a motorway; neither can a car follow a small path.
These values are specified included in a `way`-tag with the attribute `access`:
<way attribute="access">
... statements ...
</way>
Depending on the key-value pairs of a way, a value of either `-1` or `1` is selected.
`-1` indicates that a road is _not_ accessible
`1` indicates that the road can be taken
E.g., for a pedestrian are motorways not allowed:
<select value="-1" t="highway" v="motorway"/>
There is no obligation to check against a value. The presence of a key can be enough to check against
<select value="-1" t="bollard"/>
At last, a default might be given, by not specifying a key:
<select value="1"/>
The first matching clause is used.
## 2) Speed (specified on ways, obligated, in km/h)
The speed block gives, for each way, the maxspeed in km/h.
If an explicit `max_speed` is given on the way, the `speed` block is ignored.
## 3) Oneway (specified on ways)
The oneway block specifies if the routing should respect the drawing order.
In the most simple case, going both ways is allowed. For these ways, the value "0" is given:
<select value="0" t="oneway" v="no" />
If the navigation should follow the line in the drawing direction, "1" is the value of choice:
<select value="1" t="oneway" v="1"/>
And if, for some reason, you want to go against the oneway, the value of "-1" should be specified:
<select value="-1" t="oneway" v="-1"/>
## 4) Priority (specified on ways, between 0 and 1)
Priority is a preference multiplicator (between 0 and 1), which can only be used to _de_prioritize routes.
The default value is 1 (= no effect).
The formula used is
`speed_routing = minimum(speed * priority multiplier, maxDefaultSpeed)`;
The main usage of priority is to discourage certain routes (e.g. based on bad smoothness of the road).
If a given priority equals `0.5`, the speed will be halved and the road will be discouraged.
On the other hand, a value >1 can be used to promote a route. However, there is an upperbound for this value.
The 'speed*priority' can never grow above the maxDefaultSpeed.
For example:
The bicycle profile has a maxDefaultSpeed of `33`.
The speed on a residential road is `23`.
Consider that we want to promote this road, because it is marked as a `cycle_street`; and we give it a priority of 2.
Is this priority of 2 effective more effective then say 1.5?
The maximum effective factor is given by `maxDefaultSpeed/speed`, which equals `33/23 = 1.43`.
In other words, every priority factor bigger than 1.43 has no extra benefit for this case.
Thus, a factor between 0 and 1 is always effective; but a factor above 1 is not guaranteed to have an effect.
## 5) Obstacle (specified on points, penalty time in seconds or -1 if blocked)
This block evaluates points encountered on the road.
The block specifies if this obstacle can be passed and eventually a penalty for passing it.
A value of "-1" is given if the obstacle can not be passed;
A value of "0" is given if the obstacle can be passed without problem.
A penalty in seconds is given if the obstacle slows you down. (E.g. a kerb might slow dow
This value is only used by the routing engine
E.g. a kerb is a showstopper for a wheelchair
<routingProfile name="wheelchair">
<point attribute="obstacle>
<select value="-1" t="barrier" v="kerb" />
</point>
</routingProfile>
E.g. a kerb causes a slight delay for cyclists
<routingProfile name="bicycle">
<point attribute="obstacle>
<select value="5" t="barrier" v="kerb" />
</point>
</routingProfile>
## 6) Obstacle_time (specified on points, penalty time in seconds)
Gives a slowdown time for an obstacle in seconds.
In contract to `obstacle`, this value is only used to calculate an ETA and show it on the UI once the route is calculated.
In other words, the values here do not influence routing.
## 7) Penalty_transition (specified on ways, penalty time in seconds)
When driving a car, changing from a motorway to a trunk slows you down: you should already slow down 500 meters before the trunk.
This has a penalty which is taken into account by (only) the navigation algorithm.
This is done by taking the difference between two penalties.
The formula used is `maximum(0, penalty_new_way - penalty_current_way)`.
E.g.
<way attribute="penalty_transition">
<select value="0" t="highway" v="motorway"/>
<select value="5" t="highway" v="motorway_link"/>
<select value="20" t="highway" v="tertiary"/>
</way>
This means that, going from a `motorway_link` to a `tertiary`, the penalty given will be
`maximum(0, 20 - 5)` or `15 seconds`.
On the other hand, going from motorway to motorway incurs no penalty, neither does going from a motorway_link to a motorway.
## 8) obstacle_srtm_alt_speed (specified on ways, in seconds of penalty for each height meter)
Specifies a penalty for steep ways. Optional. Note that the value of a key can be used as value. For more info about this, see the section about parameters.
E.g.:
<gt value1="-60" value2="$incline">
<select value="35"/>
</gt>
<gt value1="-17" value2="$incline">
<select value="10"/>
</gt>
<gt value1="-3" value2="$incline">
<select value="1"/>
</gt>
<gt value1="3" value2="$incline">
<select value="0"/>
</gt>
<gt value1="13" value2="$incline">
<select value="8"/>
</gt>
<gt value1="17" value2="$incline">
<select value="1"/>
</gt>
<gt value1="25" value2="$incline">
<select value="10"/>
</gt>
<select value="15"/>
has the following meaning:
-60% and less => 35 seconds per height metre
[-17% till -60%) => 17 seconds per height metre
[-3% tomm -17%) => 1 seconds per height metre
[3% till -3%) => 0 seconds per height metre
[3% till 17) => 1 seconds per height metre
... etc
A negative select value (seconds per height metre) means "impassable"
If the incline of a way be 20%, then the penalty per height metre is 10 seconds.
If the part of the way has for example 9 height meters, then the penalty for this part will be 10*9 = 90 seconds.
## Working with parameters and conditionals
A profile can be tuned further with parameters, to suit the need of each owner.
These toggles could be a preference for a fast route over a comfortable one, the desire to avoid borders, ...
### Declaring parameters
Parameters are declared on top of the routing profile, each in their own tag.
Such a tag could be:
<parameter id="some_parameter" (The name of the variable. You'll use this a lot)
group="some_group_name" (The name the group, used for grouping similar settings in a nice radiobox-UI)
name="Some routing option" (How this is presented to the user)
description="This routing options uses this or that feature"
(A description that is shown to the user)
type="boolean"/> (The type of the toggle. Supported values are `boolean` and `numeric`
#### Numeric parameters
Numeric parameters are declared just as a boolean parameter; but require some additional tags.
<parameter id="height" name="Height" description="height" (Same as boolean tags)
type="numeric" (This is a different type. Who would have guessed it?)
values="0,1.5,2,2.5,3,3.5,4" (The actual values, comma seperated. Floats and ints are allowed)
valueDescriptions="-,1.5m,2m,2.5m,3m,3.5m,4m (How each option is shown within the GUI)
/>
### Setting parameters via OsmAnd UI
The UI of OsmAnd automatically picks up those settings, if this document is deployed.
Just declaring a boolean option is enough to show a checkbox in the navigation settings.
Toggle the checkbox to see your custom profile in action!
The appearing extra toggle is also usefull to see the activation of your custom routing.xml.
### Using boolean parameters in the routing engine
The boolean options can be tested with an if-tag:
<if param="some_parameter">
... some select statements ...
</if>
Analogously, ifnot can be used as well
<ifnot param="some_parameter">
... selections ...
</ifnot>
E.g. if you cycle often with a cart, and that cart doesn't like `sett`-pavements, a toggle for this could be added:
<routingProfile name="bicycle" ... >
<parameter id="avoid_sett"
name="Avoid streets with sett"
description="Prefers asphalt, paving stones and concrete surfaces. Ideal if driving with a cycling cart"
type="boolean"/>
</routingProfile>
### Using numeric parameters in the routing engine
Numeric values can be used to compare to other values. For this, a `gt` (greater-then) tag is used.
The `gt`-tag acts just like an if-test.
For example, if the height of your car is set, you'll want to compare it with the `maxheight`-tag given to some ways. This is done with a `gt` tag:
<gt value1=":height" value2="$maxweight" type="height">
<select value="-1" t="maxweight" />
</gt>
To call a value, use either ':' or '$' as prefix. Use ':' for the parameters that you defined and '$' for tags loaded from the obf-file (the file containing the data from OSM).
The `type` gives a hint on how to parse the values. If the type is `height`, '1' will be interpreted as '1 meter'.
For a type `height`, '1' will be interpreted as one ton (1000 kg)
Miscellaneous
+++++++++++++
osmand_highway_integrity_brouting represents how good a way is for a bicycle.
Mostly it merges smoothness, surface and tracktype into one value. It is calculated internally?
### Alternative notation for <if><select /></if> and <gt><select /></gt>
A different but equivalent format for if- and gt-tags exists: the <if> can be placed inside a <select>
However, it is considered bad style (so don't use it).
In other words:
<if param="x">
<select value="..."/>
</if>
is totally equivalent to:
<select value="...">
<if param="x"/> (Deprecated notation)
</select>.
However, we recommend *not to use this format*. The if as outer tags are clearer, and support multiple selects:
<if param="$x">
<select value="1" t="y" v="z"/>
<select value="0" t="w" v="a"/>
...
</if>
-->
<routingProfile name="car" baseProfile="car" restrictionsAware="true" minDefaultSpeed="45.0" maxDefaultSpeed="130.0"
leftTurn="5" rightTurn="5" roundaboutTurn="5" onewayAware="true">
<!--
<attribute name="heuristicCoefficient" value="1.5" />
-->
<!-- NEW ROUTING API -->
<!-- <parameter id="prefer_motorway" name="Prefer motorways" description="Prefer motorways" type="boolean"/> -->
<!-- <parameter id="no_new_routing" name="Do not use v1.9 routing" description="Do not use v1.9 routing" type="boolean"/> -->
<parameter id="short_way" name="Short way" description="Short way" type="boolean"/>
<parameter id="avoid_toll" name="Avoid toll roads" description="Avoid toll roads" type="boolean"/>
<parameter id="avoid_unpaved" name="Avoid unpaved roads" description="Avoid unpaved roads" type="boolean"/>
<parameter id="avoid_ferries" name="Avoid ferries" description="Avoid ferries" type="boolean"/>
<parameter id="avoid_shuttle_train" name="Avoid Shuttle Trains" description="Avoid Shuttle Trains" type="boolean"/>
<parameter id="avoid_motorway" name="Avoid motorways" description="Avoid motorways" type="boolean"/>
<parameter id="avoid_borders" name="Avoid border crossing" description="Avoid crossing a border into another country" type="boolean"/>
<parameter id="avoid_ice_roads_fords" name="Avoid ice roads, fords" description="Avoid ice roads and fords" type="boolean"/>
<parameter id="allow_private" name="Allow private access" description="Allow access to private areas" type="boolean"/>
<parameter id="weight" name="Weight" description="Maximum vehicle weight to be permitted on the route" type="numeric" values="0,1.49,2.99,3.49,4.99,7.49,9.99,14.99,19.99,39.99" valueDescriptions="-,1.5t,3t,3.5t,5t,7.5t,10t,15t,20t,40t"/>
<parameter id="height" name="Height" description="Maximum vehicle height to be permitted on the route" type="numeric" values="0,1.49,1.99,2.49,2.99,3.49,3.99,4.49,4.99,5.49,5.99,6.49,6.99,7.49" valueDescriptions="-,1.5m,2m,2.5m,3m,3.5m,4m,4.5m,5m,5.5m,6m,6.5m,7m,7.5m"/>
<way attribute="access">
<select value="-1" t="osmand_change" v="delete"/>
<select value="-1" t="highway" v="proposed"/>
<select value="-1" t="highway" v="construction"/>
<select value="-1" t="construction" v="yes"/>
<select value="-1" t="highway" v="motorway">
<if param="avoid_motorway"/>
</select>
<select value="-1" t="ice_road" v="yes">
<if param="avoid_ice_roads_fords"/>
</select>
<select value="-1" t="winter_road" v="yes">
<if param="avoid_ice_roads_fords"/>
</select>
<select value="-1" t="ford" v="yes">
<if param="avoid_ice_roads_fords"/>
</select>
<select value="-1" t="toll" v="yes">
<if param="avoid_toll"/>
</select>
<select value="-1" t="route" v="ferry">
<if param="avoid_ferries"/>
</select>
<select value="-1" t="route" v="shuttle_train">
<if param="avoid_shuttle_train"/>
</select>
<if param="avoid_unpaved">
<select value="-1" t="highway" v="track"/>
<select value="-1" t="surface" v="unpaved"/>
<select value="-1" t="surface" v="compacted"/>
<select value="-1" t="surface" v="dirt"/>
<select value="-1" t="surface" v="gravel"/>
<select value="-1" t="surface" v="fine_gravel"/>
<select value="-1" t="surface" v="grass"/>
<select value="-1" t="surface" v="ground"/>
<select value="-1" t="surface" v="mud"/>
<select value="-1" t="surface" v="pebblestone"/>
<select value="-1" t="surface" v="sand"/>
<!-- <select value="-1" t="surface" v="wood"/>-->
<select value="-1" t="smoothness" v="very_bad"/>
<select value="-1" t="smoothness" v="horrible"/>
<select value="-1" t="smoothness" v="very_horrible"/>
<select value="-1" t="smoothness" v="impassable"/>
</if>
<select value="-1" t="highway" v="steps"/>
<select value="-1" t="motorcar" v="no"/>
<select value="-1" t="motorcar" v="agricultural"/>
<select value="-1" t="motorcar" v="forestry"/>
<select value="1" t="motorcar" v="yes"/>
<if param="allow_private">
<select value="1" t="motorcar" v="private"/>
</if>
<select value="-1" t="motorcar" v="private"/>
<select value="1" t="motorcar" v="permissive"/>
<select value="1" t="motorcar" v="designated"/>
<select value="1" t="motorcar" v="destination"/>
<select value="1" t="motorcar" v="customers"/>
<select value="1" t="motorcar" v="official"/>
<select value="-1" t="motor_vehicle" v="no"/>
<select value="-1" t="motor_vehicle" v="agricultural"/>
<select value="-1" t="motor_vehicle" v="forestry"/>
<select value="1" t="motor_vehicle" v="yes"/>
<if param="allow_private">
<select value="1" t="motor_vehicle" v="private"/>
</if>
<select value="-1" t="motor_vehicle" v="private"/>
<select value="1" t="motor_vehicle" v="permissive"/>
<select value="1" t="motor_vehicle" v="designated"/>
<select value="1" t="motor_vehicle" v="destination"/>
<select value="1" t="motor_vehicle" v="customers"/>
<select value="1" t="motor_vehicle" v="official"/>
<select value="-1" t="vehicle" v="no"/>
<select value="-1" t="vehicle" v="agricultural"/>
<select value="-1" t="vehicle" v="forestry"/>
<select value="1" t="vehicle" v="yes"/>
<if param="allow_private">
<select value="1" t="vehicle" v="private"/>
</if>
<select value="-1" t="vehicle" v="private"/>
<select value="1" t="vehicle" v="permissive"/>
<select value="1" t="vehicle" v="designated"/>
<select value="1" t="vehicle" v="destination"/>
<select value="1" t="vehicle" v="customers"/>
<select value="-1" t="access" v="no"/>
<select value="-1" t="access" v="agricultural"/>
<select value="-1" t="access" v="forestry"/>
<select value="-1" t="access" v="emergency"/>
<select value="1" t="access" v="yes"/>
<if param="allow_private">
<select value="1" t="access" v="private"/>
</if>
<select value="-1" t="access" v="private"/>
<select value="1" t="access" v="permissive"/>
<select value="1" t="access" v="destination"/>
<select value="1" t="access" v="customers"/>
<!-- introduce special tag motorcycle ! --><!-- What is special in it? It is a defined value and used in the database -->
<!-- <select value="-1" t="motorcycle" v="no"/>-->
<select value="-1" t="barrier" v="bollard"/>
<select value="-1" t="barrier" v="chain"/>
<select value="-1" t="barrier" v="debris"/>
<select value="-1" t="barrier" v="block"/>
<select value="-1" t="maxweight">
<gt value1=":weight" value2="$maxweight" type="weight"/>
</select>
<select value="-1" t="maxheight">
<gt value1=":height" value2="$maxheight" type="length"/>
</select>
<select value="1" t="highway" v="motorway"/>
<select value="1" t="highway" v="motorway_link"/>
<select value="1" t="highway" v="trunk"/>
<select value="1" t="highway" v="trunk_link"/>
<select value="1" t="highway" v="primary"/>
<select value="1" t="highway" v="primary_link"/>
<select value="1" t="highway" v="secondary"/>
<select value="1" t="highway" v="secondary_link"/>
<select value="1" t="highway" v="tertiary"/>
<select value="1" t="highway" v="tertiary_link"/>
<select value="1" t="highway" v="unclassified"/>
<select value="1" t="highway" v="road"/>
<select value="1" t="highway" v="residential"/>
<select value="1" t="highway" v="track"/>
<select value="1" t="highway" v="service"/>
<select value="1" t="highway" v="living_street"/>
<select value="1" t="route" v="ferry"/>
<select value="1" t="route" v="shuttle_train"/>
<select value="-1"/>
</way>
<way attribute="oneway">
<select value="1" t="oneway" v="yes"/>
<select value="1" t="oneway" v="1"/>
<select value="-1" t="oneway" v="-1"/>
<select value="1" t="roundabout"/>
<select value="1" t="junction" v="roundabout"/>
</way>
<way attribute="penalty_transition">
<!-- cost in time when you change the route from motorway to primary or from primary
to living_street, but not other way around. Calculated as difference between values -->
<!--
<if param="no_new_routing">
<select value="0"/>
</if>
-->
<if param="short_way">
<select value="0" t="highway" v="motorway"/>
<select value="5" t="highway" v="motorway_link"/>
<select value="5" t="highway" v="trunk"/>
<select value="10" t="highway" v="trunk_link"/>
<select value="10" t="highway" v="primary"/>
<select value="15" t="highway" v="primary_link"/>
<select value="15" t="highway" v="secondary"/>
<select value="20" t="highway" v="secondary_link"/>
<select value="20" t="highway" v="tertiary"/>
<select value="25" t="highway" v="tertiary_link"/>
<select value="40" t="highway" v="service"/>
<select value="25"/>
</if>
<select value="0" t="highway" v="motorway"/>
<select value="10" t="highway" v="motorway_link"/>
<select value="10" t="highway" v="trunk"/>
<select value="15" t="highway" v="trunk_link"/>
<select value="50" t="highway" v="primary"/>
<select value="60" t="highway" v="primary_link"/>
<select value="100" t="highway" v="secondary"/>
<select value="110" t="highway" v="secondary_link"/>
<select value="130" t="highway" v="tertiary"/>
<select value="139" t="highway" v="tertiary_link"/>
<select value="185" t="highway" v="residential"/>
<select value="230" t="highway" v="service"/>
<select value="200"/>
<!--
<select value="" t="highway" v="road"/>
<select value="" t="highway" v="residential"/>
<select value="" t="highway" v="track"/>
<select value="" t="highway" v="unclassified"/>
<select value="" t="highway" v="service"/>
<select value="" t="highway" v="living_street"/>
<select value="" t="route" v="ferry"/>-->
</way>
<way attribute="speed" type="speed">
<!-- shortway handled internally -->
<select value="$maxspeed:practical" t="maxspeed:practical"/>
<select value="$maxspeed:advisory" t="maxspeed:advisory"/>
<select value="$maxspeed" t="maxspeed"/>
<!-- most important backbone roads -->
<select value="110" t="highway" v="motorway"/>
<select value="110" t="highway" v="motorway_link"/>
<select value="100" t="highway" v="trunk"/>
<select value="100" t="highway" v="trunk_link"/>
<!-- generally linking larger towns -->
<select value="65" t="highway" v="primary"/>
<select value="65" t="highway" v="primary_link"/>
<!-- generally linking smaller towns and villages -->
<select value="60" t="highway" v="secondary"/>
<select value="60" t="highway" v="secondary_link"/>
<!-- important urban roads -->
<select value="45" t="highway" v="tertiary"/>
<select value="45" t="highway" v="tertiary_link"/>
<!-- Some values of "abutters" mean the road is inside a place,
so cap the speed even if it is a high level road (below). -->
<!--
<select value="30" t="abutters" v="residential"/>
<select value="30" t="abutters" v="commercial"/>
<select value="30" t="abutters" v="retail"/>
<select value="30" t="abutters" v="industrial"/>
<select value="30" t="abutters" v="mixed"/>
-->
<!-- roads with speeds lower than 50 and those that we want to ignore abutters
must be placed before the "abutters" block below. -->
<!-- lowest form of grid network, usually 90% of urban roads -->
<select value="35" t="highway" v="unclassified"/>
<!-- road = no type, no review and may be not accurate -->
<select value="35" t="highway" v="road"/>
<select value="35" t="highway" v="residential"/>
<select value="15" t="highway" v="track"/>
<select value="30" t="highway" v="service"/>
<select value="25" t="highway" v="living_street"/>
<select value="15" t="route" v="ferry"/>
<select value="60" t="route" v="shuttle_train"/>
</way>
<way attribute="priority">
<!-- not working fine -->
<!--
<if param="prefer_motorway">
<select value="1.2" t="highway" v="motorway"/>
<select value="1.1" t="highway" v="motorway_link"/>
<select value="1.2" t="highway" v="trunk"/>
<select value="1.1" t="highway" v="trunk_link"/>
</if> -->
<!-- access deprioritize -->
<select t="tracktype" v="grade5" value="0.2"/>
<select t="motorcar" v="private" value="0.15"/>
<select t="motorcar" v="destination" value="0.15"/>
<select t="motorcar" v="delivery" value="0.15"/>
<select t="motorcar" v="customers" value="0.15"/>
<select t="motor_vehicle" v="private" value="0.15"/>
<select t="motor_vehicle" v="destination" value="0.15"/>
<select t="motor_vehicle" v="delivery" value="0.15"/>
<select t="motor_vehicle" v="customers" value="0.15"/>
<select t="vehicle" v="private" value="0.15"/>
<select t="vehicle" v="destination" value="0.15"/>
<select t="vehicle" v="delivery" value="0.15"/>
<select t="vehicle" v="customers" value="0.15"/>
<select t="access" v="private" value="0.15"/>
<select t="access" v="destination" value="0.15"/>
<select t="access" v="delivery" value="0.15"/>
<select t="access" v="customers" value="0.15"/>
<select value="0.3" t="smoothness" v="very_bad"/>
<select value="0.15" t="smoothness" v="horrible"/>
<select value="0.1" t="smoothness" v="very_horrible"/>
<select value="0.05" t="smoothness" v="impassable"/>
<select value="1.1" t="highway" v="motorway"/>
<!-- make links slightly smaller so in connections they will not be used -->
<select value="1.05" t="highway" v="motorway_link"/>
<select value="1" t="highway" v="trunk"/>
<select value="0.95" t="highway" v="trunk_link"/>
<!-- generally linking larger towns. -->
<select value="1.0" t="highway" v="primary"/>
<select value="0.95" t="highway" v="primary_link"/>
<!-- generally linking smaller towns and villages -->
<select value="0.95" t="highway" v="secondary"/>
<select value="0.9" t="highway" v="secondary_link"/>
<!-- important urban roads -->
<select value="0.9" t="highway" v="tertiary"/>
<select value="0.85" t="highway" v="tertiary_link"/>
<!-- lowest form of grid network, usually 90% of urban roads -->
<select value="0.7" t="highway" v="unclassified"/>
<!-- road = no type, no review and may be not accurate -->
<select value="0.7" t="highway" v="road"/>
<select value="0.7" t="highway" v="residential"/>
<select value="0.5" t="highway" v="track"/>
<select value="0.5" t="highway" v="service"/>
<select value="0.5" t="highway" v="living_street"/>
<select value="1" t="route" v="ferry"/>
<select value="1" t="route" v="shuttle_train"/>
<select value="0.7"/>
</way>
<point attribute="obstacle_time">
<select value="5" t="barrier" v="entrance"/>
<select value="15" t="barrier" v="gate"/>
<select value="15" t="barrier" v="lift_gate"/>
<select value="30" t="barrier" v="swing_gate"/>
<select value="25" t="barrier" v="toll_booth"/>
<select value="25" t="barrier"/>
<select value="10" t="traffic_calming"/>
<select value="30" t="highway" v="traffic_signals"/>
<select value="1" t="crossing" v="unmarked"/>
<select value="5" t="crossing" v="uncontrolled"/>
<select value="15" t="highway" v="crossing"/>
<select value="15" t="highway" v="stop"/>
<select value="10" t="highway" v="give_way"/>
<select value="25" t="ford"/>
<select value="25" t="railway" v="crossing"/>
<select value="25" t="railway" v="level_crossing"/>
</point>
<point attribute="obstacle">
<if param="avoid_toll">
<select value="-1" t="barrier" v="toll_booth"/>
</if>
<if param="avoid_borders">
<select value="-1" t="barrier" v="border_control"/>
</if>
<!-- Some barrier nodes are combined with maxheight, e.g. height_restrictor or underground parking entrances. -->
<select value="-1" t="maxheight">
<gt value1=":height" value2="$maxheight" type="length"/>
</select>
<!-- If access for a car is explicitly marked, the barrier is passable,
with a slight penalty.
If no access for a car is explicitly marked, the barrier is impassable.
Evaluate the keys in descending order of the specificity in the access hierarchy. -->
<select value="-1" t="motorcar" v="no"/>
<select value="-1" t="motorcar" v="agricultural"/>
<select value="-1" t="motorcar" v="forestry"/>
<if param="allow_private">
<select value="180" t="motorcar" v="private"/>
</if>
<select value="60" t="motorcar" v="destination"/>
<select value="0" t="motorcar" v="yes"/>
<select value="0" t="motorcar" v="permissive"/>
<select value="0" t="motorcar" v="designated"/>
<select value="0" t="motorcar" v="customers"/>
<select value="0" t="motorcar" v="official"/>
<select value="-1" t="motor_vehicle" v="no"/>
<select value="-1" t="motor_vehicle" v="agricultural"/>
<select value="-1" t="motor_vehicle" v="forestry"/>
<if param="allow_private">
<select value="180" t="motor_vehicle" v="private"/>
</if>
<select value="60" t="motor_vehicle" v="destination"/>
<select value="0" t="motor_vehicle" v="yes"/>
<select value="0" t="motor_vehicle" v="permissive"/>
<select value="0" t="motor_vehicle" v="designated"/>
<select value="0" t="motor_vehicle" v="customers"/>
<select value="0" t="motor_vehicle" v="official"/>
<select value="-1" t="vehicle" v="no"/>
<select value="-1" t="vehicle" v="agricultural"/>
<select value="-1" t="vehicle" v="forestry"/>
<if param="allow_private">
<select value="180" t="vehicle" v="private"/>
</if>
<select value="60" t="vehicle" v="destination"/>
<select value="0" t="vehicle" v="yes"/>
<select value="0" t="vehicle" v="permissive"/>
<select value="0" t="vehicle" v="designated"/>
<select value="0" t="vehicle" v="customers"/>
<select value="-1" t="access" v="no"/>
<select value="-1" t="access" v="agricultural"/>
<select value="-1" t="access" v="forestry"/>
<if param="allow_private">
<select value="180" t="access" v="private"/>
</if>
<select value="60" t="access" v="destination"/>
<select value="0" t="access" v="yes"/>
<select value="0" t="access" v="permissive"/>
<select value="0" t="access" v="customers"/>
<if param="short_way">
<select value="0" t="barrier" v="cattle_grid"/>
<select value="0" t="barrier" v="border_control"/>
<select value="0" t="barrier" v="bump_gate"/>
<select value="0" t="barrier" v="entrance"/>
<select value="0" t="barrier" v="sally_port"/>
<select value="0" t="barrier" v="toll_booth"/>
<select value="0" t="barrier" v="lift_gate"/>
<select value="0" t="barrier" v="swing_gate"/>
<select value="-1" t="barrier"/>
</if>
<select value="5" t="barrier" v="cattle_grid"/>
<select value="300" t="barrier" v="border_control"/>
<select value="300" t="barrier" v="bump_gate"/>
<select value="1" t="barrier" v="entrance"/>
<select value="100" t="barrier" v="sally_port"/>
<select value="1" t="barrier" v="toll_booth"/>
<!-- These 2 shouldn't be allowed per the wiki (access=no is assumed) but people often do not add the proper access tags. -->
<select value="300" t="barrier" v="lift_gate"/>
<select value="300" t="barrier" v="swing_gate"/>
<!-- Without explicit access marking, barriers other than the listed values above are impassable to a car. -->
<if param="allow_private">
<select value="300" t="barrier" v="gate"/>
</if>
<select value="-1" t="barrier"/>
<select value="10" t="traffic_calming"/>
<!-- New introduction to not drive through city -->
<select value="15" t="highway" v="traffic_signals"/>
<select value="25" t="ford"/>
</point>
</routingProfile>
<routingProfile name="bicycle" baseProfile="bicycle" restrictionsAware="true" minDefaultSpeed="2" maxDefaultSpeed="33"
leftTurn="4" rightTurn="2" followSpeedLimitations="false" onewayAware="true" heuristicCoefficient="1.4">
<!-- <attribute name="relaxNodesIfStartDistSmallCoeff" value="2.5"/> -->
<!-- New ROUTING API -->
<!-- <parameter id="driving_style" name="Driving style" description="Safe, fast or balanced driving" type="numeric" values="0,1,2" valueDescriptions="Safety,Balance,Speed"/>-->
<!-- <parameter id="relief_smoothness_factor" name="Relief smoothness factor" description="More plains or more hills" type="numeric" values="0,1,2" valueDescriptions="More plains,Balance,More hills"/>-->
<parameter id="driving_style_safety" group="driving_style" name="Safety" description="" type="boolean"/>
<parameter id="driving_style_balance" group="driving_style" name="Balance" description="" type="boolean" default="true"/>
<parameter id="driving_style_speed" group="driving_style" name="Speed" description="" type="boolean"/>
<parameter id="relief_smoothness_factor_more_plains" group="relief_smoothness_factor" name="More plains" description="" type="boolean"/>
<parameter id="relief_smoothness_factor_plains" group="relief_smoothness_factor" name="Plains" description="" type="boolean" default="true"/>
<parameter id="relief_smoothness_factor_hills" group="relief_smoothness_factor" name="Hills" description="" type="boolean"/>
<parameter id="avoid_unpaved" name="Avoid unpaved roads" description="Avoid unpaved roads" type="boolean"/>
<parameter id="avoid_ferries" name="Avoid ferries" description="Avoid ferries" type="boolean"/>
<parameter id="avoid_stairs" name="Avoid stairs" description="Avoid stairs" type="boolean"/>
<parameter id="avoid_borders" name="Avoid border crossing" description="Avoid crossing a border into another country" type="boolean"/>
<parameter id="allow_motorway" name="Allow motorways" description="Allow motorways" type="boolean"/>
<parameter id="height_obstacles" name="Use elevation data" description="Use terrain elevation data provided by SRTM, ASTER and EU-DEM" type="boolean"/>
<way attribute="access">
<select value="-1" t="osmand_change" v="delete"/>
<select value="-1" t="highway" v="proposed"/>
<select value="-1" t="highway" v="construction"/>
<select value="-1" t="construction" v="yes"/>
<if param="allow_motorway">
<select value="-1" t="access" v="no"/>
<select value="-1" t="access" v="private"/>
<select value="-1" t="motorroad" v="yes"/>
<select value="-1" t="bicycle" v="no"/>
<select value="-1" t="vehicle" v="no"/>
<select value="1" t="highway" v="motorway"/>
<select value="1" t="highway" v="motorway_link"/>
<select value="1" t="highway" v="trunk"/>
<select value="1" t="highway" v="trunk_link"/>
<!-- line above: I have deleted this line, it concerned motorroads.
These have already been excluded above (which is the right choice). -->
</if>
<select value="-1" t="route" v="ferry">
<if param="avoid_ferries"/>
</select>
<select value="-1" t="highway" v="steps">
<if param="avoid_stairs"/>
</select>
<select value="-1" t="highway" v="motorway"/>
<select value="-1" t="highway" v="motorway_link"/>
<select value="-1" t="motorroad" v="yes"/>
<!-- lines above: These lines should be moved here
to make sure that motorways are excluded if they
are not explicitly allowed by the user.-->
<select value="-1" t="highway" v="elevator"/>
<select value="-1" t="bicycle" v="no"/>
<select value="1" t="bicycle" v="yes"/>
<select value="1" t="bicycle" v="permissive"/>
<select value="1" t="bicycle" v="designated"/>
<select value="1" t="bicycle" v="destination"/>
<select value="1" t="bicycle" v="official"/>
<select value="1" t="bicycle" v="use_sidepath"/>
<select value="1" t="bicycle" v="dismount"/>
<if param="driving_style_safety">
<select value="-1" t="highway" v="trunk"/>
<select value="-1" t="highway" v="trunk_link"/>
</if>
<select value="1" t="highway" v="trunk"/>
<select value="1" t="highway" v="trunk_link"/>
<!-- a user indicated a trunk road in England that was a
a necessary link. So only in safety style trunk is excluded now. -->
<select value="-1" t="sac_scale" v="demanding_mountain_hiking"/>
<select value="-1" t="sac_scale" v="alpine_hiking"/>
<select value="-1" t="sac_scale" v="demanding_alpine_hiking"/>
<select value="-1" t="sac_scale" v="difficult_alpine_hiking"/>
<select value="-1" t="mtb:scale" v="5"/>
<select value="-1" t="mtb:scale" v="6"/>
<select value="1" t="vehicle" v="agricultural"/>
<select value="1" t="vehicle" v="forestry"/>
<select value="1" t="vehicle" v="yes"/>
<select value="1" t="vehicle" v="permissive"/>
<select value="1" t="vehicle" v="designated"/>
<select value="1" t="vehicle" v="destination"/>
<select value="-1" t="access" v="no"/>
<select value="-1" t="access" v="private"/>
<select value="1" t="access" v="agricultural"/>
<select value="1" t="access" v="forestry"/>
<select value="1" t="access" v="yes"/>
<select value="1" t="access" v="permissive"/>
<select value="1" t="highway" v="cycleway"/>
<select value="1" t="route_bicycle"/>
<!-- Two lines above: These have to be before the vehicle=no command -->
<select value="-1" t="vehicle" v="no"/>
<select value="-1" t="crossing" v="no"/>
<select value="1" t="highway" v="primary"/>
<select value="1" t="highway" v="primary_link"/>
<select value="1" t="highway" v="secondary"/>
<select value="1" t="highway" v="secondary_link"/>
<select value="1" t="highway" v="tertiary"/>
<select value="1" t="highway" v="tertiary_link"/>
<select value="1" t="highway" v="road"/>
<select value="1" t="highway" v="residential"/>
<select value="1" t="highway" v="unclassified"/>
<select value="1" t="highway" v="service"/>
<select value="1" t="highway" v="track"/>
<select value="1" t="highway" v="path"/>
<select value="1" t="highway" v="footway"/>
<select value="1" t="highway" v="living_street"/>
<select value="1" t="highway" v="pedestrian"/>
<select value="1" t="highway" v="byway"/>
<select value="1" t="highway" v="platform"/>
<select value="1" t="highway" v="services"/>
<select value="1" t="highway" v="bridleway"/>
<select value="1" t="highway" v="steps"/>
<select value="1" t="route" v="ferry"/>
<select value="-1"/>
</way>
<way attribute="oneway">
<select value="0" t="cycleway" v="opposite_lane"/>
<select value="0" t="cycleway" v="opposite_track"/>
<select value="0" t="cycleway" v="opposite_share_busway"/>
<select value="0" t="cycleway" v="opposite"/>
<select value="0" t="oneway:bicycle" v="no"/>
<select value="1" t="oneway:bicycle" v="yes"/>
<select value="1" t="oneway" v="yes"/>
<select value="1" t="oneway" v="1"/>
<select value="-1" t="oneway" v="-1"/>
<select value="1" t="roundabout" v="yes"/>
<select value="1" t="junction" v="roundabout"/>
</way>
<way attribute="speed" type="speed">
<select value="1.3" t="highway" v="steps"/>
<select value="3" t="route" v="ferry"/>
<select value="6" t="bicycle" v="dismount"/>
<if param="driving_style_speed">
<select value="19" t="highway" v="motorway"/>
<select value="19" t="highway" v="motorway_link"/>
<select value="19" t="highway" v="trunk"/>
<select value="19" t="highway" v="trunk_link"/>
<select value="19" t="highway" v="primary"/>
<select value="19" t="highway" v="primary_link"/>
<select value="19" t="highway" v="secondary"/>
<select value="19" t="highway" v="secondary_link"/>
<select value="19" t="highway" v="tertiary"/>
<select value="19" t="highway" v="tertiary_link"/>
<select value="21" t="route_bicycle"/>
<!-- Line above: Command should be moved up here, to be applied more
often. If a residential way is marked route bicycle, this higher value will
now apply. The same for all the categories that follow. This makes
sense even in speed style, because if you stay away from main roads,
you avoid traffic lights (and thus save time). So main roads will be
avoided if there is an official cycle route nearby (should be fast). -->
<!-- Line above: Is there a possibility to EXCLUDE this command if avoid unpaved is set? -->
<select value="19" t="highway" v="residential"/>
<select value="18" t="highway" v="unclassified"/>
<select value="33" t="highway" v="cycleway"/>
<select value="33" t="path_bicycle_designated"/>
<select value="28" t="bicycle" v="designated"/>
<select value="8.5" t="highway" v="track"/>
<select value="7" t="highway" v="footway"/>
<select value="6" t="highway" v="path"/>
</if>
<select value="6" t="highway" v="motorway"/>
<select value="6" t="highway" v="motorway_link"/>
<select value="7" t="highway" v="trunk"/>
<select value="7" t="highway" v="trunk_link"/>
<select value="20" t="cycleway" v="sidepath"/>
<!-- Line above: This tag is used for cycleways along main
roads. These need to be downgraded before the 31 kmh
for bicycle designated are set. -->
<ifnot param="avoid_unpaved">
<select value="31" t="bicycle" v="designated"/>
</ifnot>
<!-- Lines above: This fixed value for bicycle=designated will not be applied in
"avoid unpaved" mode. Reason: The kmh value that we set here is fixed, it can not
be downgraded later. Generally, it makes sense to set a fixed value here for
bicycle=designated. Otherwise there would be one major error: The combination of
designated AND asphalt (frequently found ) would get a much lower value than just
designated alone. -->
<if param="driving_style_safety">
<select value="7" t="highway" v="primary"/>
<select value="7" t="highway" v="primary_link"/>
<select value="9" t="highway" v="secondary"/>
<select value="9" t="highway" v="secondary_link"/>
<select value="14" t="highway" v="tertiary"/>
<select value="14" t="highway" v="tertiary_link"/>
<select value="18" t="highway" v="residential"/>
<select value="24" t="highway" v="cycleway"/>
<select value="27" t="route_bicycle"/>
<!-- The integration of "bicycle routes" offers great possibilities.
But still there are many examples where Osmand can even find
a better alternative. Now, three choices help to combine the
strengths of the existing routing with bicycle routes:
First, if a path, track or footway is a cycle route, it gets a big upgrade.
Second, bicycle routes that lead over main roads are not upgraded. They
are normally not especially safe or attractive. Example: In Berlin, one
cycle route is on "Heerstrasse" which is not good for cycling at all. And
for some cycle routes in Berlin and Vienna there are better alternatives.
Third, there are even some unpaved bicycle routes. These get a downgrade
later. And if a bicycle route has no surface tag, there is a slight risk that
it is unpaved. Therefore, it will be downgraded a little bit. -->
<select value="22" t="highway" v="track"/>
<select value="20" t="highway" v="path"/>
<select value="19" t="highway" v="footway"/>
</if>
<select value="10" t="highway" v="primary"/>
<select value="10" t="highway" v="primary_link"/>
<select value="13" t="highway" v="secondary"/>
<select value="13" t="highway" v="secondary_link"/>
<select value="18" t="highway" v="tertiary"/>
<select value="18" t="highway" v="tertiary_link"/>
<select value="25.0" t="route_bicycle"/>
<select value="23" t="highway" v="residential"/>
<select value="24" t="highway" v="cycleway"/>
<select value="23" t="highway" v="unclassified"/>
<select value="11" t="highway" v="service"/>
<select value="22" t="highway" v="track"/>
<select value="19" t="highway" v="path"/>
<select value="15" t="highway" v="footway"/>
<select value="19" t="highway" v="road"/>
<select value="24" t="highway" v="living_street"/>
<select value="8" t="highway" v="pedestrian"/>
<select value="10" t="highway" v="byway"/>
<select value="2" t="highway" v="platform"/>
<select value="2" t="highway" v="services"/>
<select value="2" t="highway" v="bridleway"/>
<select value="14.5"/>
</way>
<way attribute="obstacle_srtm_alt_speed">
<if param="height_obstacles">
<gt value1="-100" value2=":incline">
<select value="-1" t="osmand_highway_integrity_brouting_low" v="yes"/>
<select value="-1" t="highway" v="path"/>
<select value="-1" t="highway" v="track"/>
</gt>
<gt value1="-25" value2=":incline">
<select value="180" t="osmand_highway_integrity_brouting_low" v="yes"/>
<select value="180" t="highway" v="path"/>
<select value="170" t="highway" v="track"/>
</gt>
<gt value1="-17" value2=":incline">
<select value="150" t="osmand_highway_integrity_brouting_low" v="yes"/>
<select value="150" t="highway" v="path"/>
<select value="140" t="highway" v="track"/>
</gt>
<gt value1="-9" value2=":incline">
<select value="30" t="osmand_highway_integrity_brouting_low" v="yes"/>
<select value="30" t="highway" v="path"/>
<select value="25" t="highway" v="track"/>
</gt>
<gt value1="-3" value2=":incline">
<select value="2" t="osmand_highway_integrity_brouting_low" v="yes"/>
<select value="2" t="highway" v="path"/>
<select value="2" t="highway" v="track"/>
</gt>
<if param="relief_smoothness_factor_more_plains">
<gt value1="3" value2=":incline">
<select value="2"/>
</gt>
<gt value1="7" value2=":incline">
<select value="12"/>
</gt>
<gt value1="13" value2=":incline">
<select value="30"/>
</gt>
<gt value1="25" value2=":incline">
<select value="50"/>
</gt>
<select value="74"/>
</if>
<if param="relief_smoothness_factor_hills">
<gt value1="0" value2=":incline">
<select value="128"/>
</gt>
<gt value1="3" value2=":incline">
<select value="64"/>
</gt>
<gt value1="7" value2=":incline">
<select value="17"/>
</gt>
<gt value1="13" value2=":incline">
<select value="10"/>
</gt>
<gt value1="25" value2=":incline">
<select value="8"/>
</gt>
<select value="2"/>
</if>
<gt value1="3" value2=":incline">
<select value="2"/>
</gt>
<gt value1="7" value2=":incline">
<select value="8"/>
</gt>
<gt value1="13" value2=":incline">
<select value="16"/>
</gt>
<gt value1="25" value2=":incline">
<select value="32"/>
</gt>
<select value="48"/>
</if>
</way>
<way attribute="priority">
<select value="0.1" t="bicycle" v="private"/>
<select value="0.2" t="bicycle" v="destination"/>
<!-- <select value="0.05" t="access" v="private"/>-->
<select value="0.3" t="indoor" v="yes"/>
<select value="0.1" t="barrier" v="debris"/>
<select value="0.1" t="bicycle" v="use_sidepath"/>
<if param="avoid_unpaved">
<select value="0.3" t="osmand_highway_integrity_brouting" v="3"/>
<select value="0.28" t="osmand_highway_integrity_brouting" v="4"/>
<select value="0.27" t="osmand_highway_integrity_brouting" v="5"/>
<select value="0.25" t="osmand_highway_integrity_brouting" v="6"/>
<select value="0.2" t="osmand_highway_integrity_brouting" v="7"/>
<select value="0.15" t="osmand_highway_integrity_brouting" v="8"/>
<select value="0.1" t="osmand_highway_integrity_brouting" v="9"/>
<select value="0.05" t="osmand_highway_integrity_brouting" v="10"/>
<!-- <select value="0.4" t="tracktype" v="grade2"/>
<select value="0.1" t="tracktype" v="grade3"/>
<select value="0.1" t="tracktype" v="grade4"/>
<select value="0.1" t="tracktype" v="grade5"/>
<select value="0.1" t="surface" v="unpaved"/>
<select value="0.4" t="surface" v="compacted"/>
<select value="0.1" t="surface" v="dirt"/>
<select value="0.1" t="surface" v="earth"/>
<select value="0.1" t="surface" v="gravel"/>
<select value="0.4" t="surface" v="fine_gravel"/>
<select value="0.1" t="surface" v="grass"/>
<select value="0.1" t="surface" v="ground"/>
<select value="0.1" t="surface" v="mud"/>
<select value="0.1" t="surface" v="pebblestone"/>
<select value="0.1" t="surface" v="sand"/>-->
<select value="0.1" t="mtb:scale" v="1"/>
<select value="0.1" t="mtb:scale" v="2"/>
<select value="0.1" t="class:bicycle:mtb" v="-1"/>
<!-- <select value="0.6" t="surface" v="wood"/>-->
</if>
<select value="1.0" t="bicycle" v="dismount"/>
<select value="1.0" t="cycleway" v="sidepath"/>
<!-- Following lines: I would suggest to change
the order, according to the following scheme:
1.) First step: Downgrade all the ways that have a really bad
surface (mud, grade5 etc). Those should be downgraded in any
case (no matter if path/primary/cycleway/etc). Also,
"cobblestone" should already be downgraded here (otherwise,
it would be ignored too often, for example because it is
overruled by "bicycle=yes").
2.) Upgrade cycle lanes and cycle tracks. Normally, those are
paved (great), but they go along main roads, so I suggest a
factor of 1.6/1.5 (which is already a big upgrade).
3.) Assign a neutral factor to main roads. These are
normally paved, but often, there is no tag for the surface:
It makes no sense to upgrade only those main roads that just
happen to be tagged with paved, asphalt, etc.
4.) Upgrade all tracks, paths etc with a paved surface.
Very important to do this before "bicycle=yes" (etc).
Example: In parks, forests or fields, tracks are often
tagged with bicycle=yes. But only a few tracks are tagged
as paved. So it is important to check the "paved" first,
so that paved / asphalt tracks gets a priority. Otherwise,
all tracks with bicycle=yes would be treated the same.
5.) Only in "avoid unpaved" mode: Downgrade all paths and tracks
now, even if they might later be marked bicycle=yes/official/etc.
6.) Upgrade all ways that are tagged bicycle=yes/official etc.
(this should only be done after the distinction between
unpaved and paved/asphalt/etc )
7.) Downgrade difficult surfaces such as sand, grass etc.
This is done late, because sand / grass are not necessarily
very bad. A tag like "sand" is often put for compacted surfaces.
So if a sand way is marked "bicycle=yes" before, it should be good.
Accordingly, some tags that lead only to a slight upgrade are also
put here.
8.) Downgrade paths, tracks etc. If up to now, no surface or bicycle
tag has been detected, the path has a certain risk of having a bad
surface (we just do not know). To make sure, all smaller ways are
downgraded now.-->
<select value="0.1" t="sac_scale" v="mountain_hiking"/>
<select value="0.5" t="class:bicycle:mtb" v="3"/>
<select value="0.3" t="class:bicycle:mtb" v="2"/>
<select value="0.2" t="class:bicycle:mtb" v="1"/>
<select value="0.1" t="class:bicycle:mtb" v="-1"/>
<select value="0.3" t="mtb:scale" v="1"/>
<select value="0.2" t="mtb:scale" v="2"/>
<select value="0.1" t="mtb:scale" v="3"/>
<select value="0.05" t="mtb:scale" v="4"/>
<select value="0.5" t="tracktype" v="grade5"/>
<select value="0.2" t="smoothness" v="horrible"/>
<select value="0.15" t="smoothness" v="very_horrible"/>
<select value="0.1" t="smoothness" v="impassable"/>
<select value="0.61" t="osmand_highway_integrity_brouting" v="5"/>
<select value="0.4" t="osmand_highway_integrity_brouting" v="6"/>
<select value="0.3" t="osmand_highway_integrity_brouting" v="7"/>
<select value="0.2" t="osmand_highway_integrity_brouting" v="8"/>
<select value="0.1" t="osmand_highway_integrity_brouting" v="9"/>
<select value="0.05" t="osmand_highway_integrity_brouting" v="10"/>
<select value="0.65" t="surface" v="cobblestone"/>
<select value="1.5" t="cycleway" v="lane"/>
<select value="1.5" t="cycleway" v="opposite_lane"/>
<select value="1.1" t="cycleway" v="share_busway"/>
<select value="1.6" t="cycleway" v="track"/>
<select value="1.6" t="cycleway" v="opposite_track"/>
<select value="0.9" t="cycleway" v="shared"/>
<select value="0.9" t="cycleway" v="shared_lane"/>
<select value="0.3" t="footway" v="sidewalk"/>
<select value="1.0" t="segregated" v="yes"/>
<select value="1.0" t="highway" v="primary"/>
<select value="1.0" t="highway" v="secondary"/>
<select value="1.0" t="highway" v="tertiary"/>
<select value="1.0" t="highway" v="service"/>
<select value="1.35" t="surface" v="asphalt"/>
<select value="1.35" t="surface" v="paved"/>
<select value="1.35" t="surface" v="concrete"/>
<select value="1.30" t="surface" v="paving_stones"/>
<select value="1.35" t="osmand_highway_integrity_brouting" v="0"/>
<select value="1.3" t="osmand_highway_integrity_brouting" v="1"/>
<if param="avoid_unpaved">
<select value="0.3" t="highway" v="footway"/>
<select value="0.3" t="highway" v="track"/>
<select value="0.2" t="highway" v="path"/>
</if>
<select value="1.25" t="highway" v="cycleway"/>
<!-- I have downgraded cycleways here and upgraded their
kmh value at the same time. First, cycleways with
asphalt yes should get a slight upgrade (there are also
cycleways with compacted). Second, the end value for
cycleways should be lower than the value for paths and
footways with bicycle designated. Cycleways are often
along main roads, whereas the attractive ways for
bicycles (in parks or along rivers) are normally tagged
bicycle=designated or yes. -->
<select value="1.8" t="bicycle" v="official"/>
<select value="1.8" t="bicycle" v="designated"/>
<select value="1.3" t="bicycle" v="yes"/>
<!-- the value for bicycle=yes needs to be smaller than the
values for paved and asphalt. Reason: Often you have areas with
several paths that are tagged bicycle yes, but only some of these
paths are also tagged paved. In that case, the paved paths should
get a higher priority. -->
<select value="1.1" t="surface" v="compacted"/>
<select value="1.1" t="surface" v="fine_gravel"/>
<select value="1.0" t="surface" v="wood"/>
<select value="1.1" t="osmand_highway_integrity_brouting" v="2"/>
<select value="0.92" t="osmand_highway_integrity_brouting" v="3"/>
<select value="0.8" t="osmand_highway_integrity_brouting" v="4"/>
<select value="1.3" t="smoothness" v="excellent"/>
<select value="1.0" t="smoothness" v="good"/>
<select value="0.9" t="smoothness" v="intermediate"/>
<select value="1.3" t="tracktype" v="grade1"/>
<select value="1.15" t="tracktype" v="grade2"/>
<select value="1.0" t="tracktype" v="grade3"/>
<select value="0.7" t="tracktype" v="grade4"/>
<select value="0.9" t="surface" v="gravel"/>
<select value="0.8" t="surface" v="unpaved"/>
<select value="0.8" t="smoothness" v="bad"/>
<select value="0.50" t="surface" v="dirt"/>
<select value="0.45" t="surface" v="sand"/>
<select value="0.75" t="surface" v="earth"/>
<select value="0.65" t="surface" v="grass"/>
<select value="0.75" t="surface" v="ground"/>
<select value="0.5" t="surface" v="mud"/>
<select value="0.5" t="smoothness" v="very_bad"/>
<select value="1.2" t="route_bicycle"/>
<!-- If a part of a bicycle route has a surface tag, it will have
been upgraded or downgraded up to this point. The value
1.2 here is applied to all bicycle routes with no surface tag. -->
<select value="1.25" t="highway" v="residential"/>
<!-- New: The factor for residential is better placed here, so that we can
first downgrade all residential that are tagged with a bad surface.
Overpass shows many cases of residential with sand, unpaved, etc.
And: Even in big cities, the surface of residential is often not tagged
at all. So residential roads that have no surface tag, now get a slightly
lower value than those with asphalt or paved. The value of 1.25 is
right because it should be close to the 1.35 for paved. Reason: Many
residential roads still have no surface tag at all. Most of them are
asphalt (but we do not know for sure). So, they should be downgraded
a bit (to take into account that they might be unpaved), but not too much
(because most of them will still be paved). -->
<select value="1.25" t="highway" v="living_street"/>
<select value="1.25" t="highway" v="unclassified"/>
<select value="1.0" t="highway" v="road"/>
<select value="0.75" t="highway" v="footway"/>
<select value="0.7" t="highway" v="track"/>
<select value="0.6" t="highway" v="path"/>
<if param="driving_style_speed">
<select value="1.4" t="highway" v="motorway"/>
<select value="1.3" t="highway" v="motorway_link"/>
<select value="1.4" t="highway" v="trunk"/>
<select value="1.3" t="highway" v="trunk_link"/>
</if>
<select value="0.5" t="highway" v="motorway"/>
<select value="0.5" t="highway" v="motorway_link"/>
<select value="0.5" t="highway" v="trunk"/>
<select value="0.5" t="highway" v="trunk_link"/>
</way>
<point attribute="obstacle_time">
<select value="10" t="barrier" v="cycle_barrier"/>
<select value="15" t="barrier" v="gate"/>
<select value="20" t="barrier" v="lift_gate"/>
<select value="20" t="barrier" v="swing_gate"/>
<select value="15" t="barrier" v="log"/>
<select value="5" t="barrier"/>
<select value="15" t="highway" v="traffic_signals"/>
<select value="10" t="crossing" v="unmarked"/>
<select value="5" t="crossing" v="uncontrolled"/>
<select value="15" t="crossing" v="traffic_signals"/>
<select value="15" t="highway" v="stop"/>
<select value="7" t="highway" v="give_way"/>
<select value="200" t="ford"/>
<select value="25" t="railway" v="crossing"/>
<select value="25" t="railway" v="level_crossing"/>
</point>
<point attribute="obstacle">
<if param="avoid_borders">
<select value="-1" t="barrier" v="border_control"/>
</if>
<if param="driving_style_safety">
<select value="16" t="crossing" v="traffic_signals"/>
<select value="16" t="crossing" v="island;traffic_signals"/>
<select value="27" t="highway" v="traffic_signals"/>
</if>
<!-- Lines above: These values are only a workaround. They apply until
one issue is resolved: The triple counting of traffic lights at main
junctions. This can hopefully be resolved within map rendering.
Any combination of values that we put here (into the routing.xml)
leads to routing errors. The above is only a compromise to minimize
those errors.-->
<select value="9" t="crossing" v="traffic_signals"/>
<select value="1" t="crossing" v="uncontrolled"/>
<select value="3" t="crossing" v="unmarked"/>
<select value="1" t="crossing" v="island"/>
<!-- Lines above: These values should not get too high, because
in maps, crossing=island is often combined with either two nodes
"crossing=unmarked" or two nodes "crossing=traffic_signals".
So, often you get triple counting here as well. And the crossing
of a main road very often cannot get a penalty at all: Often,
a crossing is not marked as a crossing and this makes it impossible
to apply any penalty. So it would make no sense to just apply a high
penalty on some cases. -->
<select value="5" t="crossing" v="island;traffic_signals"/>
<select value="13" t="highway" v="traffic_signals"/>
<select value="55" t="highway" v="steps"/>
<select value="15" t="bicycle" v="dismount"/>
<select value="240" t="route" v="ferry"/>
<select value="200" t="ford" v="yes"/>
<select value="-1" t="bicycle" v="no"/>
<select value="1" t="bicycle" v="yes"/>
<select value="1" t="bicycle" v="permissive"/>
<select value="1" t="bicycle" v="designated"/>
<select value="1" t="bicycle" v="official"/>
<select value="1" t="vehicle" v="no"/>
<select value="1" t="vehicle" v="agricultural"/>
<select value="1" t="vehicle" v="forestry"/>
<select value="1" t="vehicle" v="yes"/>
<select value="1" t="vehicle" v="permissive"/>
<select value="1" t="vehicle" v="designated"/>
<select value="-1" t="access" v="no"/>
<select value="1" t="access" v="agricultural"/>
<select value="1" t="access" v="forestry"/>
<select value="1" t="access" v="yes"/>
<select value="1" t="access" v="permissive"/>
<select value="-1" t="crossing" v="no"/>
</point>
<way attribute="penalty_transition">
<if param="driving_style_balance">
<select value="1" t="highway" v="trunk"/>
<select value="2" t="highway" v="trunk_link"/>
<select value="3" t="highway" v="primary"/>
<select value="4" t="highway" v="primary_link"/>
<select value="6" t="highway" v="secondary"/>
<select value="7" t="highway" v="secondary_link"/>
<select value="20" t="highway" v="tertiary"/>
<select value="26" t="highway" v="tertiary_link"/>
<select value="50" t="highway" v="residential"/>
<select value="50" t="highway" v="living_street"/>
<select value="52" t="highway" v="service"/>
<select value="58" t="highway" v="track"/>
<select value="60" t="highway" v="footway"/>
<select value="65" t="highway" v="path"/>
<select value="70"/>
</if>
<if param="driving_style_speed">
<select value="3" t="highway" v="trunk"/>
<select value="4" t="highway" v="trunk_link"/>
<select value="7" t="highway" v="primary"/>
<select value="8" t="highway" v="primary_link"/>
<select value="10" t="highway" v="secondary"/>
<select value="12" t="highway" v="secondary_link"/>
<select value="80" t="highway" v="tertiary"/>
<select value="51" t="highway" v="tertiary_link"/>
<select value="52" t="highway" v="residential"/>
<select value="52" t="highway" v="living_street"/>
<select value="85" t="highway" v="service"/>
<select value="86" t="highway" v="track"/>
<select value="87" t="highway" v="footway"/>
<select value="87" t="highway" v="path"/>
<select value="90"/>
</if>
</way>
</routingProfile>
<routingProfile name="pedestrian" baseProfile="pedestrian" restrictionsAware="false" minDefaultSpeed="3" maxDefaultSpeed="5"
leftTurn="0" rightTurn="0" followSpeedLimitations="false" onewayAware="false">
<attribute name="heuristicCoefficient" value="1.2" />
<!-- NEW ROUTING API -->
<parameter id="avoid_ferries" name="Avoid ferries" description="Avoid ferries" type="boolean"/>
<parameter id="avoid_motorway" name="Avoid motorways" description="Avoid motorways" type="boolean"/>
<parameter id="avoid_stairs" name="Avoid stairs" description="Avoid stairs" type="boolean"/>
<parameter id="height_obstacles" name="Use elevation data" description="Use terrain elevation data provided by SRTM, ASTER and EU-DEM" type="boolean"/>
<way attribute="access">
<select value="-1" t="osmand_change" v="delete"/>
<select value="-1" t="highway" v="proposed"/>
<select value="-1" t="highway" v="construction"/>
<select value="-1" t="construction" v="yes"/>
<if param="avoid_motorway">
<select value="-1" t="highway" v="motorway"/>
<select value="-1" t="highway" v="motorway_link"/>
<select value="-1" t="highway" v="trunk"/>
<select value="-1" t="highway" v="trunk_link"/>
</if>
<select value="-1" t="highway" v="steps">
<if param="avoid_stairs"/>
</select>
<select value="-1" t="route" v="ferry">
<if param="avoid_ferries"/>
</select>
<select value="-1" t="foot" v="no"/>
<select value="1" t="foot" v="yes"/>
<select value="1" t="foot" v="permissive"/>
<select value="1" t="foot" v="designated"/>
<select value="1" t="foot" v="destination"/>
<select value="1" t="foot" v="official"/>
<select value="1" t="foot" v="use_sidepath"/>
<select value="-1" t="access" v="no"/>
<select value="-1" t="access" v="private"/>
<select value="1" t="access" v="yes"/>
<select value="1" t="access" v="permissive"/>
<select value="1" t="highway" v="motorway"/>
<select value="1" t="highway" v="motorway_link"/>
<select value="1" t="highway" v="trunk"/>
<select value="1" t="highway" v="trunk_link"/>
<select value="1" t="highway" v="primary"/>
<select value="1" t="highway" v="primary_link"/>
<select value="1" t="highway" v="secondary"/>
<select value="1" t="highway" v="secondary_link"/>
<select value="1" t="highway" v="tertiary"/>
<select value="1" t="highway" v="tertiary_link"/>
<select value="1" t="highway" v="road"/>
<select value="1" t="highway" v="residential"/>
<select value="1" t="highway" v="cycleway"/>
<select value="1" t="highway" v="unclassified"/>
<select value="1" t="highway" v="service"/>
<select value="1" t="highway" v="track"/>
<select value="1" t="highway" v="path"/>
<select value="1" t="highway" v="living_street"/>
<select value="1" t="highway" v="pedestrian"/>
<select value="1" t="highway" v="footway"/>
<select value="1" t="highway" v="platform"/>
<select value="1" t="railway" v="platform"/>
<select value="1" t="public_transport" v="platform"/>
<select value="1" t="highway" v="bridleway"/>
<select value="1" t="highway" v="steps"/>
<select value="1" t="route" v="ferry"/>
<select value="-1"/>
</way>
<way attribute="oneway">
</way>
<way attribute="speed" type="speed">
<select value="4" t="highway" v="steps"/>
<select value="5"/>
</way>
<way attribute="obstacle_srtm_alt_speed">
<if param="height_obstacles">
<gt value1="-60" value2=":incline">
<select value="35"/>
</gt>
<gt value1="-25" value2=":incline">
<select value="30"/>
</gt>
<gt value1="-17" value2=":incline">
<select value="17"/>
</gt>
<gt value1="-9" value2=":incline">
<select value="5"/>
</gt>
<gt value1="-3" value2=":incline">
<select value="1"/>
</gt>
<gt value1="3" value2=":incline">
<select value="1"/>
</gt>
<gt value1="7" value2=":incline">
<select value="4"/>
</gt>
<gt value1="13" value2=":incline">
<select value="8"/>
</gt>
<gt value1="25" value2=":incline">
<select value="10"/>
</gt>
<select value="15"/>
</if>
</way>
<way attribute="priority">
<!-- Additional tags -->
<select value="0.05" t="foot" v="private"/>
<select value="0.05" t="foot" v="destination"/>
<!-- Q? access=destination should not be used foot or what is the proposed scheme
http://www.openstreetmap.org/way/173188624#map=18/39.56805/2.64846
should be
<select value="0.05" t="access" v="private"/>
<select value="0.05" t="access" v="destination"/> -->
<select value="1.2" t="sidewalk" v="yes"/>
<select value="0.9" t="sidewalk" v="no"/>
<select value="0.1" t="foot" v="use_sidepath"/>
<!-- object tags -->
<select value="0.7" t="highway" v="motorway"/>
<select value="0.7" t="highway" v="motorway_link"/>
<select value="0.7" t="highway" v="trunk"/>
<select value="0.7" t="highway" v="trunk_link"/>
<select value="0.8" t="highway" v="bridleway"/>
<select value="0.9" t="highway" v="service"/>
<select value="0.9" t="highway" v="primary"/>
<select value="0.9" t="highway" v="primary_link"/>
<select value="0.9" t="highway" v="secondary"/>
<select value="1" t="route" v="ferry"/>
<select value="1.2" t="highway" v="steps"/>
<select value="1.2" t="highway" v="living_street"/>
<select value="1.2" t="highway" v="pedestrian"/>
<select value="1.2" t="highway" v="footway"/>
<select value="1"/>
</way>
<point attribute="obstacle_time">
<select value="5" t="highway" v="traffic_signals"/>
<select value="10" t="crossing" v="unmarked"/>
<select value="5" t="crossing" v="uncontrolled"/>
<select value="30" t="crossing" v="traffic_signals"/>
<select value="5" t="highway" v="crossing"/>
<select value="5" t="ford" />
<select value="5" t="railway" v="crossing" />
<select value="5" t="railway" v="level_crossing"/>
</point>
<point attribute="obstacle">
<select value="-1" t="foot" v="no"/>
<select value="-1" t="foot" v="private"/>
<select value="120" t="foot" v="destination"/>
<select value="0" t="foot" v="yes"/>
<select value="0" t="foot" v="permissive"/>
<select value="0" t="foot" v="designated"/>
<select value="0" t="foot" v="official"/>
<select value="-1" t="access" v="no"/>
<select value="-1" t="access" v="private"/>
<select value="120" t="access" v="destination"/>
<select value="0" t="access" v="yes"/>
<select value="0" t="access" v="permissive"/>
</point>
</routingProfile>
<routingProfile name="geocoding" baseProfile="car" restrictionsAware="true" minDefaultSpeed="10.0" maxDefaultSpeed="10.0">
<way attribute="access">
<select value="1" t="highway" v="motorway"/>
<select value="1" t="highway" v="motorway_link"/>
<select value="1" t="highway" v="trunk"/>
<select value="1" t="highway" v="trunk_link"/>
<select value="1" t="highway" v="primary"/>
<select value="1" t="highway" v="primary_link"/>
<select value="1" t="highway" v="secondary"/>
<select value="1" t="highway" v="secondary_link"/>
<select value="1" t="highway" v="tertiary"/>
<select value="1" t="highway" v="tertiary_link"/>
<select value="1" t="highway" v="unclassified"/>
<select value="1" t="highway" v="road"/>
<select value="1" t="highway" v="residential"/>
<select value="1" t="highway" v="track"/>
<select value="1" t="highway" v="service"/>
<select value="1" t="highway" v="living_street"/>
<select value="1" t="highway" v="pedestrian"/>
<select value="1" t="route" v="ferry"/>
<select value="1" t="route" v="shuttle_train"/>
<select value="-1"/>
</way>
</routingProfile>
<routingProfile name="boat" restrictionsAware="true" minDefaultSpeed="5.0" maxDefaultSpeed="20.0" onewayAware="true">
<way attribute="access">
<select value="-1" t="osmand_change" v="delete"/>
<select value="-1" t="access" v="no"/>
<select value="-1" t="boat" v="no"/>
<select value="1" t="access" v="yes"/>
<select value="-1" t="access" v="private"/>
<select value="-1" t="waterway" v="dam"/>
<select value="-1" t="waterway" v="weir"/>
<select value="-1" t="waterway" v="waterfall"/>
<select value="1" t="access" v="permissive"/>
<select value="1" t="access" v="destination"/>
<select value="1" t="waterway" v="river"/>
<select value="1" t="waterway" v="canal"/>
<select value="1" t="waterway" v="fairway"/>
<!-- disable polygon routing to avoid intersection with waterway=fairway -->
<!-- <select value="1" t="seamark:type" v="fairway"/> -->
<select value="-1"/>
</way>
<way attribute="area">
<select value="1" t="seamark:type" v="fairway"/>
<select value="0"/>
</way>
<way attribute="oneway">
<select value="1" t="oneway" v="yes"/>
<select value="1" t="oneway" v="1"/>
<select value="-1" t="oneway" v="-1"/>
</way>
<way attribute="speed" type="speed">
<select value="10" t="waterway" v="river"/>
<select value="10" t="waterway" v="canal"/>
</way>
<way attribute="priority">
<select value="2" t="waterway" v="fairway"/>
<select value="1" t="waterway" v="river"/>
<select value="1" t="waterway" v="canal"/>
<select value="0.7"/>
</way>
<point attribute="obstacle">
<select value="-1" t="access" v="no"/>
<select value="-1" t="access" v="private"/>
<select value="0" t="access" v="yes"/>
<select value="0" t="access" v="permissive"/>
<select value="0" t="access" v="customers"/>
</point>
</routingProfile>
<routingProfile name="public_transport" >
<!-- maximum distance to walk to find start / end public transport stop -->
<attribute name="walkRadius" value = "1500" />
<!-- maximum distance to walk to find transport stop to change transport -->
<attribute name="walkChangeRadius" value = "300" />
<attribute name="maxNumberOfChanges" value = "5" />
<!-- find alternatives routes with N seconds delay to the fastest route -->
<attribute name="delayForAlternativesRoutes" value = "1200" />
<attribute name="defaultWalkSpeed" value = "2" />
<attribute name="defaultTravelSpeed" value = "10" />
<attribute name="defaultStopTime" value = "30" />
<attribute name="defaultChangeTime" value = "300" />
<!--
<point attribute="obstacle">
<select value="-1" t="access" v="no"/>
<select value="-1" t="access" v="private"/>
<select value="0" t="access" v="yes"/>
<select value="0" t="access" v="permissive"/>
<select value="0" t="access" v="customers"/>
</point>
<way attribute="priority">
<select value="2" t="waterway" v="fairway"/>
<select value="1" t="waterway" v="river"/>
<select value="1" t="waterway" v="canal"/>
<select value="0.7"/>
</way>
-->
</routingProfile>
</osmand_routing_config>