-
Notifications
You must be signed in to change notification settings - Fork 5
/
routing.xml
1732 lines (1466 loc) · 73.1 KB
/
routing.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?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). (Note: actually it doesn't matter which symbol is used. ':height' and '$height' will both call the same parameter. But for clarity, stick to this idiom).
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="10" 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" valueDescriptions="-,1.5m,2m,2.5m,3m,3.5m,4m"/>
<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"/>
</if>
<if param="avoid_ice_roads_fords">
<select value="-1" t="ice_road" v="yes" />
</if>
<if param="avoid_ice_roads_fords">
<select value="-1" t="winter_road" v="yes" />
</if>
<if param="avoid_ice_roads_fords">
<select value="-1" t="ford" v="yes"/>
</if>
<if param="avoid_toll">
<select value="-1" t="toll" v="yes"/>
</if>
<if param="avoid_ferries">
<select value="-1" t="route" v="ferry"/>
</if>
<if param="avoid_shuttle_train">
<select value="-1" t="route" v="shuttle_train"/>
</if>
<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"/>
<gt value1=":weight" value2="$maxweight" type="weight">
<select value="-1" t="maxweight" />
</gt>
<gt value1=":height" value2="$maxheight" type="length">
<select value="-1" t="maxheight"/>
</gt>
<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="75" t="highway" v="trunk_link"/>
<!-- generally linking larger towns -->
<select value="65" t="highway" v="primary"/>
<select value="50" t="highway" v="primary_link"/>
<!-- generally linking smaller towns and villages -->
<select value="60" t="highway" v="secondary"/>
<select value="50" t="highway" v="secondary_link"/>
<!-- important urban roads -->
<select value="45" t="highway" v="tertiary"/>
<select value="40" 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" t="highway" v="motorway_link"/>
<select value="1" t="highway" v="trunk"/>
<select value="0.9" 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.8" 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="5" t="barrier" v="height_restrictor"/>
<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. -->
<gt value1=":height" value2="$maxheight" type="length">
<select value="-1" t="maxheight" />
</gt>
<!-- 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="height_restrictor"/>
<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="height_restrictor"/>
<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>
<if param="avoid_ferries">
<select value="-1" t="route" v="ferry" />
</if>
<if param="avoid_stairs">
<select value="-1" t="highway" v="steps"/>
</if>
<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"/>