added profiles and readmes

This commit is contained in:
Arndt Brenschede 2014-01-19 13:33:43 +01:00
parent 5453c7b2f8
commit 2edac085d0
10 changed files with 1542 additions and 0 deletions

108
misc/profiles2/car-test.brf Normal file
View file

@ -0,0 +1,108 @@
#
# Car-Routing is experimantal !!!
#
# DO NOT USE FOR ACTUAL NAVIGATION
#
# Turn restrictions are missing, leading to wrong routes
#
---context:global
assign downhillcost 0
assign downhillcutoff 0
assign uphillcost 0
assign uphillcutoff 0
assign validForCars 1
assign pass1coefficient 1.3
---context:way # following code refers to way-tags
assign turncost 200
assign initialcost switch highway=ferry 20000 0
#
# calculate logical car access
#
assign caraccess
switch motorcar=
switch motor_vehicle=
switch vehicle=
switch access=
switch or highway=motorway highway=motorway_link 1
switch or highway=trunk highway=trunk_link 1
switch or highway=primary highway=primary_link 1
switch or highway=secondary highway=secondary_link 1
switch or highway=tertiary highway=tertiary_link 1
switch highway=unclassified 1
switch highway=ferry 1
switch or highway=residential highway=living_street 1
switch highway=service 1
0
or access=yes or access=designated access=destination
or vehicle=yes or vehicle=designated vehicle=destination
or motor_vehicle=yes or motor_vehicle=designated motor_vehicle=destination
or motorcar=yes or motorcar=designated motorcar=destination
assign accesspenalty
switch caraccess
0
10000
assign onewaypenalty
switch switch reversedirection=yes
switch oneway=
junction=roundabout
or oneway=yes or oneway=true oneway=1
oneway=-1
10000
0.0
assign ispaved or surface=paved or surface=asphalt or surface=concrete surface=paving_stones
assign costfactor
add max onewaypenalty accesspenalty
switch or highway=motorway highway=motorway_link 1
switch or highway=trunk highway=trunk_link 1
switch or highway=primary highway=primary_link switch maxspeed=30 2.0 switch maxspeed=50 1.5 1.2
switch or highway=secondary highway=secondary_link 1.3
switch or highway=tertiary highway=tertiary_link 1.4
switch highway=unclassified 1.5
switch highway=ferry 5.67
switch highway=bridleway 5
switch or highway=residential highway=living_street 2
switch highway=service 2
switch or highway=track or highway=road highway=path
switch tracktype=grade1 5
switch ispaved 5
30
10000
---context:node # following code refers to node tags
#
# calculate logical car access to nodes
#
assign caraccess
switch motorcar=
switch motor_vehicle=
switch vehicle=
switch access=
switch barrier=gate 0
switch barrier=bollard 0
switch barrier=lift_gate 0
switch barrier=cycle_barrier 0
1
or access=yes or access=designated access=destination
or vehicle=yes or vehicle=designated vehicle=destination
or motor_vehicle=yes or motor_vehicle=designated motor_vehicle=destination
or motorcar=yes or motorcar=designated motorcar=destination
assign initialcost
switch caraccess
0
1000000

167
misc/profiles2/fastbike.brf Normal file
View file

@ -0,0 +1,167 @@
#
# A fastbike could be a racing bike or a speed pedelec.
# But also at night or in rainy whether you might want
# to fallback to this one.
#
# Structure is similar to trekking.brf, see this for documenation.
#
---context:global # following code refers to global config
# Use the following switches to change behaviour
# (1=yes, 0=no):
assign consider_elevation 1 # set to 0 to ignore elevation in routing
assign allow_steps 1 # set to 0 to disallow steps
assign allow_ferries 1 # set to 0 to disallow ferries
assign ignore_cycleroutes 0 # set to 1 for better elevation results
assign stick_to_cycleroutes 0 # set to 1 to just follow cycleroutes
assign avoid_unsafe 0 # set to 1 to avoid standard highways
assign validForBikes 1
# the elevation parameters
assign downhillcost switch consider_elevation 60 0
assign downhillcutoff 1.5
assign uphillcost 0
assign uphillcutoff 1.5
---context:way # following code refers to way-tags
assign ispaved or surface=paved or surface=asphalt or surface=concrete surface=paving_stones
assign isunpaved not or surface= or ispaved or surface=fine_gravel surface=cobblestone
assign turncost 90
assign initialcost switch highway=ferry 10000 0
#
# implicit access here just from the motorroad tag
# (implicit access rules from highway tag handled elsewhere)
#
assign defaultaccess
switch access=
not motorroad=yes
switch or access=private access=no
0
1
#
# calculate logical bike access
#
assign bikeaccess
or longdistancecycleway=yes
switch bicycle=
switch vehicle=
defaultaccess
switch or vehicle=private vehicle=no
0
1
not or bicycle=private or bicycle=no bicycle=dismount
#
# calculate logical foot access
#
assign footaccess
or bikeaccess
or bicycle=dismount
switch foot=
defaultaccess
not or foot=private foot=no
#
# if not bike-, but foot-acess, just a moderate penalty,
# otherwise access is forbidden
#
assign accesspenalty
switch bikeaccess
0
switch footaccess
6
100000
#
# handle one-ways. On primary roads, wrong-oneways should
# be close to forbidden, while on other ways we just add
# 4 to the costfactor (making it at least 5 - you are allowed
# to push your bike)
#
assign oneway
switch oneway=
junction=roundabout
or oneway=yes or oneway=true oneway=1
assign onewaypenalty
switch switch reversedirection=yes oneway oneway=-1
switch or cycleway=opposite or cycleway=opposite_lane cycleway=opposite_track 0
switch or highway=primary highway=primary_link 50
switch or highway=secondary highway=secondary_link 30
switch or highway=tertiary highway=tertiary_link 20
6.0
0.0
assign costfactor
add max onewaypenalty accesspenalty
switch or highway=motorway highway=motorway_link 100000
switch highway=proposed 100000
switch or highway=trunk highway=trunk_link 10
switch or highway=primary highway=primary_link 1.2
switch or highway=secondary highway=secondary_link 1.1
switch or highway=tertiary highway=tertiary_link 1.0
switch highway=unclassified 1.1
switch highway=pedestrian 10
switch highway=steps 1000
switch highway=ferry 5.67
switch highway=bridleway 5
switch highway=cycleway 1.3
switch or highway=residential highway=living_street switch isunpaved 10 1.2
switch highway=service switch isunpaved 10 1.2
switch or highway=track or highway=road or highway=path highway=footway
switch tracktype=grade1 switch isunpaved 3 1.2
switch tracktype=grade2 switch isunpaved 10 3
switch tracktype=grade3 10.0
switch tracktype=grade4 20.0
switch tracktype=grade5 30.0
switch bicycle=designated 2.0
switch ispaved 2.0 100.0
10.0
---context:node # following code refers to node tags
assign defaultaccess
switch access=
1 # add default barrier restrictions here!
switch or access=private access=no
0
1
assign bikeaccess
or or longdistancecycleway=yes lcn=yes
switch bicycle=
switch vehicle=
defaultaccess
switch or vehicle=private vehicle=no
0
1
switch or bicycle=private or bicycle=no bicycle=dismount
0
1
assign footaccess
or bicycle=dismount
switch foot=
defaultaccess
switch or foot=private foot=no
0
1
assign initialcost
switch bikeaccess
0
switch footaccess
300
1000000

317
misc/profiles2/lookups.dat Normal file
View file

@ -0,0 +1,317 @@
---lookupversion:2
---context:way
highway;0001731794 track
highway;0001457935 residential
highway;0000968516 service
highway;0000756237 footway
highway;0000521566 path
highway;0000261772 unclassified
highway;0000220315 secondary
highway;0000207585 tertiary
highway;0000103445 steps
highway;0000102114 primary
highway;0000094484 cycleway
highway;0000090388 living_street
highway;0000035041 motorway
highway;0000029965 pedestrian
highway;0000026875 motorway_link
highway;0000015054 trunk
highway;0000014604 primary_link
highway;0000012211 road
highway;0000011822 trunk_link
highway;0000005882 construction
highway;0000005425 bridleway
highway;0000005180 secondary_link
highway;0000003360 platform
highway;0000002616 proposed abandoned
highway;0000001374 tertiary_link
highway;0000000760 ferry
highway;0000000541 raceway
highway;0000000346 rest_area
highway;0000000300 bus_stop
highway;0000000184 services
tracktype;0000356503 grade2
tracktype;0000353482 grade3
tracktype;0000281625 grade1
tracktype;0000245193 grade4
tracktype;0000179135 grade5
surface;0000363915 asphalt
surface;0000303589 paved
surface;0000196783 gravel
surface;0000137371 ground
surface;0000128215 grass
surface;0000092748 unpaved
surface;0000086579 paving_stones
surface;0000066111 cobblestone
surface;0000042061 dirt
surface;0000026551 concrete
surface;0000025631 compacted
surface;0000019861 sand
surface;0000009400 pebblestone
surface;0000003197 fine_gravel
maxspeed;0000402224 30
maxspeed;0000224685 50
maxspeed;0000045177 100
maxspeed;0000037529 70
maxspeed;0000014237 none
maxspeed;0000014022 60
maxspeed;0000011530 80
maxspeed;0000009951 10
maxspeed;0000008056 20
maxspeed;0000005772 120
maxspeed;0000003165 40
maxspeed;0000002987 7
maxspeed;0000002826 signals
maxspeed;0000001933 130
service;0000221481 parking_aisle
service;0000157110 driveway
lit;0000132495 yes
lanes;0000098207 2
lanes;0000042192 1
lanes;0000018533 3
lanes;0000004577 4
lanes;0000000448 5
lanes;0000000318 1.5
access;0000044859 yes permissive
access;0000008452 designated official
access;0000028727 destination customers
access;0000076985 agricultural forestry
access;0000116270 private
access;0000028044 no
foot;0000339384 yes allowed Yes
foot;0000125339 designated official
foot;0000018945 no
foot;0000001562 private
foot;0000000279 destination
foot;0000008172 permissive
bicycle;0000302789 yes allowed permissive
bicycle;0000108056 designated official
bicycle;0000000265 destination
bicycle;0000003593 dismount
bicycle;0000001426 private
bicycle;0000070179 no
motorcar;0000010111 yes permissive
motorcar;0000001537 designated official
motorcar;0000007102 destination
motorcar;0000016706 agricultural forestry agriculture
motorcar;0000002178 private
motorcar;0000077771 no
motor_vehicle;0000013813 yes permissive
motor_vehicle;0000002098 designated official
motor_vehicle;0000009792 destination
motor_vehicle;0000019301 agricultural forestry
motor_vehicle;0000006563 private
motor_vehicle;0000025491 no
motorcycle;0000005750 yes permissive
motorcycle;0000001158 designated official
motorcycle;0000005805 destination
motorcycle;0000012401 agricultural forestry
motorcycle;0000001180 private
motorcycle;0000053955 no
vehicle;0000000505 yes permissive
vehicle;0000000027 designated
vehicle;0000007582 destination
vehicle;0000004357 agricultural forestry
vehicle;0000001155 private
vehicle;0000006487 no
cycleway;0000033575 track
cycleway;0000012829 no
cycleway;0000011604 lane
cycleway;0000008938 opposite
cycleway;0000001503 none
cycleway;0000001146 right
cycleway;0000001031 opposite_track
cycleway;0000001029 yes
cycleway;0000000856 opposite_lane
cycleway;0000000675 both
cycleway;0000000665 left
cycleway;0000000521 shared
cycleway;0000000383 street
cycleway;0000000176 segregated
mtb:scale;0000043968 0
mtb:scale;0000019705 1
mtb:scale;0000006436 2
mtb:scale;0000002702 3
mtb:scale;0000001083 4
mtb:scale;0000000329 5
sac_scale;0000049626 hiking
sac_scale;0000007933 mountain_hiking
sac_scale;0000001160 demanding_mountain_hiking
sac_scale;0000000523 yes
sac_scale;0000000364 alpine_hiking
sac_scale;0000000117 demanding_alpine_hiking
noexit;0000058492 yes
motorroad;0000019250 yes
oneway;0000330245 yes
oneway;0000075148 no
oneway;0000003679 -1
oneway;0000000001 true
oneway;0000000001 1
junction;0000015929 roundabout
bridge;0000182649 yes viaduct true suspension
tunnel;0000031626 yes
lcn;0000018999 yes
longdistancecycleway;0000000001 yes
reversedirection;0000000001 yes
---context:node
highway;0000100947 turning_circle
highway;0000067645 traffic_signals
highway;0000047209 crossing
highway;0000037164 bus_stop
highway;0000006577 motorway_junction
highway;0000003811 stop
highway;0000002331 mini_roundabout
highway;0000001789 milestone
highway;0000001692 passing_place
highway;0000001289 give_way
highway;0000001092 emergency_access_point
highway;0000000683 speed_camera
highway;0000000672 steps
highway;0000000658 incline_steep
highway;0000000620 elevator
highway;0000000506 street_lamp
highway;0000000490 ford
highway;0000000458 incline
highway;0000000135 rest_area
highway;0000000105 path
highway;0000000098 emergency_bay
highway;0000000096 road
highway;0000000087 platform
highway;0000000074 services
highway;0000000058 track
highway;0000000055 service
highway;0000000054 footway
highway;0000000053 traffic_calming
highway;0000000046 toll_bridge
highway;0000000037 city_entry
barrier;0000076979 gate
barrier;0000069308 bollard
barrier;0000028131 lift_gate
barrier;0000017332 cycle_barrier
barrier;0000005693 entrance
barrier;0000002885 block
barrier;0000001065 kissing_gate
barrier;0000000828 cattle_grid
barrier;0000000602 stile
barrier;0000000561 turnstile
barrier;0000000512 no
barrier;0000000463 fence
barrier;0000000417 bump_gate
barrier;0000000324 sally_port
barrier;0000000283 yes
barrier;0000000283 hampshire_gate
barrier;0000000236 swing_gate
barrier;0000000203 chain
barrier;0000000181 toll_booth
barrier;0000000180 door
barrier;0000000104 chicane
barrier;0000000096 tree
barrier;0000000087 border_control
barrier;0000000077 log
barrier;0000000076 traffic_crossing_pole
barrier;0000000063 wall
barrier;0000000060 fallen_tree
barrier;0000000052 stone
barrier;0000000048 ditch
barrier;0000000031 spikes
access;0000001309 yes permissive
access;0000000118 designated official
access;0000000405 destination customers
access;0000000276 agricultural forestry
access;0000008574 private
access;0000002145 no
foot;0000080681 yes permissive
foot;0000000326 designated official
foot;0000000023 destination
foot;0000000156 private
foot;0000009170 no
bicycle;0000076717 yes permissive
bicycle;0000000406 designated official
bicycle;0000000018 destination
bicycle;0000000081 dismount
bicycle;0000000051 private
bicycle;0000016121 no
motorcar;0000005785 yes permissive
motorcar;0000000026 designated official
motorcar;0000000080 destination
motorcar;0000000112 agricultural forestry
motorcar;0000000171 private
motorcar;0000001817 no
motor_vehicle;0000000066 yes permissive
motor_vehicle;0000000000 designated official
motor_vehicle;0000000030 destination
motor_vehicle;0000000073 agricultural forestry
motor_vehicle;0000000136 private
motor_vehicle;0000000469 no
motorcycle;0000004515 yes permissive
motorcycle;0000000007 designated official
motorcycle;0000000054 destination
motorcycle;0000000027 agricultural forestry
motorcycle;0000000063 private
motorcycle;0000001637 no
vehicle;0000000058 yes permissive
vehicle;0000000000 designated
vehicle;0000000081 destination
vehicle;0000000038 agricultural forestry
vehicle;0000000041 private
vehicle;0000000271 no
crossing;0000032485 traffic_signals
crossing;0000014300 uncontrolled
crossing;0000005086 island
crossing;0000001565 unmarked
crossing;0000001066 no
crossing;0000000333 zebra
railway;0000034039 level_crossing
railway;0000010175 crossing
noexit;0000043010 yes
entrance;0000015094 yes
entrance;0000007079 main
entrance;0000000554 service
entrance;0000000169 emergency
entrance;0000000063 exit
entrance;0000000008 private
lcn;0000018999 yes
longdistancecycleway;0000000001 yes

122
misc/profiles2/moped.brf Normal file
View file

@ -0,0 +1,122 @@
#
# Moped-Routing is experimantal !!!
#
# DO NOT USE FOR ACTUAL NAVIGATION
#
# Turn restrictions are missing, leading to wrong routes
#
---context:global
assign downhillcost 0
assign downhillcutoff 0
assign uphillcost 0
assign uphillcutoff 0
assign validForBikes 1
assign validForCars 1
---context:way # following code refers to way-tags
assign turncost 90
assign initialcost switch highway=ferry 20000 0
#
# calculate logical car access
#
assign motorverhicleaccess
switch motor_vehicle=
switch vehicle=
switch access=
switch or highway=trunk highway=trunk_link 1
switch or highway=primary highway=primary_link 1
switch or highway=secondary highway=secondary_link 1
switch or highway=tertiary highway=tertiary_link 1
switch highway=unclassified 1
switch highway=ferry 1
switch or highway=residential highway=living_street 1
switch highway=service 1
0
or access=yes or access=designated access=destination
or vehicle=yes or vehicle=designated vehicle=destination
or motor_vehicle=yes or motor_vehicle=designated motor_vehicle=destination
assign caraccess
switch motorcar=
motorverhicleaccess
or motorcar=yes or motorcar=designated motorcar=destination
assign motorcycleaccess
switch motorcycle=
motorverhicleaccess
or motorcycle=yes or motorcycle=designated motorcycle=destination
assign accesspenalty
switch or caraccess motorcycleaccess
switch motorroad=yes 10000 0
10000
assign onewaypenalty
switch switch reversedirection=yes
switch oneway=
junction=roundabout
or oneway=yes or oneway=true oneway=1
oneway=-1
10000
0.0
assign ispaved or surface=paved or surface=asphalt or surface=concrete surface=paving_stones
assign costfactor
add max onewaypenalty accesspenalty
switch or highway=trunk highway=trunk_link 1.5
switch or highway=primary highway=primary_link switch maxspeed=30 2.0 switch maxspeed=50 1.5 1.2
switch or highway=secondary highway=secondary_link 1.4
switch or highway=tertiary highway=tertiary_link 1.3
switch highway=unclassified 1.2
switch highway=ferry 5.67
switch highway=bridleway 5
switch or highway=residential highway=living_street 2
switch highway=service 2
switch or highway=track or highway=road highway=path
switch tracktype=grade1 5
switch ispaved 5
30
10000
---context:node # following code refers to node tags
#
# calculate logical car access to nodes
#
assign motorvehicleaccess
switch motor_vehicle=
switch vehicle=
switch access=
switch barrier=gate 0
switch barrier=bollard 0
switch barrier=lift_gate 0
switch barrier=cycle_barrier 0
1
or access=yes or access=designated access=destination
or vehicle=yes or vehicle=designated vehicle=destination
or motor_vehicle=yes or motor_vehicle=designated motor_vehicle=destination
assign caraccess
switch motorcar=
motorvehicleaccess
or motorcar=yes or motorcar=designated motorcar=destination
assign motorcycleaccess
switch motorcycle=
motorvehicleaccess
or motorcycle=yes or motorcycle=designated motorcycle=destination
assign initialcost
switch or caraccess motorcycleaccess
0
1000000

View file

@ -0,0 +1,91 @@
---context:global # following code refers to global config
# the elevation parameters
assign downhillcost 0
assign downhillcutoff 1.5
assign uphillcost 0
assign uphillcutoff 1.5
assign validForFoot 1
---context:way # following code refers to way-tags
assign turncost 0
assign initialcost switch highway=ferry 10000 0
#
# implicit access here just from the motorroad tag
# (implicit access rules from highway tag handled elsewhere)
#
assign defaultaccess
switch access=
not motorroad=yes
switch or access=private access=no
0
1
#
# calculate logical bike access
#
assign bikeaccess
or longdistancecycleway=yes
switch bicycle=
switch vehicle=
defaultaccess
switch or vehicle=private vehicle=no
0
1
not or bicycle=private or bicycle=no bicycle=dismount
#
# calculate logical foot access
#
assign footaccess
or bikeaccess
or bicycle=dismount
switch foot=
defaultaccess
not or foot=private foot=no
assign accesspenalty switch or bikeaccess footaccess 0 100000
assign costfactor
add accesspenalty
switch highway=ferry 5.67
switch or highway=motorway highway=motorway_link 100000
switch highway=proposed 100000
1
---context:node # following code refers to node tags
assign defaultaccess
switch access=
1 # add default barrier restrictions here!
switch or access=private access=no
0
1
assign bikeaccess
or or longdistancecycleway=yes lcn=yes
switch bicycle=
switch vehicle=
defaultaccess
switch or vehicle=private vehicle=no
0
1
switch or bicycle=private or bicycle=no bicycle=dismount
0
1
assign footaccess
or bicycle=dismount
switch foot=
defaultaccess
switch or foot=private foot=no
0
1
assign initialcost switch or bikeaccess footaccess 0 1000000

225
misc/profiles2/trekking.brf Normal file
View file

