Thanks Minko,
attached you find a complete patch with all changes and included country
specific access rules.
WanMil
Wanmil, here are two examples of country specific rules.
Maybe put them in one inc/access_country file so anyone can add their speific
country rules to this file?
# The Netherlands
highway=trunk & mkgmap:country=NLD { add bicycle=no; add foot=no }
highway=cycleway & mkgmap:country=NLD { add foot=yes }
highway=bridleway & mkgmap:country=NLD { add foot=yes }
# Belgium
highway=trunk & mkgmap:country=BEL { add bicycle=no; add foot=no }
highway=cycleway & mkgmap:country=BEL { add foot=yes }
highway=bridleway & mkgmap:country=BEL { add foot=yes }
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Index: resources/styles/default/inc/access_country
===================================================================
--- resources/styles/default/inc/access_country (revision 0)
+++ resources/styles/default/inc/access_country (revision 0)
@@ -0,0 +1,17 @@
+# This file contains country specific access restrictions
+# If your country is missing please post your country specific access rules
+# to the mkgmap developers list.
+
+# Belgium (BEL)
+
+highway=trunk & mkgmap:country=BEL { add bicycle=no; add foot=no }
+highway=cycleway & mkgmap:country=BEL { add foot=yes }
+highway=bridleway & mkgmap:country=BEL { add foot=yes }
+
+# The Netherlands (NLD)
+
+highway=trunk & mkgmap:country=NLD { add bicycle=no; add foot=no }
+highway=cycleway & mkgmap:country=NLD { add foot=yes }
+highway=bridleway & mkgmap:country=NLD { add foot=yes }
+
+
Index: resources/styles/default/inc/access
===================================================================
--- resources/styles/default/inc/access (revision 3198)
+++ resources/styles/default/inc/access (working copy)
@@ -10,63 +10,65 @@
# mkgmap:delivery
# A class is not allowed to use the way if its tag is set to 'no'
-highway=steps { add foot=yes; add access=no }
-highway=* & motorroad=yes { add bicycle=no; add foot=no }
-highway=motorway|highway=motorway_link { add bicycle=no; add foot=no }
-highway=pedestrian & area!=yes { add foot=yes; add access=no }
-highway=path { add foot=yes; add bicycle=yes; add access=no }
-highway=bridleway { add access=no }
-highway=cycleway { add bicycle=yes; add access=no }
-highway=footway { add foot=yes; add access=no }
-railway=platform { add foot=yes; add access=no }
+# First set access settings with high priority.
+#
+# In case a way is tagged with
+# highway=motorway;access=yes
+# we assume that foot and bikes are not allowed anyhow.
+
+highway=* & motorroad=yes { add bicycle=no; add foot=no; }
+highway=motorway | highway=motorway_link { add bicycle=no; add foot=no; }
+
+access=agricultural { set access=no; add foot=yes }
+
+# Now fill the access tree (http://wiki.openstreetmap.org/wiki/Key:access)
+# This is required so that subsequent rules do not add a tag (bicycle) which is already defined by a higher tag (vehicle)
+access=* { add foot='${access}'; add vehicle='${access}'; }
+vehicle=* { add bicycle='${vehicle}'; add motor_vehicle='${vehicle}'; }
+motor_vehicle=* { add motorcar='${motor_vehicle}'; add goods='${motor_vehicle}'; add hgv='${motor_vehicle}'; add psv='${motor_vehicle}'; add emergency='${motor_vehicle}'; }
+psv=* { add taxi='${psv}'; add bus='${psv}'; }
+# Include country specific access rules that are derived from the highway type
+include 'inc/access_country';
+
+# Add common access rules that are derived from the highway type
+highway=steps { add foot=yes; add access=no }
+highway=pedestrian & area!=yes { add foot=yes; add access=no }
+highway=path { add foot=yes; add bicycle=yes; add access=no }
+highway=bridleway { add access=no }
+highway=cycleway { add bicycle=yes; add access=no }
+highway=footway { add foot=yes; add access=no }
+railway=platform { add foot=yes; add access=no }
+
+# throughroute cannot be handled differently for different vehicle types
+# Therefore we have to choose one vehicle type - and the winner is: motorcar
motorcar=destination { set mkgmap:throughroute=no; set motorcar=yes }
-motorcycle=destination { set mkgmap:throughroute=no; set motorcycle=yes }
access=destination { set mkgmap:throughroute=no; set access=yes }
-bicycle=destination { set bicycle=yes }
-foot=destination { set foot=yes }
-hgv=destination { delete hgv }
-psv=destination { delete psv }
-taxi=destination { delete taxi }
-emergency=destination { delete emergency }
-delivery=destination { delete delivery }
-goods=destination { delete goods }
-bicycle=private | bicycle=agricultural { set bicycle=no }
+# Normalize all values that indicate a restriction to 'no'
foot=private | foot=agricultural { set foot=no }
-hgv=private | hgv=agricultural { set hgv=no }
+bicycle=private | bicycle=agricultural { set bicycle=no }
motorcar=private | motorcar=agricultural { set motorcar=no }
-psv=private | psv=agricultural { set psv=no }
+goods=private | goods=agricultural { set goods=no }
+hgv=private | hgv=agricultural { set hgv=no }
+bus=private | bus=agricultural { set bus=no }
taxi=private | taxi=agricultural { set taxi=no }
emergency=private | emergency=agricultural { set emergency=no }
-delivery=private | delivery=agricultural { set delivery=no }
-goods=private | goods=agricultural { set goods=no }
-motorcycle=private | motorcycle=agricultural { set motorcycle=no }
-motor_vehicle=private | motor_vehicle=agricultural { set motor_vehicle=no }
-vehicle=private | vehicle=agricultural { set vehicle=no }
-access=private { set access=no }
-access=agricultural { set access=no; add foot=yes }
-# set (override) specific restrictions
+# Copy the OSM access tags to the mkgmap internal tags
+foot=* { set mkgmap:foot='${foot}' }
bicycle=* { set mkgmap:bicycle='${bicycle}' }
-foot=* { set mkgmap:foot='${foot}' }
-hgv=* { set mkgmap:truck='${hgv}' }
motorcar=* { set mkgmap:car='${motorcar}' }
-psv=* { set mkgmap:bus='${psv}' }
-taxi=* { set mkgmap:taxi='${taxi}' }
-emergency=* { set mkgmap:emergency='${emergency}' }
-delivery=* { set mkgmap:delivery='${delivery}' }
-goods=* { set mkgmap:delivery='${goods}' }
+goods=* { set mkgmap:delivery='${goods}' }
+hgv=* { set mkgmap:truck='${hgv}' }
+bus=* { set mkgmap:bus='${bus}' }
+taxi=* { set mkgmap:taxi='${taxi}' }
+emergency=* { set mkgmap:emergency='${emergency}' }
-# Translate motor_vehicle and vehicle access rules.
-motorcycle=* { add mkgmap:car='${motorcycle}' }
-motor_vehicle=* { add mkgmap:car='${motor_vehicle}' }
-vehicle=* { add mkgmap:car='${vehicle}'; add mkgmap:bicycle='${vehicle}' }
-
-# the access tag defines all restrictions
+# The access tag defines all restrictions that are not already set
access=* { addaccess '${access}' }
-
-# check for carpool lane
-(carpool=yes | carpool=designated | carpool=permissive | carpool=official) { set mkgmap:carpool=yes }
+# Check for carpool lane (they are not really supported yet so these lines are commented)
+# hov=* { add carpool='${hov}' }
+# (carpool=yes | carpool=designated | carpool=permissive | carpool=official) { set mkgmap:carpool=yes }
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev