Tweaking of OsmAnd for the navigation with mobile homes, trucks and other large vehicles

Last change on 2019-11-23

Abstract:

As of Version 3.5 OsmAnd supports the OpenStreetmap tags maxwidth and width of streets. Together with the maxheight and maxweight the routing algorithm of OsmAnd can be tweaked by means of the routing.xml file to offer routes optimized for large vehicles. This is done by adding access rights (maxheight, maxweight and maxwidth) and penalties for narrow streets.

Download my routing.xml
Last modified: 2019-11-23

 

Step 1: Copy the routing.xml to the /routing/ directory of osmand

External memory setting, access via computer
sdcard/Android/data/net.osmand.plus/files/routing/    

external memory setting, access via device itself
/storage/emulated/0/Android/data/net.osmand.plus/files/routing/

Step 2: Restart OsmAnd

…by swiping it away in the recent app view to activate the new routing.xml or kill it in the apps dialog of the device settings.

Step 3: Create a profile linked to the car section of the routing.xml file

Settings, Manage App-Profiles…

  

Choose “navigationsartcar routing.xml

    

 

And set it up according to your vehicle data and personal wish…

    

 

Changes to the original routing.xml file

 

Make parameters available:

<!--for large vehicles Section Parameter start-->

  <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.09,3.19,3.29,3.39,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.1m,3.2m,3.3m,3.4m,3.5m,4m,4.5m,5m,5.5m,6m,6.5m,7m,7.5m"/>

  <parameter id="width_max" name="WidthMax" description="Maximum vehicle width to be permitted on the route" type="numeric" values="0,1.49,1.99,2.09,2.19,2.29,2.39,2.49,2.59,2.69,2.99" valueDescriptions="-,1.5m,2m,2.1m,2.2m,2.3m,2.4m,2.5m,2.6m,2.7m,3m"/>

  <parameter id="width_street_min" name="WidthStreetMin" description="Minimum width of street to pass. This should be greater or equal to the vehicle width." type="numeric" values="0,1.49,1.99,2.29,2.49,4,59,4.99,5.99,10" valueDescriptions="-,1.5m,2m,2.3m,2.5m,4.5m,5m,6m,10m"/>

  <parameter id="width_street_avoid" name="WidthStreetAvoid" description="Width of street to avoid. In two-way streets one lane is half the width of the street." type="numeric" values="0,1.49,1.99,2.29,2.49,4,59,4.99,5.99,10" valueDescriptions="-,1.5m,2m,2.3m,2.5m,4.5m,5m,6m,10m"/>

<!--for large vehicles Section Parameter end-->

 

 

Disallow streets where the maximum allowed width is exceeded or the street is narrower than the minimum requested:

<way attribute="access">

 

...

 

<!--for large vehicles Access Section start-->

    <select value="-1" t="maxwidth">

       <gt value1=":width_max" value2="$maxwidth" type="length"/>

    </select>

    <select value="-1" t="width">

       <gt value1=":width_street_min" value2="$width" type="length"/>

    </select>

<!--for large vehicles Access Section end-->

 

...

 

Deprioritize narrow streets with a lower speed:

<way attribute="speed" type="speed">

 

...

 

<!--for large vehicles Penalty=lower speed section start-->

    <select value="15" t="highway" v="unclassified">

       <gt value1=":width_street_avoid" value2="$width"/>

    </select>

<!--for large vehicles Penalty=lower speed section end-->

 

...

 

Deprioritize narrow streets with a lower priority, this tag must be at the beginning of the section to work properly:

<way attribute="priority">

 

<!--for large vehicles Penalty section start-->

    <gt value1=:width_street_min value2="$width">

       <select value="0.1"/>

    </gt>

    <gt value1=:width_street_avoid value2="$width">

       <select value="0.1"/>

    </gt>

<!--for large vehicles Penalty section end-->

 

 

Version history:

2019-11-23:        1st version