@ -0,0 +1,225 @@
# *** The trekking profile is for slow travel
# *** and avoiding car traffic, but still with
# *** a focus on approaching your destination
# *** efficiently.
---context:global # following code refers to global config
# Use the following switches to change behaviour
# (1=yes, 0=no):
assign consider_elevation 1 # set to 0 to ignore elevation in routing
assign allow_steps 1 # set to 0 to disallow steps
assign allow_ferries 1 # set to 0 to disallow ferries
assign ignore_cycleroutes 0 # set to 1 for better elevation results
assign stick_to_cycleroutes 0 # set to 1 to just follow cycleroutes
assign avoid_unsafe 0 # set to 1 to avoid standard highways
assign validForBikes 1
# the elevation parameters
assign downhillcost switch consider_elevation 60 0
assign downhillcutoff 1.5
assign uphillcost 0
assign uphillcutoff 1.5
---context:way # following code refers to way-tags
#
# pre-calculate some logical expressions
#
assign is_ldcr and longdistancecycleway=yes not ignore_cycleroutes
assign isbike or bicycle=yes or bicycle=designated lcn=yes
assign ispaved or surface=paved or surface=asphalt or surface=concrete surface=paving_stones
assign isunpaved not or surface= or ispaved or surface=fine_gravel surface=cobblestone
assign probablyGood or ispaved and isbike not isunpaved
#
# this is the cost (in Meter) for a 90-degree turn
# The actual cost is calculated as turncost*cos(angle)
# (Suppressing turncost while following longdistance-cycleways
# makes them a little bit more magnetic)
#
assign turncost switch is_ldcr 0 90
#
# calculate the initial cost
# this is added to the total cost each time the costfactor
# changed
#
assign initialcost switch highway=ferry 10000 0
#
# implicit access here just from the motorroad tag
# (implicit access rules from highway tag handled elsewhere)
#
assign defaultaccess
switch access=
not motorroad=yes
switch or access=private access=no
0
1
#
# calculate logical bike access
#
assign bikeaccess
or longdistancecycleway=yes
switch bicycle=
switch vehicle=
defaultaccess
switch or vehicle=private vehicle=no
0
1
not or bicycle=private or bicycle=no bicycle=dismount
#
# calculate logical foot access
#
assign footaccess
or bikeaccess
or bicycle=dismount
switch foot=
defaultaccess
not or foot=private foot=no
#
# if not bike-, but foot-acess, just a moderate penalty,
# otherwise access is forbidden
#
assign accesspenalty
switch bikeaccess
0
switch footaccess
4
100000
#
# handle one-ways. On primary roads, wrong-oneways should
# be close to forbidden, while on other ways we just add
# 4 to the costfactor (making it at least 5 - you are allowed
# to push your bike)
#
assign oneway
switch oneway=
junction=roundabout
or oneway=yes or oneway=true oneway=1
assign onewaypenalty
switch switch reversedirection=yes oneway oneway=-1
switch or cycleway=opposite or cycleway=opposite_lane cycleway=opposite_track 0
switch or highway=primary highway=primary_link 50
switch or highway=secondary highway=secondary_link 30
switch or highway=tertiary highway=tertiary_link 20
4.0
0.0
#
# calculate the cost-factor, which is the factor
# by which the distance of a way-segment is multiplied
# to calculate the cost of that segment. The costfactor
# must be >=1 and it's supposed to be close to 1 for
# the type of way the routing profile is searching for
#
assign costfactor
add max onewaypenalty accesspenalty
#
# steps and ferries are special. Note this is handled
# before the longdistancecycleway-switch, to be able
# to really exlude them be setting cost to infinity
#
switch highway=steps switch allow_steps 40 100000
switch highway=ferry switch allow_ferries 5.67 100000
#
# handle long-distance cycle-routes.
#
switch is_ldcr 1 # always treated as perfect (=1)
add switch stick_to_cycleroutes 0.5 0.05 # everything else somewhat up
#
# some other highway types
#
switch highway=pedestrian 3
switch highway=bridleway 5
switch highway=cycleway 1
switch or highway=residential highway=living_street switch isunpaved 1.5 1.1
switch highway=service switch isunpaved 1.6 1.3
#
# tracks and track-like ways are rated mainly be tracktype/grade
# But note that if no tracktype is given (mainly for road/path/footway)
# it can be o.k. if there's any other hint for quality
#
switch or highway=track or highway=road or highway=path highway=footway
switch tracktype=grade1 switch probablyGood 1.0 1.3
switch tracktype=grade2 switch probablyGood 1.1 2.0
switch tracktype=grade3 switch probablyGood 1.5 3.0
switch tracktype=grade4 switch probablyGood 2.0 5.0
switch tracktype=grade5 switch probablyGood 3.0 5.0
switch probablyGood 1.0 5.0
#
# When avoiding unsafe ways, avoid highways without a bike hint
#
add switch and avoid_unsafe not isbike 2 0
#
# exclude motorways and proposed roads
#
switch or highway=motorway highway=motorway_link 100000
switch highway=proposed 100000
#
# actuals roads are o.k. if we have a bike hint
#
switch or highway=trunk highway=trunk_link switch isbike 1.5 10
switch or highway=primary highway=primary_link switch isbike 1.2 3
switch or highway=secondary highway=secondary_link switch isbike 1.1 1.6
switch or highway=tertiary highway=tertiary_link switch isbike 1.0 1.4
switch highway=unclassified switch isbike 1.0 1.3
#
# default for any other highway type not handled above
#
2.0
---context:node # following code refers to node tags
assign defaultaccess
switch access=
1 # add default barrier restrictions here!
switch or access=private access=no
0
1
assign bikeaccess
or or longdistancecycleway=yes lcn=yes
switch bicycle=
switch vehicle=
defaultaccess
switch or vehicle=private vehicle=no
0
1
switch or bicycle=private or bicycle=no bicycle=dismount
0
1
assign footaccess
or bicycle=dismount
switch foot=
defaultaccess
switch or foot=private foot=no
0
1
assign initialcost
switch bikeaccess
0
switch footaccess
100
1000000

View file

@ -0,0 +1,176 @@
Profile developers guide - Technical reference
for BRouter cost-function scripts
==============================================
The tag-value lookup table
--------------------------
Within the routing data files (rd5), tag information
is encoded in a binary bitfield of 64 bit length for
the way tags and the node tags each.
To encode and decode to/from this bitfield, a lookup
table is used that contains all the tags and values
that are considered for encoding.
For each tag there are 2 special values:
- <empty> if the tag is not set or the value is empty
- "unknown" if the value is not contained in the table
An exception are "boolean tags" with exactly one value
in the lookup table - these are encoded into a single
bit and do not have the "unknown" value - in this case
unknown values are treated as empty.
Each value can have optional "aliases", these alias
values are encoded into the same binary value as the
associated primary value.
For compact encoding, the number of values per
tag in the lookup table should be a power of 2,
including the default values (<empty>, "unknown"),
so typically, a tag has 1, 2, 6, 14 or 30 values.
The numbers in the lookup table are statistical
information on the frequency of the values in the
map of germany - these are just informational and
are not processed by BRouter.
Context-Separation
------------------
Way-tags and Node-Tags are treated independently,
so there are different sections in the lookup table
as well as in the profile scripts for each context.
The special tags: "---context:way" and "---context:node"
mark the beginning of each section.
In the profile scripts there is a third context "global"
which contains global configuration which is shared for
all contexts and is accessible by the routing engine.
The variables from the "global" section in the profile
scripts are read-only visible in the "way" and
"node" sections of the scripts.
Predefined variables in the profile scripts
-------------------------------------------
Some variable names are pre-defined and accessed by
the routing engine:
- for the global section these are:
- 4 elevation configuration parameters:
- downhillcost
- downhillcutoff
- uphillcost
- uphillcutoff
- 3 boolean mode-hint flags
- validForBikes
- validForFoot
- validForCars
- and 2 variables to change the heuristic
coefficients for the 2 routing passes
( <0 disables a routing pass )
- pass1coefficient
- pass2coefficient
- for the way section these are
- turncost
- initialcost
- costfactor
- for the node section this is just
- initialcost
The operators of the profile scripts
------------------------------------
The "assign" operator is special: it can be used
only on the top level of the expression hirarchy
and has 2 operands:
assign <variable-name> <expression>
It just assigns the expression value to this
variable (which can be a predined variable or
any other variable, which in this case is defined
implicitly). The expression can be a complex expression
using other operators.
All other operators can be used recursively to an unlimted
complexity, which means that each operand can be a composed
expression starting with an operator and so on.
All expressions have one of the following basic forms:
- <numeric>
- <lookup-match>
- <1-op-operator> <operand>
- <2-op-operator> <operand> <operand>
- <3-op-operator> <operand> <operand> <operand>
- A numeric value is just a number, floating point, with "." as
decimal separtor. Boolean values are treated as numbers as well,
with "0" = false and every nonzero value = true.
- A lookup match has the form <tag-name>=<value>, e.g. highway=primary
Only the primary values can be used in lookup-matches, not aliases.
The <empty> value is refered to as an empty string, e.g. access=
- 1 Operand operators are:
not <boolean expression>
- 2 Operand operators are:
or <boolean expression 1> <boolean expression 2>
and <boolean expression 1> <boolean expression 2>
multiply <numeric expression 1> <numeric expression 2>
add <numeric expression 1> <numeric expression 2>
max <numeric expression 1> <numeric expression 2>
- 3 Operand operators are:
switch <boolean-expression> <true-expression> <false-expression>
So the switch expression has a numeric value which is the
true-expression if the boolean expression is true, the
false-expression otherwise
Technical constraints
---------------------
- The costfactor is required to be >= 1, otherwise the cost-cutoff
logic of the routing algorithm does not work and you get wrong results.
- The profile should be able to find a route with an average costfactor
not very much larger than one, because otherwise the routing algorithm
will not find a reasonable cost-cutoff, leading to a very large
search area and thus to long processing times.
- Forbidden ways or nodes must be treated as very high cost, because
there is no "forbidden" value. Please use 100000 for a (way-)costfactor,
and 1000000 for a nodes "initalcost", as these are proven values with
no overflow issues.
Developing and debugging scripts
--------------------------------
For developing scripts, the "Upload profile" funcionality and the
"Export CSV" button of the online version are your friends.
The "Export CSV" gives a (tab-separated) list of all way segments
with all tag values and with the calulated cost (in "cost per km").
These CSV-Data can be imported in Excel using "paste content" function.

217
misc/readmes/readme.txt Normal file
View file

@ -0,0 +1,217 @@
BRouter - Beta Version 0.9.8 - Setting up the Android App
=========================================================
Choosing and Installing a Map-Tool
----------------------------------
BRouter just calculates tracks as GPX-Files, it
does not display any map or give any navigation
instuctions. Therefore you need a map-tool in
order for BRouter to be useful.
Currently, BRouter cooperates with three different
maptools, so you need to install, and get familiar with,
at least one of them:
- "OsmAnd": See http://www.osmand.net Get It from Google-Play
or get it as an APK from the release-build archive:
http://download.osmand.net/releases/
I tested versions up to 1.6
- "Locus": See http://www.locusmap.eu There's a "Pro"
Version which is ad-free and a free version with ads.
You can get it from Google-Play, but for the free-version
there's also an APK-Download.
- "Oruxmaps": See http://www.oruxmaps.com Oruxmaps is
Donation-Ware, which means it's free and you're supposed
to donate to the project if you want to support it.
Which one to use is a matter of taste. Maybe OsmAnd is
more plug&play and has a reasonable voice-guidig. Locus
and Oruxmaps are more powerful and better for outdoor
use. Locus for example has elevation profile diagrams
which OsmAnd has not.
Locus and Oruxmaps are best used with third-party vector
maps, check http://www.openandromaps.org if you consider
to go for Locus or OruxMaps.
Choosing an SD-Card Base Directory
----------------------------------
Some phones (namely those with Android 4.x) have 2 logical
"SD-Cards", where the first one is internal and not an actual
Card, and the second one is a an optional "external" micro-sd-card
that can be taken out of the device.
If you have such a setup, try to make sure your map-tool uses
the external sd-card to store the offline maps and other stuff.
In OsmAnd, this works by choosing an "SD-Card base directory". Typically,
the first card in mounted on "/mnt/sdcard", while the external
one maybe mounted at "/mnt/sdcard/external_sd", but depending
on your phone it can be some other path.
In OruxMaps, path configuration is only possible for the actual
map data, but the configuration database file that BRouter tries
to access is hardwired to the /mnt/sdcard/oruxmaps directory.
As a workaround for this specific setup, you can place a
redirection file in the directory where BRouter would normally
place the gpx-files (e.g. /mnt/sdcard/oruxmaps/tracklogs).
The first line of that redirection file called "brouter.redirect"
must contain the absolute path of the directory where you want
the gpx-files to go (e.g. /storage0/oruxmaps/tracklogs).
Make sure you understand the concept of the SD-Card base-directory,
because the communication between BRouter and the Map-Tools
requires that both are using either the same base-directory,
or the maptools are using the standard base directory (/mnt/sdcard).
Selecting Waypoints in your Maptool
-----------------------------------
In order to calculate a route, BRouter needs to know
at least a starting point and an endpoint. You specify
them by creating waypoints in your map-tool.
These are called "Favorites" in OsmAnd, "POI"s in Locus
or "Wayoints" in Oruxmaps and allow to store a location
on the map and give it a name.
Pleae specify at least a waypoint called "from" for
the starting-point and another called "to" for the
endpoint (lowercase! names are case-sensitive) You
can use any category, as only the name is read by BRouter.
Optionally, you can specify more waypoints:
"via1" ... "via9" to specify stop-overs
"nogo[radius] [name]" to specify a nogo-area,
where radius (in Meter) is optional and defaults to 20m,
and the name is also optional. So "nogo", "nogo1000",
"nogo roadblock", "nogo200 badferry" are all valid
nogo-waypoints.
Make sure to not create duplicates for the from, to and via-waypoints,
as BRouter would complain about duplicates. For nogo-areas,
duplicates are allowed.
Starting from version 0.97, instead of following the from/to/via
naming convention, you can choose any names and select them from
withing BRouter.
Installing the BRouter App
--------------------------
Download the file "brouter_0_8.zip" and unpack in a directory
"brouter" on the SD-Card of your Android Device. Most convenient
is to attach the device (or just the sd-card) to a desktop-computer
and do the unpacking there, but doing that on the device itself
is also possible, provided you know the appropriate tools.
Install the BRouter-App by installing the APK-File "BRouter.apk"
For instructions how to install from an APK (in contrast to
installing from Google Play), search the internet for tips.
You may need to change system configuration, some setting like
"Applications->Unknown sources" depending on Android version.
The BRouter App asks for permissions to access the SD-Card
and to de-activate the screen saver. Being an offline app,
it does NOT ask for internet access. The drawback is that
you have to install the additional resources manually.
BRouter's SD-Card Directory Structure
-------------------------------------
BRouter guesses a reasonable sd-card base directory and on
first start prompts you for a base directory with it's
guess as a default. You should choose the same base
directory that is used by your map-tool.
On first start, BRouter will create a "brouter" subdirectory
relative to that base-directory if it's not already there
(becaused you created it by unpacking the zip-file, see above)
If later on you want to change the base directory, you can delete
or rename the 'brouter' subfolder, so it will prompt again for
a base directory. You should choose the same base directory that
is used by your map-tool (OsmAnd or Locus).
So you may end up with e.g. the following directory structure
(depending on base dir and your map-tool choice):
/mnt/sdcard/brouter
/mnt/sdcard/brouter/segments2 <- put routing data files (*.rd5) here
/mnt/sdcard/brouter/profiles2 <- put lookup-table and routing profiles here
/mnt/sdcard/osmand <- OsmAnd's sd-card dir
/mnt/sdcard/osmand/track <- OsmAnd's track storage
/mnt/sdcard/Locus <- Locus's sd-card dir
/mnt/sdcard/Locus/mapitems <- Locus's track storage
/mnt/sdcard/oruxmaps <- Oruxmaps's sd-card dir
/mnt/sdcard/oruxmaps/tracklogs <- Oruxmaps's track storage
Starting with version 0.94, if a non-standard base directory
is choosen (e.g. /mnt/sdcard/external_sd) BRouter tries to
additionally to access the configuraion files relative
to the standard base directory ( /mnt/sdcard )
The minimum files BRouter needs to work are e.g.
/mnt/sdcard/brouter/segments2/E5_N45.rd5
/mnt/sdcard/brouter/profiles2/lookups.dat
/mnt/sdcard/brouter/profiles2/trekking.brf
But of course you can put as many routing data files
and routing profiles as you like.
Get the profiles (*.brf) and the lookup.dat from
the zip-file or from:
http://www.dr-brenschede.de/brouter/profiles2
And the routing data files from:
http://h2096617.stratoserver.net/brouter/segments2
Routing data files are organised as 5*5 degree files,
with the Filename containing the south-west corner
of the square, which means:
- You want to route near West48/North37 -> get W50_N35.rd5
- You want to route near East7/North47 -> get E5_N45.rd5
From the above link you find routing data for all
places in the world where OSM data is available.
Starting the BRouter Android-APP
--------------------------------
Make sure you selected "from" and "to" waypoints
in your maptool as decsribed above.
Then you can start BRouter. It will read the waypoints
from the map-tools database, calculate the route and
store the result as "brouter0.gpx" in the map-tools
track directory.
BRouter shows a graphical animation of the routing
algorithm, and shows some messages on distances
and ascends. The "filtered ascend" is a measure
for the real hill-climbing pain, with small
variations filtered out.
Then you can use your maptool to view or navigate the
route.
If started once more with identical input,
BRouter will store a second route broute1.gpx
for the first alternative and so on.

View file

@ -0,0 +1,47 @@
BRouter - Beta Version 0.9.5 - Using the car-subset datafiles
==========================================================
Starting with version 0.9.5, BRouter supports car-subset
datafiles as a workaround for the memory issue in car routing.
Car-routing, however, is still considered experimental,
mainly due to the fact that turn-restrictions are still
not handled.
The cause of the memory overflow in long-distance car-routing
is the fact that a large fraction of the ways is not allowed
for cars and that the node-cache-pipe of brouter is not designed
to handle that. So the car-subset datafiles (".cd5") are identical
to the full datafiles (".rd5"), but do not contain the nodes
and ways that are not accessible for cars.
Using the car-subset datafiles, car-routing over longer
distances is possible, and it it somewhat faster than using
the full datafiles.
The car subset datafiles must be stored in a subdirectory
"carsubset" of the "segments2" directory, so a possible
file-system structure looks like this:
brouter/segments2/E5_N45.rd5
brouter/segments2/carsubset/E5_N45.cd5
You can download the cd5's from the corresponding URL
just like the rd5's.
Access to the car-subset datafiles is enabled
by assigning the routing-profile variable:
assign validForCars 1
as it is done for the "car-test" profile. In that case,
the router first checks for the car-subset file, and,
if it does not exist, uses the full datafile. It is
o.k. to just install the car-subset file without
having the full datafile installed.
If you want to use the car-subset datafile for bike-routing
(because you don't have the full datafile or because you
are using streets only anyhow and want better performance),
just assign the "validForCars" variable in your biking
profile as indicated above.

View file

@ -0,0 +1,72 @@
BRouter - Beta Version 0.9.5 - Using the service interface
==========================================================
Starting with version 0.9.3, BRouter contains a *NEW* service interface.
The HTTP-Interface introduced in 0.9.1-0.9.2 was dropped
The new service interface is an Android service that can be called
from other apps. See the file IBRouterService.aidl for the
interface definition.
Following map-tools implement this interface:
- OruxMaps starting with version 5.5.3
- Locus in the current version
- (for OsmAnd, pull-request is pending: https://github.com/osmandapp/Osmand/pull/537 )
The service interface defines a default timeout of 60 seconds
(if not modified by the caller), so you can only calculate
medium distance routes via the service interface. For long
distance calculations, you would run into the timeout, so
you have to use BRouter's classical operation mode at least
for an initial calculation. But read below on how timeout-free
recalculations work even for long-distance applications.
The configuration concept in the service interface
--------------------------------------------------
BRouter is fully configurable via the use of profile
definition files and a list of nogo-areas, while
the service interface is usually accessed by just
choosing one o the 6 "standard routing modes" made
of a combination of the car/bike/foot and the
shortest/fastest selection.
Therefore, you need a mapping between the standard routing mode
and BRouter's configuration. There is no default mapping
deployed with the BRouter distribution file, so you have
to configure this yourself. You can do that by starting
BRouter is the "normal" way and at the end of the routing
process, press the "Server Mode" button. Then you get
a list of standard routing mode with a preselection,
where you can choose for which of the 6 standard modes
you want to store the configuration just used.
(profile + nogo-list). Please note that the profile
is stored by reference (so modifications at the profile
file afterwards will have effect), while the nogo-areas
are stored by value (so modifying the nogo-waypoints
afterwards will have no effect)
Timeout-free recalculations
---------------------------
A new feature in zje service-interface of version 0.95 is that
you can follow a long-distance route and have (nearly) correct
recalculations when getting of the track, without running
into the 60-seconds timeout.
For that, a valid route to the destination must be known
for the current routing-mode. This can be achieved either
by calculating the route via the brouter-app and storing
it by pressing the "server-mode" button when done.
Or it is done implicitly by the service-mode itself once
it was able to do the calcultion within the timeout -
in that case, subsequent recalcs for the same destination
also make use of the known valid track for faster
processing.
The destination must be identical in a digital sense
(+- 20 microdegrees), so make sure to use the same waypoint,
do not re-enter it as a map-location.