logo separator

[mkgmap-dev] Request to rollback at least rev 2747 - or give the access part a complete rework, as of right now it's broken...

From Felix Hartmann extremecarver at gmail.com on Fri Oct 25 14:17:26 BST 2013

Sorry for not answering so far, didn't have time...

On 17.10.2013 20:49, WanMil wrote:
> Let's go through your examples:
>
> highway=track, tracktype=grade2, bicycle=no, foot=private
>
> 1.
> highway=*  tracktype=grade2 {set mkgmap:bicycle=yes}
> highway=* & bicycle=no {add mkgmap:access=no}
> --- result bicycle=yes - foot=yes, all other set to no (there is no 
> rule for foot = private, value is set, so add cannot overwrite it)
>
> Rules that create your results with branch r2763:
> highway=*  tracktype=grade2 {set mkgmap:bicycle=yes}
> foot=* { add mkgmap:foot='${foot|subst:private=>no}' }
> highway=* & bicycle=no {addaccess no}
This change is not intuitive, and because the rules to recreate previous 
processing are just result based on the input. There is no way to 
automatically change to this behaviour by CTRL-H replacing. It means 
more or less rewriting a style from scratch.
Before knowing that foot=private exists, you simply cannot write a rule 
for it. Now with 2000+ lines of rules - you cannot add basically 
everywhere rules about treatment of private. Else a 2000+ lines line 
files becomes a 4000+ lines file, because directly overwriting private 
with no is impossible, without inflicting later places.
The only real solution is to add a rule (and that rule needs to be after 
every place where you set some value to private) like
foot=private { add mkgmap:foot=no; add addtag:private:foot=yes }
then each time you test for foot with implications if it was private, 
check whether addtag:private:foot=yes is set too.

Still, this doesn't bother me much, as at least for my style I can 
circumvent this problem with maybe 200-300 lines of new rules as I don't 
often need to know wheter it is really private or no (I think so, I'm 
sure will overlook some small places, but 99% should still work...).

Additionally -  for everyone not fully at ease with regex, 
"subst:private=>" is just plain madness. I think that needs much more 
explaining than an additional file where you could set what values are 
regarded as no.
>
>
> 1.1
> highway=*  tracktype=grade2 {set mkgmap:bicycle=yes}
> highway=* & bicycle=no {set mkgmap:access=no}
> --- result all access types no, as the second rule comes later and set
> should always overrule.
>
> Rules that create your results with branch r2763:
> highway=*  tracktype=grade2 {set mkgmap:bicycle=yes}
> highway=* & bicycle=no {setaccess no}
>
no problem as long as there is not sometimes later a delete 
mkgmap:access in the style.
>
> 1.2
> highway=*  tracktype=grade2 {add mkgmap:bicycle=yes}
> highway=* & bicycle=no {set mkgmap:access=no}
> --- result all access types no, as the second rule comes later and set
> should always overrule. As bicycle is only add command - it would be no
> anyhow.
>
> Rules that create your results with branch r2763:
> highway=*  tracktype=grade2 {add mkgmap:bicycle=yes}
> highway=* & bicycle=no {setaccess no}
>
>
> 1.3
> highway=* & bicycle=no {set mkgmap:access=no}
> highway=*  tracktype=grade2 {set mkgmap:bicycle=yes}
> -- bicycle=yes, all other access types no. later rule overrules earlier
>
> Rules that create your results with branch r2763:
> highway=* & bicycle=no {setaccess no}
> highway=*  tracktype=grade2 {set mkgmap:bicycle=yes}
>
>
> 1.4a
> highway=*  tracktype=grade2 {set mkgmap:access=no;set 
> mkgmap:bicycle=yes; }
> -- Does mkgmap keep track of order of commands set within one bracket??
> Well here the case is quite clear anyhow. Set access=no but bicycle=yes
>
> Rules that create your results with branch r2763:
> highway=*  tracktype=grade2 {setaccess no;set mkgmap:bicycle=yes; }
>
>
> 1.4b - heavily conflicting:
> highway=*  tracktype=grade2 {set mkgmap:bicycle=yes; set 
> mkgmap:access=no}
> -- Does mkgmap keep track of order of commands set within one bracket??
> If yes the logical answer would be to set all types to no. If not, then
> bicycle=yes and all other =no would be expected.
>
> Rules that create your results with branch r2763 (all no):
> highway=*  tracktype=grade2 {set mkgmap:bicycle=yes; setaccess no}
>
>
> 1.5
> bicycle=* {set mkgmap:bicycle='${bicycle}' }
> foot=* {set mkgmap:bicycle='${foot}' }
> highway=* & tracktype=grade2 {add mkgmap:access=yes}
> -- foot = no (there is no rule to convert private to no); bicycle = no;
> all other types set to yes.
>
> Rules that create your results with branch r2763:
> bicycle=* {set mkgmap:bicycle='${bicycle|subst:private=>no}' }
> foot=* {set mkgmap:bicycle='${foot|subst:private=>no}' }
> highway=* & tracktype=grade2 {addaccess yes}

> 1.6
> bicycle=* {set mkgmap:bicycle='${bicycle}' }
> foot=* {set mkgmap:foot='${foot}' }
> highway=* & tracktype=grade2 {set mkgmap:access=yes}
> -- well last rule is set all to yes, so previous rules don't apply. All
> types to no.
>
> Rules that create your results with branch r2763:
> bicycle=* {set mkgmap:bicycle='${bicycle}' }
> foot=* {set mkgmap:foot='${foot}' }
> highway=* & tracktype=grade2 {setaccess yes}
>
> (Result: all types are set to yes).
>
> I would say: well done - no unresolved problems ;-)
>
> Please send me one more example to convince me that a new shortcut
> removeaccess (which performs { delete mkgmap:bicycle; delete 
> mkgmap:foot; ...) is useful and required.

No I don't need a shortcut removeaccess which performs delete 
mkgmap:bicycle; and so on. If you would think that, then you didn't 
understand what I need.
I have about 1000 lines of code, which based on a) condition of way, and 
b) actual access rights, add or remove access rights. Sometimes full 
mkgmap:access sometimes only mkgmap:bicycle or other.

Now what I need is a way to remove setaccess itself, not it's outcome. 
If that would happen, the access rights in the map would already be broken.


I need the behaviour to be able to write set mkgmap:access=yes or 
set:mkgmap:acccess=no WHICH DOESN'T HAVE ANY INFLICTIONS ON OTHER KEYS 
LIKE MKGMAP:BICYCLE OR MKGMAP:FOOT and so on.
Basically I need a full separation between mkgmap:access and 
mkgmap:bicycle which is only resolved at the time of writing 0x* , not 
before.


E.g. some of the rules I'm using:
( mkgmap:access=no | mkgmap:access=private | mkgmap:access=destination ) 
& ( agricultural=yes | forestry=yes ) { delete mkgmap:access }
( mkgmap:bicycle=no | mkgmap:bicycle=nope ) &  ( agricultural=yes | 
forestry=yes ) {set mkgmap:bicycle=yes; set mkgmap:access=yes; set 
mkgmap:unpaved=1}

( mkgmap:access=permissive | mkgmap:access=designated | 
mkgmap:access=official ) & (( mkgmap:bicycle=* & mkgmap:bicycle!=no & 
mkgmap:bicycle!=nope )|(mkgmap:bicycle!=*)) {add mkgmap:access=yes}
bicycle=dismount & highway!=footway & highway!=pedestrian {set 
mkgmap:bicycle=yes; add bicycle:dismount=yes} # This rule already relies 
later on checking for bicycle:dismount=yes - which will be done on 
pedestrian streets or footways

mkgmap:bicycle=no & highway!=* & route!=* & extremecarver5!=* & 
aerialway!=* {delete mkgmap:bicycle}


...... and so on. About 1000 lines all similar to them


I have attached a very old lines file of mine (last public version) just 
to give you an idea. of how many of those lines I actually use. This 
file is however of 3 years old, written at a time when delete didn't 
exist (or I didn't know it can be used), so still very different to 
today. By now my lines file is like 3 times as long and complex. And I 
have over 100 set mkgmap:access=yes/no  and over 30 delete:mkgmap:access 
lines. At the current state removing the ability to use mkgmap:access as 
a tag, simply means I would have to sit down for months, and rewrite my 
lines file, because it's impossible otherwise to get correct output as 
many rules depend on the order, and any change that means that there 
needs to be a different order, results in the impossibility of 
implementing the new mkgmap notation system.
>
> It's not that I don't want to implement new useful helpers. But I want 
> to get a understable, as simple as possible and coherent set of helpers.
> A good indication if this target could be reached is how complicate it 
> is to document it.
>
> At the moment a possible documentation might look like this:
> The mkgmap:*** specific access tags define for each road which vehicle 
> types are allowed to use this road. Each tag can be set separately. 
> But there are some helper actions that allow to handle all access tags 
> at once:
> addaccess <value>
> setaccess <value>
>
> Example:
> highway=motorway { addaccess yes; set mkgmap:foot=no; set 
> mkgmap:bicycle=no }
> => all vehicles can use the motorway, except pedestrians and bicycles.
>
> ...
>
> So I think it's possible to describe the behaviour in a few sentences 
> (good).
> There are no side effects because there is only one tag for one 
> vehicle class (good).
> The access rules are completely transparent because they are defined 
> via style file (good).
> The access classification can be freely defined (good).
> Most access tags are not loaded from OSM files if they are not used 
> (good - especially for creating special thematic overlays).
> Existing style files need to be adapted (could be better - but 
> sometimes this is neccessary)
I mainly agree, but adding mkgmap:access as it's own tag, wouldn't add a 
lot of documentation, while explaining a lot of regex to achieve what 
you could do with mkgmap:access is much longer.
Even more, the main problems of changing the way the access situation is 
handled will be not only explaining the change once, but reexplaining it 
to people who realize it later, and to people who asks specific question 
but built their knowledge based on "old notation" styles floating around 
in the net.
>
>
> WanMil
>
>
>> no sorry, but that change would really mean to loose functionality and
>> ease of use...
>> Basically I see no way to change my lines styles without spending at
>> least a week trying to work around not being able to set and delete
>> mkgmap:access anymore...
>>
>> The main problem is, that layout (type) and routing is not independent -
>> hence my lines style-file, but also others, got very complicated. If the
>> restrictions would be handled by a completly independant style-file, the
>> road_class/road_speed by one, and the layout by one, it would be easy
>> and straightforward to change such things. Sadly by the way garmin maps
>> work, this cannot be done, hence my lines file is now about 8000 lines
>> long, and loosing mkgmap functionality is really bad....
>>
>>
>> On 17.10.2013 18:35, WanMil wrote:
>>>> yes - but that is much more code than a simple {set 
>>>> bicycle=private} and
>>>> knowing it's interpreted as no. However while without mkgmap:access
>>>> shortcut, I basically cannot ever update mkgmap anymore, for private
>>>
>>> Do you want to blackmail me? Please stop rumbling around.
>>>
>>> This is a branch so it's under development. Which means it is not
>>> feature complete and if you argue comprehensible I don't mind changing
>>> things.
>>>
>>>> It's not so many lines in my code which get more complicated.
>>>
>>
>

-- 
keep on biking and discovering new trails

Felix
openmtbmap.org & www.velomap.org

-------------- next part --------------
# This style-file used to create the VeloMaps is published under CCBYNCSA 3.0 by http://velomap.org . See here for license details: http://creativecommons.org/licenses/by-nc-sa/3.0/
# Please note: 
# a) any works that build upon it, have to give attribution to www.velomap.org
# b) any maps generated by using the style-file or large parts of it have to give attribution to www.velomap.org
# c) reusing this style-file or partly reusing it for commercial products/projects is not allowed without special permission by www.velomap.org 

# 	new AccessMapping("access",     RoadNetwork.NO_MAX), // must be first in list
#		new AccessMapping("bicycle",    RoadNetwork.NO_BIKE),
#		new AccessMapping("foot",       RoadNetwork.NO_FOOT),
#		new AccessMapping("hgv",        RoadNetwork.NO_TRUCK),
#		new AccessMapping("motorcar",   RoadNetwork.NO_CAR),
#		new AccessMapping("motorcycle", RoadNetwork.NO_CAR),
#		new AccessMapping("psv",        RoadNetwork.NO_BUS),
#		new AccessMapping("taxi",       RoadNetwork.NO_TAXI),
#		new AccessMapping("emergency",  RoadNetwork.NO_EMERGENCY),
#		new AccessMapping("delivery",   RoadNetwork.NO_DELIVERY),
#		new AccessMapping("goods",      RoadNetwork.NO_DELIVERY),
# Search for ref to not start with "lf" ref ~ '[^LF].*'
# Search for wildcards '.*(mountain|alpine)*'
# The delete command deletes a tag. { delete key123 }; The same result can be achieved by setting the value of the key to an empty string. {set key123 = '' }

# Remove Import Junk
ref=0 {delete ref}
highway=footpath {set highway=path}
bridge=true {set bridge=yes}
tracktype=grade1_ruts {set tracktype=2}

highway=unpaved { set highway=unsurfaced}
highway=service_footway { set highway=footway }
highway="track; footway" { set highway=footway }
highway="track;footway" { set highway=footway }
highway="path;track" { set highway=path }
highway=Feldweg { set highway=track }
highway="path; track" { set highway=path }
highway="track; path" { set highway=track }
highway="track;path" { set highway=track }
highway="footway; track" { set highway=footway }
highway="footway;track" { set highway=footway }
surface=sidewalk & highway=footway {set highway=sidewalk}
highway="residential; track" { set highway=track }
highway="residential;track" { set highway=track }
highway=residental { set highway=residential }
highway=livingstreet { set highway=living_street }
highway="footway; cycleway" { set highway=cycleway; set segregated=no }
highway="footway;cycleway" { set highway=cycleway; set segregated=no }
highway="cycleway; footway" { set highway=cycleway; set segregated=no }
highway="cycleway;footway" { set highway=cycleway; set segregated=no }
highway=cycleroad {set highway=cycleway; add class:bicycle=-1}
highway=cyclestreet { set highway=cycleway }
( highway=path | highway=footway | highway=track) & ( cycleway=* | cycleway:left=* | cycleway:right=* ) & cycleway!=no & oneway!=* {set highway=cycleway; delete cycleway; delete cycleway:left; delete cycleway:right}
cycleroad=yes {add class:bicycle=-1}
highway=pedestrian & ( sac_scale=* | mtb:scale=* ) {set highway=path}
( highway=footway | highway=pedestrian ) & ( hiking=yes | mtb=yes ) {set highway=path}
( highway=service | highway=footway | highway=bridleway ) & sport=cycling {set highway=cycleway}
highway=minor {set highway=unclassified}
(oneway=reverse | oneway=opposite ) {set oneway=-1}
(oneway=true | oneway=yes | oneway=forward | oneway=1) {set oneway=yes}
oneway=* & oneway!=-1 & oneway!=yes {delete oneway}
route=mountainbike {set route=mtb}


( cycleway=no | cycleway=none ) {delete cycleway}
cycleway="lane;opposite_lane" {set cycleway=opposite_lane}
cycleway="lane/opposite_lane" {set cycleway=opposite_lane}
cycleway="track;opposite_track" {set cycleway=opposite_track}
cycleway="opposite_track;track" {set cycleway=opposite_track}
bicycle=opposite_lane {add cycleway=opposite_lane}
bicycle=opposite_track {add cycleway=opposite_track}
bicycle=lane {add cycleway=lane}
bicycle=track {add cycleway=track}

( cycleway:left=path | cycleway=left | cycleway:left=yes ) {add cycleway:left=track}
( cycleway:right=path | cycleway=right | cycleway:right=yes ) {add cycleway:right=track}
( cycleway=segregated | cycleway=path ) {add cycleway=track}


bridge=footbridge {set highway=path; set bridge=yes}
bridge=pedestrian {set highway=pedestrian; set bridge=yes}
bridge=bicycle {set highway=cycleway; set bridge=yes}

# Make sure that no route=bicycle is missing because of another route
extremecarver5=bike & route!=bicycle {set route=bicycle}


# Create keys for higher resolution
# highway=secondary & ref ~ '[L].*' {set importantsecondary=yes}
# highway=secondary & ref ~ '[B].*' {set importantsecondary=yes}
highway=secondary & int_ref=* {set importantsecondary=yes}
highway=primary & int_ref=* {set importantprimary=yes}
highway=tertiary & int_ref=* {set importanttertiary=yes}
highway=tertiary & ref ~ '[L].*' {set importanttertiary=yes}

# Remove planned roads/railways
( highway=proposed | highway=planned ) {delete highway; delete oneway; delete tunnel; delete bridge}
planned=yes & highway=* {delete highway; delete oneway; delete tunnel; delete bridge}
planned=yes & railway=* {delete railway; delete oneway; delete tunnel; delete bridge}
( highway=proposed | higwhay=planned ) & tunnel=* {delete tunnel}
( highway=proposed | higwhay=planned ) & bridge=* {delete bridge}
( highway=proposed | higwhay=planned ) & oneway=* {delete oneway}
( highway=proposed | higwhay=planned ) {delete highway}

bicycle=no & highway!=* & route!=* & aerialway!=* {delete bicycle}
construction=minor | construction=no {delete construction}
construction=* & highway=* & route!=bicycle & route!=mtb  {set highway=construction}
highway=construction {add construction=yes}

toll=* {delete toll}

# Remove oneway on Waterways
oneway=* & waterway=* {delete oneway}

# Translate unusual access values
bicycle=agricultural {add bicycle=yes}
bicycle=forestry {add bicycle=yes}
bicycle=delivery {add bicycle=yes}
bicycle=permissive {set bicycle=yes}
bicycle=private {add access=destination}

foot=agricultural {set foot=yes}
foot=forestry {set foot=yes}
foot=delivery {set access=destination}
foot=permissive {set foot=yes}
foot=private & bicycle!=* {set access=no}
foot=private {set foot=no}

access=destination & bicycle!=* {set access=yes}
# access=agricultural | access=forestry {set access=yes}
# vehicle=agricultural | vehicle=forestry {add access=yes}
access=private & foot!=* & bicycle!=* {set access=no}



# Correct Spelling Mistakes and Apply Translitset name=
bicycle=no 	{set bicycle=nope}
highway=footpath {set highway=footway}
tracktype=1_ruts {set tracktype=2}
route=bicycle & network=mtb {set route=mtb}



# Placeholder for Translitset name=s.
loc_name=* 								{set name='${loc_name}'}
int_name=* 								{set name='${int_name}'}
int_name!=* & name:en=* 				{set name='${name:en}'}
int_name!=* & name:en!=* & name:de=* 	{set name='${name:de}'}
name:mtb=*								{set name='${name:mtb}'}
mtb:name=*								{set name='${mtb:name}'}
name_mtb=*								{set name='${name_mtb}'}
mtb_name=*								{set name='${mtb_name}'}


######## Create far zoomed out highways first so that hopefully the join-lines code works out better due to less splits by different names.

highway=motorway & int_ref=*	{set name='${ref} ${name}'} 	[0x10013 resolution 15-15 continue]
highway=motorway 				{set name='${ref} ${name}'} 	[0x10013 resolution 20-16 continue]
# highway=motorway_junction 									[0x10510 resolution 19-19 continue]
highway=motorway_link | highway=motorway_junction 				[0x10510 resolution 20-20 continue]

highway=trunk & int_ref=* 	{set name='${ref} ${name}'} 		[0x1050c resolution 17-16 continue]
highway=trunk 				{set name='${ref} ${name}'} 		[0x1050c resolution 20-18 continue]
highway=trunk_link 												[0x10513 resolution 20-20 continue]

highway=primary & importantprimary=yes {set name='${ref} ${name}'} 					[0x10518 resolution 18-18 continue]

motoroad=yes {set motorroad=yes}
motorroad=yes {set access=no; set motorcar=no; set bicycle=no; set foot=no; set hgv=no; set taxi=no; set emergency=no}
(bicycle=nope | bicycle=no ) & highway!=motorway & highway!=motorway_link  {set name='${name} XBK'|'XBK'; set mkgmap:unpaved=1; add taxi=no}

highway=primary & oneway=* & lanes>1 {set no0x150e=yes}
highway=primary & oneway=* & lanes>1 {set name='${ref} ${name}'}					[0x10518 resolution 20-19 continue]
highway=primary & no0x150e!=yes	{set name='${ref} ${name}'} 						[0x1050d resolution 20-19 continue]
highway=primary_link 																[0x10517 resolution 20-20 continue]


highway=secondary & ( importantsecondary=yes | importantprimary=yes ) {set name='${ref} ${name}'} [0x10519 resolution 19-19 continue]
highway=secondary & oneway=yes & lanes>1 {set no0x150e=yes}
highway=secondary & oneway=yes & lanes>1 {set name='${ref} ${name}'}				[0x10519 resolution 20-20 continue]
highway=secondary & no0x150e!=yes	{set name='${ref} ${name}'}						[0x1051e resolution 20-20 continue]
highway=secondary_link 																[0x10519 resolution 20-20 continue]

highway=tertiary 					{set name='${ref} ${name}'}						[0x1050f resolution 20-20 continue]



# Naming Section
railwayname=* & railway=* & highway!=* {set name='${railwayname}${name}' | '${railwayname}'}

route_name_bike1=* 		{add route_name1='${route_name_bike1}'}
route_name_bike2=* 		{add route_name1='${route_name_bike2}'}
route_name_bike3=* 		{add route_name1='${route_name_bike3}'}

railwayname=* & railway=* & highway!=* {set name='${railwayname}${name}' | '${railwayname}' }


# Hide unaccessible tunnels
highway=* & tunnel=yes & (access=private|access=no) & !(foot=yes) & !(bicycle=yes) & route!=mtb & route!=hiking & route!=bicycle {delete highway; delete junction}
# Disable dead-end-checks for unaccessible oneways
highway=* & oneway=yes & (access=private|access=no) {add mkgmap:dead-end-check=false}


# Overlay Attributes

( extremecarver6=icn | network=icn ) & route=bicycle & highway=primary  {set name='${route_name} icn'} 	[0x10501 resolution 19-17 continue]
( extremecarver6=ncn | network=ncn ) & route=bicycle & highway=primary  {set name='${route_name} ncn'}	[0x10501 resolution 19-17 continue]
( extremecarver6=rcn | network=rcn ) & route=bicycle & highway=primary  {set name='${route_name} rcn'}	[0x10502 resolution 19-18 continue]
( extremecarver6=tcn | network=tcn ) & route=bicycle & highway=primary  {set name='${route_name} tcn'}	[0x10502 resolution 19-19 continue]
# extremecarver6=lcn & highway=primary  {set name='${route_name} lcn'}	[0x10502 resolution 19-19 continue]
# extremecarver6=xcn & highway=primary  {set name='${route_name}'}		[0x10502 resolution 19-19 continue]

( extremecarver6=icn | network=icn ) & route=bicycle & ( highway=secondary | highway=tertiary ) {set name='${route_name} icn'}  [0x10506 resolution 19-17 continue]
( extremecarver6=ncn | network=ncn ) & route=bicycle & ( highway=secondary | highway=tertiary ) {set name='${route_name} ncn'}  [0x10506 resolution 19-17 continue]
( extremecarver6=rcn | network=rcn ) & route=bicycle & ( highway=secondary | highway=tertiary ) {set name='${route_name} rcn'}  [0x10507 resolution 19-18 continue]
( extremecarver6=tcn | network=tcn ) & route=bicycle & ( highway=secondary | highway=tertiary ) {set name='${route_name} tcn'}  [0x10507 resolution 19-19 continue]
# extremecarver6=lcn & ( highway=secondary | highway=tertiary ) {set name='${route_name} lcn'}  [0x10507 resolution 19-19 continue]
# extremecarver6=xcn & ( highway=secondary | highway=tertiary ) {set name='${route_name}'}  	[0x10507 resolution 19-19 continue]

( extremecarver6=icn | network=icn ) & route=bicycle & highway!=primary & highway!=secondary & highway!=tertiary {set name='${route_name} icn'}	[0x10506 resolution 20-17 continue]
( extremecarver6=ncn | network=ncn ) & route=bicycle & highway!=primary & highway!=secondary & highway!=tertiary {set name='${route_name} ncn'}	[0x10506 resolution 20-17 continue]
( extremecarver6=rcn | network=rcn ) & route=bicycle & highway!=primary & highway!=secondary & highway!=tertiary {set name='${route_name} rcn'} [0x10507 resolution 20-18 continue]
( extremecarver6=tcn | network=tcn ) & route=bicycle & highway!=primary & highway!=secondary & highway!=tertiary {set name='${route_name} tcn'} [0x10507 resolution 20-19 continue]
( extremecarver6=lcn | network=lcn ) & route=bicycle & highway!=primary & highway!=secondary & highway!=tertiary {set name='${route_name} lcn'} [0x10507 resolution 20-20 continue]
extremecarver6=xcn & highway!=primary & highway!=secondary & highway!=tertiary {set name='${route_name}'}  										[0x10507 resolution 20-20 continue]

4wd_only=yes {add taxi=no; add mkgmap:unpaved=1}
bicycle=nope & route!=mtb & route!=bicycle & extremecarver6!=* & tunnel=* & ( highway=primary | highway=secondary | highway=tertiary ) {set access=no}
bicycle=nope & route!=mtb & route!=bicycle & extremecarver6!=* & bridge=* & ( highway=primary | highway=secondary ) {set access=no}


# General Action Rules
highway=* & incline >20  & mtb:scale:uphill=2  & mtb:scale:uphill=3 {set copy=98; set copy1=yes}
highway=* & incline <20  & mtb:scale:uphill=2  & mtb:scale:uphill=3 {set copy=99; set copy1=yes}
highway=* & incline >20  & mtb:scale:uphill!=0 & mtb:scale:uphill!=1 & mtb:scale:uphill!=2 & mtb:scale:uphill!=3 {set oneway=-1; 	set copy=98; set copy1=yes}  
highway=* & incline <-20 & mtb:scale:uphill!=0 & mtb:scale:uphill!=1 & mtb:scale:uphill!=2 & mtb:scale:uphill!=3 {set oneway=yes;	set copy=99; set copy1=yes} 

# Set ferry attribute
route=ferry | route1=ferry 	| railway=funicular | railway=rack	| aerialway=* | route=shuttle_train	| line=shuttle_train	{set mkgmap:ferry=1}


# delete access restrictions if foot/bicycle allowed
bicycle=yes	| foot=yes	| bicycle=designated | foot=designated | bicycle=permissive | foot=permissive | bicycle=official | route=mtb | extremecarver=mr | route=bicycle | route=foot | route=hiking 	{set access=yes}
( access=no | access=private ) & ( bicycle=* | foot=* ) & bicycle!=nope & foot!=no & foot!=private & tunnel!=* & bridge!=* 	{set access=yes} 


(highway=path | highway=footway | highway=bridleway) & segregated=yes 		{set highway=cycleway}
highway=footway  & segregated=no 											{add taxi=no; set highway=path}
highway=path & ( bicycle=designated | bicycle=yes ) & foot=no				{set taxi=no; add mkgmap:unpaved=1; set highway=cycleway}
highway=path & bicycle=nope & (foot=designated | foot=yes | foot=permitted) {set taxi=no; add mkgmap:unpaved=1; set highway=footway}
highway=footway & bicycle=designated & foot!=*								{set access=yes; set highway=path}
highway=cycleway & ( foot=yes | foot=permissive )  							{set access=yes}
highway=footway & bicycle=designated & ( foot=yes | foot=designated )		{set access=yes; set taxi=no; set highway=cycleway}
highway=cycleway & foot=designated				  							{set access=yes }
( highway=footway | highway=path ) & bicycle=official 						{set access=yes; set highway=cycleway; set taxi=no}
highway=pedestrian & ( sac_scale=* | trail_visibility=* ) {set highway=footway; set access=yes; add mkgmap:unpaved=1; set taxi=no}
highway=pedestrian & (mtb:scale=* | mtb:scale:uphill=*) {set highway=path; set access=yes; add mkgmap:unpaved=1; set taxi=no}
highway=pedestrian & bicycle=yes {set highway=footway; set access=yes; set taxi=no}
( highway=construction | ( construction=* & construction!=no )) & route!=bicycle & biycle!=yes & bicycle!=designated {set highway=construction; add taxi=no; add mkgmap:unpaved=1; add toll=yes}
( highway=construction | ( construction=* & construction!=no )) {add taxi=no}


# Remove access rights for motorcars/motorcycles:
motorcar=no | motorcar=private {delete motorcar}
motorcycle=no | motorcycle=private {delete motorcycle}
motor_vehicle=* {delete motor_vehicle}
hgv=* {delete hgv}
psv=* {delete psv}
taxi=* {delete taxi}
bus=* {delete bus}
emergency=no | emergency=private {delete emergency}
delivery=no | delivery=private {delete delivery}
goods=no | goods=private {delete goods}
carpool=* {delete carpool}


route1=ferry 											{set name='${name1} ${name} ferry' | '${name1} ferry'  |'${name} ferry' }					[0x01 road_class=3 road_speed=2 resolution 24 continue with_actions]
route=ferry | waterway=ferry_way | line=ferry			{set name='${name1} ${name} ferry' | '${name1} ferry'  |'${name} ferry' } 					[0x01 road_class=3 road_speed=1 resolution 24 continue with_actions]
route1=shuttle_train 									{set name='${name1} ${name} shuttle' | '${name1} shuttle train'  |'${name} shuttle train' }	[0x01 road_class=2 road_speed=2 resolution 24 continue with_actions]
route=shuttle_train | line=shuttle_train				{set name='${name1} ${name} shuttle' | '${name1} shuttle train'  |'${name} shuttle train' }	[0x01 road_class=2 road_speed=1 resolution 24 continue with_actions]

route1=ferry 													[0x1060e resolution 19 continue]
route=ferry | waterway=ferry_way | line=ferry					[0x1060e resolution 20 continue]
route1=shuttle_train 											[0x1060e resolution 19 continue]
route=shuttle_train | line=shuttle_train					 	[0x1060e resolution 20 continue]

( bridge=yes | bridge=swing | bride=viaduct | bride=aqueduct)	& (route=mtb | route=bicycle | extremecarver6=*) {set name='${name} bridge' | 'bridge'}	[0x01 road_class=3 road_speed=0 resolution 24 continue]

bridge=yes 		& ( highway=primary | motorroad=yes | highway=trunk | highway=motorway ) 		{set name='${name} bridge' | 'bridge'}	[0x10701 resolution 21-21 continue with_actions]
bridge=yes 		& highway=secondary 															{set name='${name} bridge' | 'bridge'}	[0x10601 resolution 23-21 continue with_actions]
bridge=yes 		& highway=secondary 																									[0x10007 resolution 24 continue]
bridge=yes 		& construction!=* & ( highway=motorway | highway=trunk )		[0x10001 resolution 23-22 continue]
bridge=yes 		& construction!=* & ( highway=motorway | highway=trunk )		[0x10005 resolution 24 continue]
bridge=yes 		& construction!=* & ( highway=primary | motorroad=yes )			[0x10701 resolution 23-22 continue]
bridge=yes 		& construction!=* & ( highway=primary | motorroad=yes )			[0x10001 resolution 24 continue]

bridge=swing 	& ( highway=primary | motorroad=yes | highway=trunk | highway=motorway ) 		{set name='${name} swing' | 'swing'}		[0x10701 resolution 21 continue with_actions]
bridge=swing 	& highway=secondary 															{set name='${name} swing' | 'swing'}		[0x10601 resolution 21 continue with_actions]
(bridge=yes | bridge=swing)  	& ( highway=residential | highway=service ) 					{set name='${name} bridge' | 'bridge'}		[0x10603 resolution 22 continue with_actions]

bridge=yes		& highway=* & highway!=primary & highway!=motorway & highway!=trunk & motorroad!=yes & highway!=secondary & highway!=residential & highway!=service & construction!=* & waterway!=* & highway!=construction & waterway!=* & highway!=proposed & ( proposed!=* | proposed=no )	{set name='${name} bridge' | 'bridge'}	[0x13 road_class=3 road_speed=0 resolution 22 continue with_actions]
bridge=aqueduct & highway=* & higwhway!=construction & construction!=* & highway!=proposed & ( proposed!=* | proposed=no ) {set name='${name} aqueduct' | 'aqueduct'}	[0x13 road_class=1 road_speed=0 resolution 22 continue]
bridge=viaduct 	& highway=*	& higwhway!=construction & construction!=* & highway!=proposed & ( proposed!=* | proposed=no ) {set name='${name} viaduct' | 'viaduct'} 	[0x13 road_class=1 road_speed=0 resolution 22 continue]
bridge=swing 	& highway=* & higwhway!=construction & construction!=* & highway!=proposed & ( proposed!=* | proposed=no ) {set name='${name} swing' | 'swing'}			[0x13 road_class=2 road_speed=0 resolution 22 continue]

bridge=yes		& highway!=*				{set name='${name} bridge' | 'bridge'}														[0x13 resolution 22 continue]
bridge=aqueduct & highway!=*				{set name='${name} aqueduct' | 'aqueduct'}													[0x13 resolution 22 continue]
bridge=viaduct 	& highway!=*				{set name='${name} viaduct' | 'viaduct'}													[0x13 resolution 22 continue]
bridge=swing 	& highway!=*				{set name='${name} swing' | 'swing'}														[0x13 resolution 22 continue]

tunnel=yes 		& construction!=* & ( highway=secondary	| highway=tertiary )									[0x10600 resolution 23-21 continue]
tunnel=yes 		& construction!=* & ( highway=secondary	| highway=tertiary )									[0x10006 resolution 24 continue]
tunnel=yes 		& construction!=* & ( highway=primary | motorroad=yes | highway=trunk | highway=motorway )		[0x10700 resolution 21-21 continue]
tunnel=yes 		& construction!=* & ( highway=motorway | highway=trunk )										[0x10000 resolution 23-22 continue]
tunnel=yes 		& construction!=* & ( highway=motorway | highway=trunk )										[0x10004 resolution 24 continue]
tunnel=yes 		& construction!=* & ( highway=primary | motorroad=yes )											[0x10002 resolution 23-22 continue]
tunnel=yes 		& construction!=* & ( highway=primary | motorroad=yes )											[0x10000 resolution 24 continue]

tunnel=yes 		& construction!=* & ( highway=residential | highway=service )									[0x10602 resolution 22 continue]
tunnel=yes & (route=mtb | route=bicycle | extremecarver6=*) & highway!=primary & highway!=motorway & highway!=trunk & motorroad!=yes & highway!=secondary & highway!=residential & highway!=service & construction!=* & waterway!=* & highway!=construction	& construction!=* & waterway!=*  & highway!=construction  [0x1000a resolution 21-21 continue]
tunnel=yes & highway=* & highway!=primary & highway!=motorway & highway!=trunk & motorroad!=yes & highway!=secondary & highway!=tertiary & highway!=residential & highway!=service & construction!=* & waterway!=* 	& highway!=construction	& highway!=proposed & ( proposed!=* | proposed=no ) [0x1000a resolution 22 continue]


bicycle:backward=no | oneway:bicycle=yes | oneway:bicycle=true | oneway:bicycle=1 | bicycle:oneway=yes | bicycle:oneway=true | bicycle:oneway=1 {set oneway=yes}
bicycle:forward=no | oneway:bicyle=-1 | oneway:bicycle=reverse | bicycle:oneway=-1 | bicycle:oneway=reverse {set oneway=-1}

#note 0x17 is the garbage can
# waterway=* & tunnel=*																		[0x17 resolution 21]
# tunnel=* & construction=*																	[0x17 resolution 21]
# tunnel=* & highway=construction															[0x17 resolution 21]


# ( admin_level=1 & boundary=* ) | admin_level_1=yes	{set name='${left:country}/${right:country}' | '${mkgmap:boundary1_name}' | '${name}' | 'ntnl bndry'} [0x1e resolution 14 continue]
( admin_level=2 & boundary=* ) | admin_level_2=yes | boundary=national	{set name='${mkgmap:boundary2_name}' | '${left:country}/${right:country}' | '${name}' | 'ntnl bndry'} 				[0x1e resolution 14 continue]
( admin_level=3 & boundary=administrative ) | admin_level_3=yes	{set name='${mkgmap:boundary3_name}' | '${left:state}/${right:state}' | '${left:district}/${right:district}' | '${name}' | 'admin_lv=3'} [0x1d resolution 19 continue]
( admin_level=4 & boundary=* ) | admin_level_4=yes	{set name='${mkgmap:boundary4_name}' | '${left:state}/${right:state}' | '${left:district}/${right:district}' | '${name}' | 'admin_lv=4'} 	[0x1c resolution 22 continue]

# ( admin_level_5=yes | ( admin_level=5 & boundary=administrative )) & admin_level1!=* & admin_level2!=* & admin_level3!=* & admin_level!=1 & admin_level!=2 & admin_level!=3	 & admin_level!=4 {set name='${mkgmap:boundary5_name}' | '${left:district}/${right:district}'| '${left:county}/${right:county}' | '${name}' | 'admin_lv=5'} [0x10e1f resolution 23 continue]

# ( admin_level_6=yes | ( admin_level=6 & boundary=* )) & admin_level1!=* & admin_level2!=* & admin_level3!=* & admin_level4!=* & admin_level!=1 & admin_level!=2 & admin_level!=3 & admin_level!=4 & admin_level!=5	 {set name='${mkgmap:boundary6_name}' | '${left:county}/${right:county}' | '${left:city}/${right:city}' | '${name}' | 'admin_lv=6'} [0x10e1f resolution 24 continue]

# ( admin_level_8=yes | ( admin_level=8 & boundary=* )) & admin_level1!=* & admin_level2!=* & admin_level3!=* & admin_level4!=* & admin_level5!=* & admin_level!=1 & admin_level!=2 & admin_level!=3 & admin_level!=4 & admin_level!=5	{set name='${mkgmap:boundary8_name}' | '${left:county}/${right:county}' | '${left:city}/${right:city}' | '${name}' | 'admin_lv=8'} [0x10e1f resolution 24 continue]

# boundary=political & admin_level!=1 & admin_level!=2 & admin_level!=3 & admin_level!=4 & admin_level!=5 & admin_level!=6 & admin_level_copy!=* {set name='${left:country}/${right:country}' | '${left:state}/${right:state}' | '${left:district}/${right:district}' | '${left:county}/${right:county}' |'${left:municipality}/${right:municipality}' | '${left:city}/${right:city}' | '${left:village}/${right:village}' | '${left:suburban}/${right:suburban}' | '${name}'} 	[0x10e1f resolution 24 continue]

# boundary=civil & admin_level!=1 & admin_level!=2 & admin_level!=3 & admin_level!=4 & admin_level!=5 & admin_level!=6 & admin_level_copy!=* {set name='${left:country}/${right:country}' | '${left:state}/${right:state}' | '${left:district}/${right:district}' | '${left:county}/${right:county}' |'${left:municipality}/${right:municipality}' | '${left:city}/${right:city}' | '${left:village}/${right:village}' | '${left:suburban}/${right:suburban}' | '${name}'} 	[0x10e1f resolution 24 continue]

boundary=national_park | boundary99=yes		{set name='${mkgmap:boundary99_name}' | '${name}' | 'ntnl park'} 	[0x10f17 resolution 24 continue]



waterway=weir							{add name='${name}' | 'weir'}			[0x10f08 resolution 24 continue]
waterway=dam							{add name='${name}' | 'dam'}			[0x10e0f resolution 22 continue]
waterway=waterfall						{add name='${name}' | 'waterfall'}		[0x1100b resolution 22 continue]

waterway=stream & width<14		& ( tunnel!=yes & ( layer!=* | layer>-3 )) {add name='${name}' | 'stream'}			[0x18 resolution 21-21 continue]
waterway=stream 				& ( tunnel!=yes & ( layer!=* | layer>-3 )) {add name='${name}' | 'stream'}			[0x18 resolution 22 continue]

waterway=drain 							& tunnel!=yes & ( layer!=* | layer>-3 )	{add name='${name}' | 'drain'} 			[0x10a0a resolution 23 continue]
waterway=ditch 	| barrier=ditch			& tunnel!=yes & ( layer!=* | layer>-3 )	{add name='${name}' | 'ditch'} 			[0x10a0a resolution 23 continue]
waterway=river & width>99 				& tunnel!=yes & ( layer!=* | layer>-5 )	{add name='${name}' | 'huge river'}		[0x10a00 resolution 18 continue]
waterway=river & width>49 & width<100 	& tunnel!=yes & ( layer!=* | layer>-5 )	{add name='${name}' | 'wide river'}		[0x10a00 resolution 19 continue]
waterway=river & width>24 & width<50 	& tunnel!=yes & ( layer!=* | layer>-5 )	{add name='${name}' | 'medium river'}	[0x10a0b resolution 20 continue]
waterway=river & width<25 				& tunnel!=yes & ( layer!=* | layer>-4 )	{add name='${name}' | 'small river'}	[0x1f resolution 21 continue]
waterway=river & width!=* 				& tunnel!=yes & ( layer!=* | layer>-4 )	{add name='${name}' | 'river'}			[0x1f resolution 21 continue]
waterway=canal & width>49				& tunnel!=yes & ( layer!=* | layer>-4 )	{add name='${name}' | 'canal'}			[0x10a01 resolution 19-19 continue]
waterway=canal & width>24				& tunnel!=yes & ( layer!=* | layer>-4 )	{add name='${name}' | 'canal'}			[0x10a01 resolution 20-20 continue]
waterway=canal & width>14				& tunnel!=yes & ( layer!=* | layer>-4 )	{add name='${name}' | 'canal'}			[0x10a01 resolution 21-21 continue]
waterway=canal 							& tunnel!=yes & ( layer!=* | layer>-3 )	{add name='${name}' | 'canal'}			[0x10a01 resolution 22 continue]


railway=platform 					[0x06 resolution 23 continue]
railway=platform & highway!=*		{set access=yes; set motorcar=yes; set bicycle=yes; set foot=yes; set hgv=yes; set emergency=yes} [0x01 road_class=0 road_speed=0 resolution 24]

(railway=light_rail | railway=narrow_gauge | railway=disused | railway=preserved | railway=monorail | (railway=* & disused=yes)) & (tunnel=* & tunnel!=no) & highway!=* {delete tunnel; delete railway}
railway=subway & bridge=yes {set railway=rail; set usage=tourism}
# railway=subway & ( tunnel=* & tunnel!=no ) {delete railway}
railway=subway 						[0x1070b resolution 24 continue]
railway=light_rail 					[0x10010 resolution 22 continue]
railway=* & (tunnel=* & tunnel!=no) [0x1070b resolution 24 continue]

railway=rail & usage=main			[0x10a08 resolution 18 continue]
railway=rail & priority=primary	{set railway=none}	[0x10a08 resolution 19 continue with_actions]
railway=rail & usage=branch			[0x10a08 resolution 21 continue]
railway=rail & usage=industrial		[0x10010 resolution 23 continue]
railway=rail & usage=tourism		[0x10a08 resolution 22 continue]
railway=rail & usage=military		[0x10010 resolution 24 continue]
railway=rail & disused=yes			[0x10010 resolution 24 continue]
railway=rail & name=*  & tracks>1	& usage!=main & usage!=branch & usage!=industrial & usage!=tourism & usage!=military & disused!=yes [0x10a08 resolution 19 continue]
railway=rail & name!=* & tracks>1	& usage!=main & usage!=branch & usage!=industrial & usage!=tourism & usage!=military & disused!=yes [0x10a08 resolution 21 continue]
railway=rail & name=*  & tracks<2	& usage!=main & usage!=branch & usage!=industrial & usage!=tourism & usage!=military & disused!=yes [0x10a08 resolution 20 continue]
railway=rail & name!=* & tracks<2	& usage!=main & usage!=branch & usage!=industrial & usage!=tourism & usage!=military & disused!=yes [0x10a08 resolution 22 continue]
railway=rail & name=*  & tracks!=*	& usage!=main & usage!=branch & usage!=industrial & usage!=tourism & usage!=military & disused!=yes [0x10a08 resolution 21 continue]
railway=rail & name!=* & tracks!=*	& usage!=main & usage!=branch & usage!=industrial & usage!=tourism & usage!=military & disused!=yes [0x10a08 resolution 22 continue]

railway=* & disused=yes & railway!=rail		[0x10010 resolution 24 continue]
railway=tram 								[0x10010 resolution 22 continue]
railway=narrow_gauge 						[0x10010 resolution 22 continue]
railway=preserved	 						[0x10010 resolution 22 continue]
railway=disused	 							[0x10010 resolution 23 continue]
railway=monorail	 						[0x10010 resolution 22 continue]


# highway=pedestrian & bicycle!=yes & bicycle!=permitted {add name='${name} nobike' | 'nobike'}				[0x10e00 resolution 22 continue]

piste:type=snow_park | piste:type=snowpark {delete piste:type}
piste:type=downhill & piste:difficulty=freeride {delete piste:type}										

piste:type=downhill & piste:difficulty=expert {set name='${name} expert piste' | 'expert piste'}		[0x10f14 resolution 23 continue]
piste:type=downhill & piste:difficulty=advanced {set name='${name} advanced piste' | 'advanced piste'}	[0x10f13 resolution 23 continue]
piste:type=downhill & piste:difficulty=intermediate {set name='${name} intrmdt piste' | 'intrmdt piste'} [0x10f12 resolution 23 continue]
piste:type=downhill & piste:difficulty=easy {set name='${name} easy psite' | 'easy piste'}				[0x10f11 resolution 23 continue]
piste:type=downhill & piste:difficulty=novice {set name='${name} novice piste' | 'novice piste'}		[0x10f10 resolution 24 continue]
piste:type=downhill & piste:difficulty!=*  {set name='${name} piste' | 'piste'}							[0x10a05 resolution 23 continue]


(aerialway=tbar | aerialway=t-bar | piste:lift=tbar | piste:lift=t-bar | aerialway=schlepplift | piste:lift=schlepplift | drag_lift=tbar | drag_lift=t-bar)	{set name='${name} tbar' | 'tbar'}	[0x10012 resolution 23 continue]
aerialway=platter 		{set name='${name} platter' | 'platter'}								[0x10012 resolution 23 continue]
aerialway=rope_tow 		{set name='${name} ropetow' | 'ropetow'}								[0x10012 resolution 23 continue]
aerialway=jbar | aerialway=j-bar				{set name='${name} jbar' | 'jbar'}				[0x10012 resolution 23 continue]
(aerialway=drag_lift | piste:lift=drag_lift)	{set name='${name} drag_lift' | 'drag_lift'}	[0x10012 resolution 23 continue]

(aerialway=cable_car | aerialway=cablecar)	{set oneway=no; set name='${name} cablecar' | 'cablecar'}						[0x1b road_class=3 road_speed=1 resolution 21 continue]
railway=funicular | railway=rack			{set oneway=no; set name='${name} funicular' | 'funicular'}						[0x10a08 road_class=3 road_speed=1 resolution 21 continue]
(aerialway=gondola | aerialway=mixed_lift) 	{set oneway=no; set name='${name} gondola' | 'gondola'}							[0x1b road_class=3 road_speed=1 resolution 21 continue]
( aerialway=chair_lift | aerialway=chairlift ) & bicycle=yes	{set name='${name} chairlift' | 'chairlift'}				[0x01 road_class=2 road_speed=0 resolution 24 continue]
( aerialway=chair_lift | aerialway=chairlift ) & bicycle=yes	{set name='${name} chairlift' | 'chairlift'}				[0x2b resolution 22 continue]
( aerialway=chair_lift | aerialway=chairlift ) & bicycle!=yes	{set name='${name} chairlift' | 'chairlift'}				[0x10018 resolution 22 continue]
aerialway=goods | aerialway=goods_lift | aerialway=lift | aerialway=material {set name='${name} goods' | 'goods_lift'}		[0x1b resolution 23 continue]

natural=coastline & name!=see & name!=lake & name:en!=lake & name:de!=see & name!=neusiedler & natural!=water 	{set name='${name} coastline ' | 'coastline'}	[0x10a04 resolution 18 continue]
natural=coastline & name!=see & name!=lake & name:en!=lake & name:de!=see & name!=neusiedler & natural=water	{set name='${name} coastline ' | 'coastline'}	[0x10a04 resolution 18 continue]

power=line | powerline=yes 		[0x29 resolution 23 continue]

( man_made=pipeline | waterway=pipeline | manmade=pipeline ) & tunnel!=* & location!=underground & location!=underwater	[0x28 resolution 23 continue]
( natural=cliff | barrier=cliff )		{set name='${name} cliff' | 'cliff'}		[0x10f01 resolution 23 continue]
# barrier=wall			[0x10f02 resolution 24 continue]
# barrier=retaining_wall	[0x10f03 resolution 24 continue]
barrier=city_wall 		[0x10f04 resolution 23 continue]
# barrier=fence 			[0x10f05 resolution 24 continue]
# barrier=wood_fence 		[0x10f05 resolution 24 continue]
# barrier=wire_fence 		[0x10f05 resolution 24 continue]
# barrier=metal_fence 	[0x10f05 resolution 24 continue]
# barrier=gate 			[ resolution 24 continue]
# barrier=stile			[ resolution 24 continue]
# (barrier=hedge | natural=hedge)	[0x10f06 resolution 24 continue]
(barrier=bus_guideway | highway=bus_guideway | highway=bus_stop)	[0x10f07 resolution 24 continue]


aeroway=runway 		{set name='runway ${name}' | 'runway'}	[0x27 resolution 22 continue]
aeroway=taxiway 	{set name='taxiway ${name}' | 'taxiway'}	[0x10f0a resolution 22 continue]
aeroway=apron 		{set name='apron ${name}' | 'apron'}		[0x10f0b resolution 22 continue]



## Naming Section 2
mbt:scale=* {add mtb:scale = '${mbt:scale}'}
mtb_scale=* {add mtb:scale = '${mtb_scale}'}

mtb:scale="0-1" {set mtb:scale=0+}
mtb:scale="1-2" {set mtb:scale=1+}
mtb:scale="2-3" {set mtb:scale=2+}
mtb:scale="3-4" {set mtb:scale=3+}
mtb:scale="4-5" {set mtb:scale=4+}

mtb:scale="0/1" {set mtb:scale=0+}
mtb:scale="1/2" {set mtb:scale=1+}
mtb:scale="2/3" {set mtb:scale=2+}
mtb:scale="3/4" {set mtb:scale=3+}
mtb:scale="4/5" {set mtb:scale=4+}

mtb:scale="0;1" {set mtb:scale=0+}
mtb:scale="1;2" {set mtb:scale=1+}
mtb:scale="2;3" {set mtb:scale=2+}
mtb:scale="3;4" {set mtb:scale=3+}
mtb:scale="4;5" {set mtb:scale=4+}

mtb:scale:uphill="0-1" {set mtb:scale:uphill=0+}
mtb:scale:uphill="1-2" {set mtb:scale:uphill=1+}
mtb:scale:uphill="2-3" {set mtb:scale:uphill=2+}
mtb:scale:uphill="3-4" {set mtb:scale:uphill=3+}
mtb:scale:uphill="4-5" {set mtb:scale:uphill=4+}

mtb:scale:uphill="0/1" {set mtb:scale:uphill=0+}
mtb:scale:uphill="1/2" {set mtb:scale:uphill=1+}
mtb:scale:uphill="2/3" {set mtb:scale:uphill=2+}
mtb:scale:uphill="3/4" {set mtb:scale:uphill=3+}
mtb:scale:uphill="4/5" {set mtb:scale:uphill=4+}

mtb:scale:uphill="0;1" {set mtb:scale:uphill=0+}
mtb:scale:uphill="1;2" {set mtb:scale:uphill=1+}
mtb:scale:uphill="2;3" {set mtb:scale:uphill=2+}
mtb:scale:uphill="3;4" {set mtb:scale:uphill=3+}
mtb:scale:uphill="4;5" {set mtb:scale:uphill=4+}



# make tracktype easier to read.
tracktype=grade0 {set tracktype=0}
tracktype=grade1 {set tracktype=1}
tracktype=grade2 {set tracktype=2}
tracktype=grade3 {set tracktype=3}
tracktype=grade4 {set tracktype=4}
tracktype=grade5 {set tracktype=5}
tracktype=grade6 {set tracktype=6}

tracktype="grade0;grade1" {set tracktype=0}
tracktype="grade1;grade2" {set tracktype=1}
tracktype="grade2;grade3" {set tracktype=2}
tracktype="grade3;grade4" {set tracktype=3}
tracktype="grade4;grade5" {set tracktype=4}
tracktype="grade5;grade6" {set tracktype=6}

tracktype="grade1;grade0" {set tracktype=0}
tracktype="grade2;grade1" {set tracktype=1}
tracktype="grade3;grade2" {set tracktype=2}
tracktype="grade4;grade3" {set tracktype=3}
tracktype="grade5;grade4" {set tracktype=4}
tracktype="grade6;grade5" {set tracktype=6}

tracktype=* & tracktype!=0 & tracktype!=1 & tracktype!=2 & tracktype!=3 & tracktype!=4 & tracktype!=5 & tracktype!=6 {delete tracktype}

highway=* & (usability=1 | usability=2) & mtb:scale:uphill!=* & mtb:scale!=*  {add tracktype=1}
highway=* & usability=3 				& mtb:scale:uphill!=* & mtb:scale!=*  {add taxi=no; add tracktype=2}
highway=* & usability=4 				& mtb:scale:uphill!=* & mtb:scale!=*  {add taxi=no; add tracktype=3; add mkgmap:unpaved=1}
highway=* & usability=5 				& mtb:scale:uphill!=* & mtb:scale!=*  {add taxi=no; add tracktype=4; add mkgmap:unpaved=1}
highway=* & usability=6 				& mtb:scale:uphill!=* & mtb:scale!=*  {add taxi=no;  set tracktype=5; add mkgmap:unpaved=1}

highway=* & trail_visibility=intermediate 	& mtb:scale!=* & mtb:scale:uphill!=* {add taxi=no; add tracktype=3; add mkgmap:unpaved=1}
highway=* & trail_visibility=bad 			& mtb:scale!=* & mtb:scale:uphill!=* {add taxi=no; add tracktype=4; add mkgmap:unpaved=1}
highway=* & trail_visibility=no 			& mtb:scale!=* & mtb:scale:uphill!=* {add taxi=no; add mkgmap:unpaved=1}
highway=* & trail_visibility=horrible 		& mtb:scale!=* & mtb:scale:uphill!=* {add taxi=no; add mkgmap:unpaved=1}
highway=* & trail_visibility=no 			& mtb:scale!=* & mtb:scale:uphill!=* & sac_scale!=* {add tracktype=5}
highway=* & trail_visibility=horrible 		& mtb:scale!=* & mtb:scale:uphill!=* & sac_scale!=* {add tracktype=5}


sac:scale=*  {add sac_scale = '${sac:scale}'}
sac_scale=T1 {set sac_scale=hiking}
sac_scale=T2 {set sac_scale=mountain_hiking}
sac_scale=T3 {set sac_scale=demandin_mountain_hiking}
sac_scale=T4 {set sac_scale=alpine_hiking}
sac_scale=T5 {set sac_scale=demanding_alpine_hiking}
sac_scale=T6 {set sac_scale=difficult_alpine_hiking}

sac_scale=* & sac_scale!=hiking & sac_scale!=mountain_hiking & sac_scale!=demanding_mountain_hiking & sac_scale!=alpine_hiking & sac_scale!=demanding_alpine_hiking & sac_scale!=difficult_alpine_hiking {delete sac_scale}

smoothnes=* {add smoothness = '${smoothnes}'}
smothness=* {add smoothness = '${smothness}'}

smoothness=excelent {set smoothness=excellent}
smoothness=medium {set smoothness=intermediate}
smoothness=* & smoothness!=excellent & smoothness!=very_good & smoothness!=good & smoothness!=intermediate & smoothness!=bad & smoothness!=very_bad & smoothness!=horrible & smoothness!=very_horrible & smoothness!=impassable {delete smoothness}




# Make steep pathes downhill only
mtb:scale=0 & incline>20 & mtb:scale:uphill!=1 & mtb:scale:uphill!=2 & mtb:scale:uphill!=3 {set oneway=-1; set copy=98; set copy1=yes}
mtb:scale=1 & incline>15 & mtb:scale:uphill!=1 & mtb:scale:uphill!=2 {set oneway=-1; set copy=98; set copy1=yes}
mtb:scale=2 & incline>10 & mtb:scale:uphill!=1 & mtb:scale:uphill!=2 {set oneway=-1; set copy=98; set copy1=yes}
mtb:scale=3 & incline>10 & mtb:scale:uphill!=1 & mtb:scale:uphill!=2 {set oneway=-1; set copy=98; set copy1=yes} 
mtb:scale=4 & incline>10 & mtb:scale:uphill!=1 & mtb:scale:uphill!=2 {set oneway=-1; set copy=98; set copy1=yes}
mtb:scale=5 & incline>10 & mtb:scale:uphill!=1 & mtb:scale:uphill!=2 {set oneway=-1; set copy=98; set copy1=yes}

mtb:scale=0 & incline<-20 & mtb:scale:uphill!=1 & mtb:scale:uphill!=2 & mtb:scale:uphill!=3	{set oneway=yes; set copy=99; set copy1=yes}
mtb:scale=1 & incline<-15 & mtb:scale:uphill!=1 & mtb:scale:uphill!=2 {set oneway=yes; set copy=99; set copy1=yes}
mtb:scale=2 & incline<-10 & mtb:scale:uphill!=1 & mtb:scale:uphill!=2 {set oneway=yes; set copy=99; set copy1=yes}
mtb:scale=3 & incline<-10 & mtb:scale:uphill!=1 & mtb:scale:uphill!=2 {set oneway=yes; set copy=99; set copy1=yes} 
mtb:scale=4 & incline<-10 & mtb:scale:uphill!=1 & mtb:scale:uphill!=2 {set oneway=yes; set copy=99; set copy1=yes}
mtb:scale=5 & incline<-10 & mtb:scale:uphill!=1 & mtb:scale:uphill!=2 {set oneway=yes; set copy=99; set copy1=yes}



( mtb:scale:uphill=2 | mtb:scale:uphill=3 ) & ( incline=negative | incline=down | incline=- | incline<0 ) 	{add taxi=no; set copy=99; set copy1=yes; add mkgmap:unpaved=1}
( mtb:scale:uphill=2 | mtb:scale:uphill=3 ) & ( incline=positive | incline=up | incline=+ | incline>0 ) 	{add taxi=no; set copy=98; set copy1=yes; add mkgmap:unpaved=1}
( mtb:scale:uphill=4 | mtb:scale:uphill=5 ) & ( incline=negative | incline=down | incline=- | incline<0 ) 	{add taxi=no; set oneway=yes; set copy=99; set copy1=yes; add mkgmap:unpaved=1}
( mtb:scale:uphill=4 | mtb:scale:uphill=5 ) & ( incline=positive | incline=up | incline=+ | incline>0 ) 	{add taxi=no; set oneway=-1; set copy=98; set copy1=yes; add mkgmap:unpaved=1}




# Map smoothness to tracktype
smoothness=intermediate {set tracktype=1}
smoothness=bad {set tracktype=2}
smoothness=very_bad {set tracktype=3}
smoothness=horrible {set tracktype=4}


# Set unpaved, toll and taxi=no for tracktype and sac_scale and smoothness
smoothness=excellent | smoothness=very_good | smoothness=good | smoothness=intermediate {set tracktype=1}
smoothness=bad {set taxi=no}
highway=* & tracktype=2 {set taxi=no}
highway=* & (tracktype=3 | tracktype=4 | tracktype=5 | tracktype=6 | (sac_scale=* & sac_scale!=hiking)) {set taxi=no | add mkgmap:unpaved=1}
highway=* & mtb:scale!=* & tracktype!=1 & tracktype!=2 & tracktype!=3 & tracktype!=4 & (sac_scale=mountain_hiking | sac_scale=demanding_mountain_hiking | sac_scale=difficult_mountain_hiking | sac_scale=alpine_hiking | sac_scale=demanding_alpine_hiking | sac_scale=difficult_alpine_hiking ) {set toll=yes} 





# Map surface to tracktype -- currently only used for openmtbmap
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=compacted {add tracktypeadded=yes}
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=dirt {add tracktypeadded=yes}
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=mud {add tracktypeadded=yes}
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=sand {add tracktypeadded=yes}
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=earth {add tracktypeadded=yes}
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=ground {add tracktypeadded=yes}
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=grass {add tracktypeadded=yes}
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=pebblestone {add tracktypeadded=yes}
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=grass_paver {add tracktypeadded=yes}
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=paving_stones {add tracktypeadded=yes}
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=paved {add tracktypeadded=yes}
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface="dirt road" {add tracktypeadded=yes}
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=dirt_road {add tracktypeadded=yes}
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=compacted {add tracktypeadded=yes}
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=unsealed {add tracktypeadded=yes}
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=unsurfaced {add tracktypeadded=yes}
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=ash {add tracktypeadded=yes}
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=unpaved {add tracktypeadded=yes}
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=sidewalk {add tracktypeadded=yes}
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=cobblestone {add tracktypeadded=yes}
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=bricks {add tracktypeadded=yes}
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=block {add tracktypeadded=yes}
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=wood {add tracktypeadded=yes}
# mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=stone {add tracktypeadded=yes}

tracktype!=* & surface=asphalt {add tracktype=1}
tracktype!=* & surface=concrete {add tracktype=1}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=compacted {add tracktype=2}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=dirt {add tracktype=3}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=mud {add tracktype=3}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=sand {add tracktype=4}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=earth {add tracktype=3}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=ground {add tracktype=3}
tracktype!=* & surface=schotter {add tracktype=2}
tracktype!=* & surface=gravel {add tracktype=2}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=grass {add tracktype=4}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=grit {add tracktype=2}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=pebblestone {add tracktype=3}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=grass_paver {add tracktype=2}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=paving_stones {add tracktype=1}
mtb:scale!=* & tracktype!=* & sac_scale!=* & surface=paved {add tracktype=1}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface="dirt road" {add tracktype=2}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=dirt_road {add tracktype=2}
tracktype!=* & surface=fine_gravel {add tracktype=2}
tracktype!=* & surface="fine gravel" {add tracktype=2}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=compacted {add tracktype=2}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=concrete_plates {set tracktype=1}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=unsealed {add tracktype=2}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=unsurfaced {add tracktype=2}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=ash {add tracktype=3}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=unpaved {delete surface}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=sidewalk {add tracktype=1}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=cobblestone {add tracktype=2}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=bricks {add tracktype=2}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=block {add tracktype=2}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=wood {add tracktype=2}
mtb:scale!=* & sac_scale!=* & tracktype!=* & surface=stone {add tracktype=2}


# Delete sac_scale entered by noobs
sac_scale=hiking & tracktype<2 {delete sac_scale}

sac_scale=mountain_hiking & tracktypeadded!=yes & tracktype<3 	{delete sac_scale}
sac_scale=mountain_hiking & mtb:scale<1  						{delete sac_scale; set tracktypeadded=reversed}

sac_scale=demanding_mountain_hiking & tracktypeadded!=yes & tracktype<4 {delete sac_scale}
sac_scale=demanding_mountain_hiking & mtb:scale<2 						{delete sac_scale; set tracktypeadded=reversed}

( sac:scale=alpine_hiking | sac_scale=demanding_alpine_hiking | sac_scale=difficult_alpine_hiking ) & tracktypeadded!=yes & tracktype<5 	{delete sac_scale}
( sac:scale=alpine_hiking ) 																		& tracktype<3 							{delete sac_scale; set tracktypeadded=reversed}
( sac:scale=alpine_hiking | sac_scale=demanding_alpine_hiking | sac_scale=difficult_alpine_hiking ) & ( mtb:scale<3 | mtb:scale:uphill<4) 	{delete sac_scale; set tracktypeadded=reversed}


# Delete some mtb:scale values if not needed and reclassify others.
( mtb:scale=0 | mtb:scale="0-" ) & ( tracktype=1 | smoothness=excellent | smoothness=very_good | smoothness=good | smoothness=intermediate | surface=asphalt | surface=concrete ) {delete mtb:scale}
mtb:scale=0 & ( tracktype=2 | tracktype=3 |  smoothness=bad ) {delete mtb:scale}
mtb:scale=0 & ( tracktype=5 | smoothness=very_horrible | smoothness=impassable ){set mtb:scale=1}





# mtb:scale unification

mtb:scale="0+" {set mtb:scale=1}
mtb:scale="1+" {set mtb:scale=2}
mtb:scale="2+" {set mtb:scale=2}
mtb:scale="3+" {set mtb:scale=3}
mtb:scale="4+" {set mtb:scale=4}
mtb:scale="5+" {set mtb:scale=5}

mtb:scale="0-" {delete mtb:scale; add taxi=no}
mtb:scale="1-" {set mtb:scale=1}
mtb:scale="2-" {set mtb:scale=2}
mtb:scale="3-" {set mtb:scale=3}
mtb:scale="4-" {set mtb:scale=4}
mtb:scale="5-" {set mtb:scale=5}

mtb:scale:uphill="0+" {set mtb:scale:uphill=0}
mtb:scale:uphill="1+" {set mtb:scale:uphill=1}
mtb:scale:uphill="2+" {set mtb:scale:uphill=2}
mtb:scale:uphill="3+" {set mtb:scale:uphill=3}
mtb:scale:uphill="4+" {set mtb:scale:uphill=4}
mtb:scale:uphill="5+" {set mtb:scale:uphill=5}

mtb:scale:uphill="0-" {set mtb:scale:uphill=0}
mtb:scale:uphill="1-" {set mtb:scale:uphill=1}
mtb:scale:uphill="2-" {set mtb:scale:uphill=2}
mtb:scale:uphill="3-" {set mtb:scale:uphill=3}
mtb:scale:uphill="4-" {set mtb:scale:uphill=4}
mtb:scale:uphill="5-" {set mtb:scale:uphill=5}

mtb:scale=* & mtb:scale!=0 & mtb:scale!=1 & mtb:scale!=2 & mtb:scale!=3 & mtb:scale!=4 & mtb:scale!=5 {delete mtb:scale}

# Add mtb:scale(:uphill) to name

mtb:scale=* & mtb:scale:uphill=*  & (route=mtb | extremecarver6=mr){set name='MR${mtb:scale}${mtb:scale:uphill} ${name}' | 'MR${mtb:scale}${mtb:scale:uphill} '}
mtb:scale=* & mtb:scale:uphill!=* & (route=mtb | extremecarver6=mr){set name='MR${mtb:scale}. ${name}' | 'MR${mtb:scale}.'}
(route=mtb | extremecarver6=mr) & mtb:scale!=* & mtb:scale:uphill=* {set name='MRx${mtb:scale:uphill} ${name}' |'MRx${mtb:scale:uphill}'}

mtb:scale=* & mtb:scale:uphill=* & route!=mtb & extremecarver6!=mr {set name='M${mtb:scale}${mtb:scale:uphill} ${name}' | 'M${mtb:scale}${mtb:scale:uphill} '}
mtb:scale=* & mtb:scale:uphill!=* & route!=mtb & extremecarver6!=mr {set name='M${mtb:scale}. ${name}' | 'M${mtb:scale}.'}
mtb:scale!=* & mtb:scale:uphill=* & route!=mtb & extremecarver6!=mr {set name='Mx${mtb:scale:uphill} ${name}' |'Mx${mtb:scale:uphill}'}



# Put already mtb:sclae=0 into the map -- so that street condition naming works better.... --- this whole section seems to be placed wrong here and only belongs to the openmtbmap.
mtb:scale=0 & mtb:scale:uphill!=0 & ( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) {add taxi=no}
mtb:scale=0 & highway!=path & highway!=footway & highway!=bridleway & highway!=cycleway & highway!=track & highway!=unsurfaced & highway!=road & highway!=byway & highway!=unclassified & highway!=service & highway!=minor & mtb:scale:uphill!=0 {add taxi=no} 
mtb:scale=0	& mtb:scale:uphill!=0 & (highway=path | highway=footway | highway=bridleway | highway=cycleway)	{add taxi=no; add mkgmap:unpaved=1}
mtb:scale=0 & (highway=path | highway=footway | highway=bridleway) {set mkgmap:unpaved=1}




# Add street condition to name
( highway=path | highway=footway | highway=bridleway | highway=track | highway=unsurfaced | highway=road ) & tracktype=1 & ( tracktypeadded!=yes | surface=asphalt | surface=paving_stones ) {set name='${name} G1' | 'G1'; set addendumname=yes} 

( highway=path | highway=footway | highway=cycleway | highway=bridleway | highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & tracktype=2 & tracktypeadded!=yes {set name='${name} G2' | 'G2'; set addendumname=yes}

( highway=path | highway=footway | highway=cycleway | highway=bridleway | highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & tracktype=3 & tracktypeadded!=yes {set name='${name} G3' | 'G3'; set addendumname=yes}

( highway=path | highway=footway | highway=cycleway | highway=bridleway | highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & (mtb:scale!=* | mtb:scale>3) & sac_scale=demanding_mountain_hiking & addendumname!=* {set name='${name} T3' | 'T3'; set addendumname=yes}

( highway=path | highway=footway | highway=cycleway | highway=bridleway | highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & (mtb:scale!=* | mtb:scale>3) & sac_scale=alpine_hiking & addendumname!=* {set name='${name} T4' | 'T4'; set addendumname=yes}

( highway=path | highway=footway | highway=cycleway | highway=bridleway | highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & sac_scale=demanding_alpine_hiking & addendumname!=* {set name='${name} T5' | 'T5'; set addendumname=yes}

( highway=path | highway=footway | highway=cycleway | highway=bridleway | highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & sac_scale=difficult_alpine_hiking & addendumname!=* {set name='${name} T6' | 'T6'; set addendumname=yes}

( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & mtb:scale!=* & ( tracktype!=1 | tracktype!=2 | tracktype!=3 | tracktypeadded=yes ) & sac_scale=hiking {set name='${name} T1' | 'T1'; set addendumname=yes}

( highway=path | highway=footway | highway=cycleway | highway=bridleway  ) & (mtb:scale!=* | mtb:scale>3) & ( tracktype!=1 | tracktype!=2 | tracktypeadded=yes ) & sac_scale=hiking {set name='${name} T1' | 'T1'; set addendumname=yes}

( highway=path | highway=footway | highway=cycleway | highway=bridleway | highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & mtb:scale!=* & addendumname!=* & tracktype=4 {set name='${name} G4' | 'G4'; set addendumname=yes}

( highway=path | highway=footway | highway=cycleway | highway=bridleway | highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & mtb:scale!=* & tracktype!=1 & tracktype!=2 & sac_scale=mountain_hiking {set name='${name} T2' | 'T2'; set addendumname=yes}

( highway=path | highway=footway | highway=cycleway | highway=bridleway | highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & mtb:scale!=* & tracktype=5 & addendumname!=* {set name='${name} G5' | 'G5'}

( highway=path | highway=footway | highway=cycleway | highway=bridleway | highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & mtb:scale!=* & tracktype=6 & addendumname!=* {set name='${name} G6' | 'G6'}



# Add kind of way to name
highway=unclassified & fixme!=* {set name='${name}'|'ucl'}
highway=road {set name='${name} rd'|'rd'}
highway=service {set name='${name} ser'|'ser'}
highway=byway {set name='${name} byw'|'byw'}
highway=track & fixme!=* {set name='${name} trk'|'trk'}
highway=unsurfaced {set name='${name} usf'|'usf'}
highway=path {set name='${name} pth'|'pth'}
highway=bridleway {set name='${name} bd'|'bd'}
highway=cycleway {set name='${name} CW'|'CW'}
highway=footway {set name='${name} ft'|'ft'}
highway=pedestrian {set name='${name}'|'pdstrn'}
highway=parking_aisle {set name='${name}'|'parking_aisle'}
highway=construction {set name='${name}'|'cstrn'}

# Add Route Name
highway=* & route_name1=* 			{set name='${name} ${route_name1}'| '${route_name1}'}




# Flag unpaved roads.
highway=* & (surface=compacted | surface=dirt |
   surface=earth | surface=grass | surface=grass_paver |
   surface=gravel | surface=grit | surface=ground | surface=mud |
   surface=pebblestone | surface=sand | surface=unpaved | surface=grass |
   tracktype ~ 'grade[2-6]' | tracktype>1 |
   smoothness ~ '.*(bad|horrible|impassable)' |
   sac_scale ~ '.*(mountain|alpine)_hiking' |
   usability>3 |
   mtb:scale>0 |
   sport=via_ferrata)
{ set mkgmap:unpaved=1 }

# Flag access rights:
highway=* & (
   smoothness ~ '.*(horrible|impassable)' |
	sac_scale ~ '.*(alpine)_hiking' |
	sac_scale ~ '.*(demanding)_hiking' |
	sac_scale ~ '.*(difficult)_hiking' |
	usability>5 |
	via_ferrata_scale>0 |
	mtb:scale>1 |
	sport=via_ferrata)
{ set access=no; set foot=yes; set importantaccess=yes }

( extremecarver6=icn | (route=bicycle & network=icn))	& ( highway=primary | highway=secondary | highway=tertiary ) {add icn=yes; set bicycleroute=done}	[0x10419 resolution 20 continue with_actions]
( extremecarver6=ncn | (route=bicycle & network=ncn))	& ( highway=primary | highway=secondary | highway=tertiary ) {add ncn=yes; set bicycleroute=done}	[0x10419 resolution 20 continue with_actions]
( extremecarver6=rcn | (route=bicycle & network=rcn))  	& ( highway=primary | highway=secondary | highway=tertiary ) {add rcn=yes; set bicycleroute=done}	[0x10011 resolution 20 continue with_actions]
( extremecarver6=tcn | (route=bicycle & network=tcn)) 	& ( highway=primary | highway=secondary | highway=tertiary ) {add tcn=yes; set bicycleroute=done}	[0x10011 resolution 20 continue with_actions]
( extremecarver6=lcn | (route=bicycle & network=lcn))	& ( highway=primary | highway=secondary | highway=tertiary ) {add lcn=yes; set bicycleroute=done}	[0x10608 resolution 20 continue with_actions]
( extremecarver6=xcn | (route=bicycle & network=xcn))	& ( highway=primary | highway=secondary | highway=tertiary ) {add xcn=yes; set bicycleroute=done}	[0x10608 resolution 20 continue with_actions]

( extremecarver6=icn | (route=bicycle & network=icn)) & network!=mtb	& bicycleroute!=done	 {add icn=yes; set bicycleroute=done} [0x10419 resolution 21 continue with_actions]
( extremecarver6=ncn | (route=bicycle & network=ncn)) & network!=mtb	& bicycleroute!=done	 {add ncn=yes; set bicycleroute=done} [0x10419 resolution 21 continue with_actions]
( extremecarver6=rcn | (route=bicycle & network=rcn)) & network!=mtb  	& bicycleroute!=done	 {add rcn=yes; set bicycleroute=done} [0x10011 resolution 21 continue with_actions]
( extremecarver6=tcn | (route=bicycle & network=tcn)) & network!=mtb 	& bicycleroute!=done	 {add tcn=yes; set bicycleroute=done} [0x10011 resolution 21 continue with_actions]
( extremecarver6=lcn | (route=bicycle & network=lcn)) & network!=mtb	& bicycleroute!=done	 {add lcn=yes; set bicycleroute=done} [0x10608 resolution 21 continue with_actions]
( extremecarver6=xcn | (route=bicycle & network=xcn)) & network!=mtb	& bicycleroute!=done	 {add xcn=yes; set bicycleroute=done} [0x10608 resolution 21 continue with_actions]

route=icn & network!=* & extremecarver6!=* & bicycleroute!=done & ( highway=primary | highway=secondary | highway=tertiary ) {add icn=yes; set route=bicycle; set bicycleroute=done} [0x10419 resolution 20 continue with_actions]
route=ncn & network!=* & extremecarver6!=* & bicycleroute!=done & ( highway=primary | highway=secondary | highway=tertiary ) {add ncn=yes; set route=bicycle; set bicycleroute=done} [0x10419 resolution 20 continue with_actions]
route=tcn & network!=* & extremecarver6!=* & bicycleroute!=done & ( highway=primary | highway=secondary | highway=tertiary ) {add rcn=yes; set route=bicycle; set bicycleroute=done} [0x10011 resolution 20 continue with_actions]
route=rcn & network!=* & extremecarver6!=* & bicycleroute!=done & ( highway=primary | highway=secondary | highway=tertiary ) {add rcn=yes; set route=bicycle; set bicycleroute=done} [0x10011 resolution 20 continue with_actions]
route=lcn & network!=* & extremecarver6!=* & bicycleroute!=done & ( highway=primary | highway=secondary | highway=tertiary ) {add lcn=yes; set route=bicycle; set bicycleroute=done} [0x10608 resolution 20 continue with_actions]

route=icn & network!=* & extremecarver6!=* & bicycleroute!=done {add icn=yes; set route=bicycle; set bicycleroute=done}	[0x10419 resolution 20 continue with_actions]
route=ncn & network!=* & extremecarver6!=* & bicycleroute!=done {add ncn=yes; set route=bicycle; set bicycleroute=done}	[0x10419 resolution 20 continue with_actions]
route=tcn & network!=* & extremecarver6!=* & bicycleroute!=done {add rcn=yes; set route=bicycle; set bicycleroute=done}	[0x10011 resolution 20 continue with_actions]
route=rcn & network!=* & extremecarver6!=* & bicycleroute!=done {add rcn=yes; set route=bicycle; set bicycleroute=done}	[0x10011 resolution 20 continue with_actions]
route=lcn & network!=* & extremecarver6!=* & bicycleroute!=done {add lcn=yes; set route=bicycle; set bicycleroute=done} [0x10608 resolution 20 continue with_actions]

( highway=icn_major | highway=icn_minor | highway=icn_offroad | icn=yes | icn_ref=* | bicycle=icn ) & bicycleroute!=done  & ( highway=primary | highway=secondary | highway=tertiary ) {set route=bicycle; add icn=yes; set bicycleroute=done}	[0x10419 resolution 20 continue with_actions]
( highway=ncn_major | highway=ncn_minor | highway=ncn_offroad | ncn=yes | ncn_ref=* | bicycle=ncn ) & bicycleroute!=done  & ( highway=primary | highway=secondary | highway=tertiary ) {set route=bicycle; add ncn=yes; set bicycleroute=done}	[0x10419 resolution 20 continue with_actions] 
( highway=tcn_major | highway=tcn_minor | highway=tcn_offroad | tcn=yes | tcn_ref=* | bicycle=tcn ) & bicycleroute!=done  & ( highway=primary | highway=secondary | highway=tertiary ) {set route=bicycle; add rcn=yes; set bicycleroute=done} 	[0x10011 resolution 20 continue with_actions]
( highway=rcn_major | highway=rcn_minor | highway=rcn_offroad | rcn=yes | rcn_ref=* | bicycle=rcn ) & bicycleroute!=done  & ( highway=primary | highway=secondary | highway=tertiary ) {set route=bicycle; add rcn=yes; set bicycleroute=done}	[0x10011 resolution 20 continue with_actions]
( highway=lcn_major | highway=lcn_minor | highway=lcn_offroad | lcn=yes | lcn_ref=* | bicycle=lcn ) & bicycleroute!=done  & ( highway=primary | highway=secondary | highway=tertiary ) {set route=bicycle; add lcn=yes; set bicycleroute=done}	[0x10608 resolution 20 continue with_actions]


( highway=icn_major | highway=icn_minor | highway=icn_offroad | icn=yes | icn_ref=* | bicycle=icn ) & bicycleroute!=done  {set route=bicycle; add icn=yes} 						  [0x10506 resolution 20-20 continue]
( highway=ncn_major | highway=ncn_minor | highway=ncn_offroad | ncn=yes | ncn_ref=* | bicycle=ncn ) & bicycleroute!=done  {set route=bicycle; add ncn=yes} 						  [0x10506 resolution 20-20 continue]
( highway=tcn_major | highway=tcn_minor | highway=tcn_offroad | tcn=yes | tcn_ref=* | bicycle=tcn ) & bicycleroute!=done  {set route=bicycle; add rcn=yes} 						  [0x10507 resolution 20-20 continue]
( highway=icn_major | highway=icn_minor | highway=icn_offroad | icn=yes | icn_ref=* | bicycle=icn ) & bicycleroute!=done  {set route=bicycle; add icn=yes; set bicycleroute=done} [0x10419 resolution 21 continue with_actions]
( highway=ncn_major | highway=ncn_minor | highway=ncn_offroad | ncn=yes | ncn_ref=* | bicycle=ncn ) & bicycleroute!=done  {set route=bicycle; add ncn=yes; set bicycleroute=done} [0x10419 resolution 21 continue with_actions] 
( highway=tcn_major | highway=tcn_minor | highway=tcn_offroad | tcn=yes | tcn_ref=* | bicycle=tcn ) & bicycleroute!=done  {set route=bicycle; add rcn=yes; set bicycleroute=done} [0x10011 resolution 21 continue with_actions]
( highway=rcn_major | highway=rcn_minor | highway=rcn_offroad | rcn=yes | rcn_ref=* | bicycle=rcn ) & bicycleroute!=done  {set route=bicycle; add rcn=yes; set bicycleroute=done} [0x10011 resolution 21 continue with_actions]
( highway=lcn_major | highway=lcn_minor | highway=lcn_offroad | lcn=yes | lcn_ref=* | bicycle=lcn ) & bicycleroute!=done  {set route=bicycle; add lcn=yes; set bicycleroute=done} [0x10608 resolution 21 continue with_actions]

( cycleroute=yes | route=bicycle ) & bicycleroute!=done  & ( highway=primary | highway=secondary | highway=tertiary ) 	{set route=bicycle; add lcn=yes; set bicycleroute=done} [0x10608 resolution 20 continue with_actions]
( cycleroute=yes | route=bicycle ) & bicycleroute!=done 																{set route=bicycle; add lcn=yes} [0x10507 resolution 20-20 continue]
( cycleroute=yes | route=bicycle ) & bicycleroute!=done 																{set route=bicycle; add lcn=yes; set bicycleroute=done} [0x10608 resolution 21 continue with_actions]




(bicycle=no | bicycle=nope) & ( highway=primary | highway=secondary ) 																						[0x1051f resolution 23-22 continue]
(bicycle=no | bicycle=nope) & ( highway=primary | highway=secondary ) {add taxi=no; add mkgmap:unpaved=1; set nonope=yes} 									[0x10400 resolution 24 continue with_actions]
(bicycle=no | bicycle=nope) & highway=tertiary 																												[0x1051f resolution 23-22 continue]
(bicycle=no | bicycle=nope) & highway=tertiary {add taxi=no; add mkgmap:unpaved=1; set nonope=yes} 															[0x1040c resolution 24 continue with_actions]
(bicycle=no | bicycle=nope) & ( highway=unclassified )  {add taxi=no; add mkgmap:unpaved=1; set nonope=yes} 								[0x10a09 resolution 22 continue with_actions]
(bicycle=no | bicycle=nope) & highway!=path & highway!=footway & highway!=bridleway & highway!=cycleway & nonope!=yes {add taxi=no; add mkgmap:unpaved=1} 	[0x1040e resolution 23 continue with_actions]

(bicycle=no | bicycle=nope) & highway=path 															{add taxi=no; add mkgmap:unpaved=1}	[0x1040e resolution 23 continue with_actions]
(bicycle=no | bicycle=nope) & highway=footway  						 								{add taxi=no; add mkgmap:unpaved=1}	[0x1040e resolution 23 continue with_actions]
(bicycle=no | bicycle=nope) & highway=bridleway  													{add taxi=no; add mkgmap:unpaved=1}	[0x1040e resolution 23 continue with_actions]
(bicycle=no | bicycle=nope) & highway=cycleway & ( foot=yes | foot=permissive | foot=designated ) 	{add taxi=no; add mkgmap:unpaved=1}	[0x10a09 resolution 23 continue with_actions]


# maybe need to better classify the backward/forward stuff. Explication on wiki is confusing.
bicycle:backward=yes | bicycle:forward=yes {set bicycle:oneway=no}



# Need ref inside Name from here onwards 
highway=* & ref=* & name=* {set name='${name} (${ref})'}
highway=* & ref=* & name!=* {set name='(${ref})'}
# highway=* & ref=* {set namecopy='${name} (${ref})'}
# highway=* & ref=* & (extremecarver=mr | route=mtb)				{name '${ref|highway-symbol:hbox:7:5} ${name}' | '${ref|highway-symbol:hbox:7:5}' | '${name}'; set display_name='${namecopy}'; set shieldpresent=yes}
# highway=* & ref=* & route=bicycle & shieldpresent!=yes	{name '${ref|highway-symbol:box:7:5} ${name}'  | '${ref|highway-symbol:box:7:5}'  | '${name}'; set display_name='${namecopy}'; set shieldpresent=yes}
# highway=* & ref=* & shieldpresent!=yes							{name '${ref|highway-symbol:oval:7:5} ${name}' | '${ref|highway-symbol:oval:7:5}' | '${name}'; set display_name='${namecopy}'}
# highway=* & ref=* {set name='${namecopy}'}
# End refname section



# Create oneway arrows (routable)
cycleway:oneway=no {set bicycle:oneway=no}
bicycle:oneway=no & (cycleway=opposite | cycleway=opposite_lane | cycleway=both | cycleway=opposite_track) {delete bicycle:oneway}
highway=primary &  oneway=yes 				& copy!=* {set copy=copied} [0x1051c resolution 24 continue with_actions]
highway=primary &  oneway=-1 				& copy!=* {set copy=copied} [0x1051d resolution 24 continue with_actions]

oneway=yes 		& bicycle:oneway=no & copy!=* {set oneway=no; set copy=copied} [0x30a road_class=0 road_speed=0 resolution 24 continue]
oneway=-1 		& bicycle:oneway=no & copy!=* {set oneway=no; set copy=copied} [0x30b road_class=0 road_speed=0 resolution 24 continue]
oneway=yes 		& bicycle:oneway=no & copy!=* {set copy=copied} 
oneway=-1 		& bicycle:oneway=no & copy!=* {set copy=copied} 

highway=residential &  ( oneway=yes | oneway=-1)  & cycleway!=opposite_lane & cycleway!=opposite & copy!=* {set oneway=no; set taxi=no; set mkgmap:unpaved=1} [0x01 road_class=0 road_speed=0 resolution 24 continue]
highway=residential &  oneway=yes & cycleway!=opposite_lane & cycleway!=opposite	& copy!=* {set copy=copied} [0x10401 resolution 24 continue with_actions]
highway=residential &  oneway=-1 		 & cycleway!=opposite_lane & cycleway!=opposite	& copy!=* {set copy=copied} [0x10402 resolution 24 continue with_actions]

oneway=yes 	& highway!=path & highway!=footway & highway!=track & highway!=primary & highway!=secondary & highway!=tertiary & highway!=unclassified & highway!=living_street & highway!=residential & highway!=service & highway!=cycleway	& ( cycleway=opposite | cycleway=opposite_lane | cycleway=opposite_track | cycleway=both ) & copy!=* {set copy=copied} [0x10a02 resolution 24 continue with_actions]
oneway=-1	& highway!=path & highway!=footway & highway!=track & highway!=primary & highway!=secondary & highway!=tertiary & highway!=unclassified & highway!=living_street & highway!=residential & highway!=service & highway!=cycleway & ( cycleway=opposite | cycleway=opposite_lane | cycleway=opposite_track | cycleway=both ) & copy!=* {set copy=copied} [0x10a03 resolution 24 continue with_actions]

oneway=yes 	&  highway=secondary  & copy!=* {set copy=copied} [0x10719 resolution 24 continue with_actions]
oneway=-1	&  highway=secondary  & copy!=* {set copy=copied} [0x1071c resolution 24 continue with_actions]

oneway=yes 	& highway=tertiary  & copy!=* {set copy=copied} [0x10a02 resolution 24 continue with_actions]
oneway=-1	& highway=tertiary  & copy!=* {set copy=copied} [0x10a03 resolution 24 continue with_actions]

oneway=yes 	& ( highway=unclassified ) & cycleway!=opposite & cycleway!=opposite_lane & copy!=* {set copy=copied} [0x11 resolution 24 continue with_actions]
oneway=-1	& ( highway=unclassified ) & copy!=* & cycleway!=opposite & cycleway!=opposite_lane {set copy=copied} [0x10718 resolution 24 continue with_actions]

oneway=yes  & copy!=* & highway!=primary & highway!=secondary & highway!=tertiary & highway!=minor & highway!=unclassified & bicycle:oneway!=no & motorroad!=yes & highway!=trunk & highway!=motorway & highway!=motorway_link & highway!=trunk_link & highway!=construction & construction!=* & highway!=proposed & ( proposed!=* | proposed=no ) & cycleway!=opposite_lane & cycleway!=opposite & cycleway!=opposite_track & cycleway!=both {set oneway=no; set taxi=no; set mkgmap:unpaved=1} [0x11 road_class=0 road_speed=0 resolution 24 continue]
oneway=-1 	& copy!=* & highway!=primary & highway!=secondary & highway!=tertiary & highway!=minor & highway!=unclassified & bicycle:oneway!=no & motorroad!=yes & highway!=trunk & highway!=motorway & highway!=motorway_link & highway!=trunk_link & highway!=construction & construction!=* & highway!=proposed & ( proposed!=* | proposed=no ) & cycleway!=opposite_lane & cycleway!=opposite & cycleway!=opposite_track & cycleway!=both {set oneway=no; set taxi=no; set mkgmap:unpaved=1} [0x01 road_class=0 road_speed=0 resolution 24 continue]
oneway=-1 	& copy!=* & highway!=primary & highway!=secondary & highway!=tertiary & highway!=minor & highway!=unclassified & bicycle:oneway!=no & motorroad!=yes & highway!=trunk & highway!=motorway & highway!=motorway_link & highway!=trunk_link & highway!=construction & construction!=* & highway!=proposed & ( proposed!=* | proposed=no ) & cycleway!=opposite_lane & cycleway!=opposite & cycleway!=opposite_track & cycleway!=both {set oneway=no; set taxi=no; set mkgmap:unpaved=1} [0x10403 resolution 24 continue]

# oneway=yes 		& copy!=* & highway!=primary & highway!=secondary & highway!=tertiary & highway!=minor & highway!=unclassified & bicycle:oneway!=no & motorroad!=yes & highway!=trunk & highway!=motorway & highway!=motorway_link & highway!=trunk_link & highway!=construction & construction!=* & highway!=proposed & ( proposed!=* | proposed=no ) & ( cycleway=opposite_track |cycleway=opposite_lane | cycleway=opposite | cycleway=both )  {set oneway=no} [0x01 road_class=0 road_speed=1 resolution 24 continue]
# oneway=-1		& copy!=* & highway!=primary & highway!=secondary & highway!=tertiary & highway!=minor & highway!=unclassified & bicycle:oneway!=no & motorroad!=yes & highway!=trunk & highway!=motorway & highway!=motorway_link & highway!=trunk_link & highway!=construction & construction!=* & highway!=proposed & ( proposed!=* | proposed=no ) & ( cycleway=opposite_track |cycleway=opposite_lane | cycleway=opposite | cycleway=both ) {set oneway=no} [0x01 road_class=0 road_speed=1 resolution 24 continue]




# (cycleway=lane_right | cycleway:right=lane ) 	& ( route=bicycle | extremecarver=mr | route=mtb ) & highway!=cycleway & highway!=path & highway!=track		[0x10f1f resolution 23-22 continue]
# (cycleway=lane_left | cycleway:left=lane ) 		& ( route=bicycle | extremecarver=mr | route=mtb ) & highway!=cycleway & highway!=path & highway!=track	[0x10f1e resolution 23-22 continue]
# (cycleway=track_right | cycleway:right=track ) 	& ( route=bicycle | extremecarver=mr | route=mtb ) & highway!=cycleway & highway!=path & highway!=track	[0x10f19 resolution 23-22 continue]
# (cycleway=track_left | cycleway:left=track ) 	& ( route=bicycle | extremecarver=mr | route=mtb ) & highway!=cycleway & highway!=path & highway!=track		[0x10f18 resolution 23-22 continue]

(cycleway=lane_right | cycleway:right=lane ) 	& highway=secondary		& highway!=cycleway & highway!=path & highway!=track {set cyclewaysidecopy=yes} [0x10411 resolution 24 continue with_actions]
(cycleway=lane_left | cycleway:left=lane ) 		& highway=secondary		& highway!=cycleway & highway!=path & highway!=track {set cyclewaysidecopy=yes}	[0x10410 resolution 24 continue with_actions]
(cycleway=track_right | cycleway:right=track ) 	& highway=secondary		& highway!=cycleway & highway!=path & highway!=track {set cyclewaysidecopy=yes}	[0x10413 resolution 24 continue with_actions]
(cycleway=track_left | cycleway:left=track ) 	& highway=secondary		& highway!=cycleway & highway!=path & highway!=track {set cyclewaysidecopy=yes}	[0x10412 resolution 24 continue with_actions]

(cycleway=lane_right | cycleway:right=lane ) 	& highway=primary		& highway!=cycleway & highway!=path & highway!=track {set cyclewaysidecopy=yes}	[0x10415 resolution 24 continue with_actions]
(cycleway=lane_left | cycleway:left=lane ) 		& highway=primary		& highway!=cycleway & highway!=path & highway!=track {set cyclewaysidecopy=yes}	[0x10414 resolution 24 continue with_actions]
(cycleway=track_right | cycleway:right=track ) 	& highway=primary		& highway!=cycleway & highway!=path & highway!=track {set cyclewaysidecopy=yes}	[0x10417 resolution 24 continue with_actions]
(cycleway=track_left | cycleway:left=track ) 	& highway=primary		& highway!=cycleway & highway!=path & highway!=track {set cyclewaysidecopy=yes}	[0x10416 resolution 24 continue with_actions]

(cycleway=lane_right | cycleway:right=lane ) 	& ( highway=tertiary | higwhay=living_street | highway=footway )	& highway!=cycleway & highway!=path & highway!=track {set cyclewaysidecopy=yes} [0x10f1e resolution 24 continue with_actions]
(cycleway=lane_left | cycleway:left=lane ) 		& ( highway=tertiary | higwhay=living_street | highway=footway )	& highway!=cycleway & highway!=path & highway!=track {set cyclewaysidecopy=yes} [0x10f1f resolution 24 continue with_actions]
(cycleway=track_right | cycleway:right=track ) 	& ( highway=tertiary | higwhay=living_street | highway=footway )	& highway!=cycleway & highway!=path & highway!=track {set cyclewaysidecopy=yes} [0x10f18 resolution 24 continue with_actions]
(cycleway=track_left | cycleway:left=track ) 	& ( highway=tertiary | higwhay=living_street | highway=footway )	& highway!=cycleway & highway!=path & highway!=track {set cyclewaysidecopy=yes} [0x10f19 resolution 24 continue with_actions]

(cycleway=lane_right | cycleway:right=lane ) 	& oneway=*				& cyclewaysidecopy!=yes & highway!=cycleway & highway!=path & highway!=track [0x10f1e resolution 24 continue]
(cycleway=lane_left | cycleway:left=lane ) 		& oneway=*				& cyclewaysidecopy!=yes & highway!=cycleway & highway!=path & highway!=track [0x10f1f resolution 24 continue]
(cycleway=track_right | cycleway:right=track ) 	& oneway=*				& cyclewaysidecopy!=yes & highway!=cycleway & highway!=path & highway!=track [0x10f18 resolution 24 continue]
(cycleway=track_left | cycleway:left=track ) 	& oneway=*				& cyclewaysidecopy!=yes & highway!=cycleway & highway!=path & highway!=track [0x10f19 resolution 24 continue]

( cycleway=lane | cycleway=yes ) & oneway=yes & bicycle:oneway!=no & highway=primary 	[0x10415 resolution 24 continue]
( cycleway=lane | cycleway=yes ) & oneway=-1  & bicycle:oneway!=no & highway=primary 	[0x10414 resolution 24 continue]
cycleway=track & oneway=yes & bicycle:oneway!=no & highway=primary 						[0x10417 resolution 24 continue]
cycleway=track & oneway=-1 & bicycle:oneway!=no  & highway=primary 						[0x10416 resolution 24 continue]

( cycleway=lane | cycleway=yes ) & oneway=yes & bicycle:oneway!=no & highway=secondary 	[0x10411 resolution 24 continue]
( cycleway=lane | cycleway=yes ) & oneway=-1  & bicycle:oneway!=no & highway=secondary 	[0x10410 resolution 24 continue]
cycleway=track & oneway=yes & bicycle:oneway!=no & highway=secondary 					[0x10413 resolution 24 continue]
cycleway=track & oneway=-1 & bicycle:oneway!=no  & highway=secondary 					[0x10412 resolution 24 continue]

( cycleway=lane | cycleway=yes ) & oneway=yes & bicycle:oneway!=no & highway=* & highway!=primary & highway!=secondary & highway!=cycleway & highway!=path & highway!=track [0x10f1e resolution 24 continue]
( cycleway=lane | cycleway=yes ) & oneway=-1  & bicycle:oneway!=no & highway=* & highway!=primary & highway!=secondary & highway!=cycleway & highway!=path & highway!=track [0x10f1f resolution 24 continue]
cycleway=track & oneway=yes & bicycle:oneway!=no & highway=* & highway!=primary & highway!=secondary & highway!=cycleway & highway!=path & highway!=track 					[0x10f18 resolution 24 continue]
cycleway=track & oneway=-1 & bicycle:oneway!=no  & highway=* & highway!=primary & highway!=secondary & highway!=cycleway & highway!=path & highway!=track 					[0x10f19 resolution 24 continue]



cycleway=lane	& oneway!=*											&  highway=primary	[0x10403 resolution 24 continue]
cycleway=track	& oneway!=*											&  highway=primary	[0x10404 resolution 24 continue]

cycleway=opposite & ( extremecarver=mr | route=mtb ) & oneway=*	&  highway=primary {set oneway=no}	[0x01 road_class=1 road_speed=0 resolution 24 continue]
cycleway=opposite			& oneway=*							&  highway=primary {set oneway=no}	[0x01 road_class=0 road_speed=0 resolution 24 continue]
cycleway=opposite			& oneway=*							&  highway=primary {set oneway=no}	[0x10702 resolution 24 continue]
cycleway=opposite			& oneway!=*							&  highway=primary {set oneway=no}	[0x10702 resolution 24 continue]

cycleway=opposite_lane & ( extremecarver=mr | route=mtb ) & oneway=*	&  highway=primary {set oneway=no}	[0x01 road_class=1 road_speed=0 resolution 24 continue]
cycleway=opposite_lane		& oneway=*							&  highway=primary {set oneway=no}	[0x01 road_class=0 road_speed=0 resolution 24 continue]
cycleway=opposite_lane		& oneway=*							&  highway=primary {set oneway=no}	[0x10703 resolution 24 continue]
cycleway=opposite_lane		& oneway!=*							&  highway=primary {set oneway=no}	[0x10703 resolution 24 continue]

cycleway=opposite_track & ( extremecarver=mr | route=mtb ) & oneway=*	&  highway=primary {set oneway=no}	[0x01 road_class=1 road_speed=0 resolution 24 continue]
cycleway=opposite_track		& oneway=*						&  highway=primary {set oneway=no}	[0x01 road_class=0 road_speed=0 resolution 24 continue]
cycleway=opposite_track		& oneway=*						&  highway=primary {set oneway=no}	[0x10704 resolution 24 continue]
cycleway=opposite_track		& oneway!=*						&  highway=primary {set oneway=no}	[0x10704 resolution 24 continue]

cycleway=yes							& oneway!=*						&  highway=primary					[0x10404 resolution 24 continue]
cycleway=both							& oneway=*						&  highway=primary {set oneway=no}	[0x01 road_class=0 road_speed=0 resolution 24 continue]
cycleway=both															&  highway=primary 					[0x10404 resolution 24 continue]




cycleway=lane						& oneway!=*						&  highway=secondary	[0x1040c resolution 24 continue]
cycleway=track						& oneway!=*						&  highway=secondary	[0x10605 resolution 24 continue]

cycleway=opposite & ( extremecarver=mr | route=mtb) & oneway=*		&  highway=secondary {set oneway=no}	[0x01 road_class=1 road_speed=1 resolution 24 continue]
cycleway=opposite									& oneway=*		&  highway=secondary {set oneway=no}	[0x303 road_class=0 road_speed=0 resolution 24 continue]
cycleway=opposite									& oneway!=*		&  highway=secondary {set oneway=no}	[0x10609 resolution 24 continue]

cycleway=opposite_lane & ( extremecarver=mr | route=mtb ) & oneway=* &  highway=secondary {set oneway=no}	[0x01 road_class=1 road_speed=1 resolution 24 continue]
cycleway=opposite_lane									& oneway=*	&  highway=secondary {set oneway=no}	[0x303 road_class=0 road_speed=1 resolution 24 continue]
cycleway=opposite_lane									& oneway!=*	&  highway=secondary {set oneway=no}	[0x10609 resolution 24 continue]

cycleway=opposite_track & (extremecarver=mr | route=mtb) & oneway=* &  highway=secondary {set oneway=no}	[0x01 road_class=1 road_speed=1 resolution 24 continue]
cycleway=opposite_track									 & oneway=*	&  highway=secondary {set oneway=no}	[0x304 road_class=1 road_speed=0 resolution 24 continue]
cycleway=opposite_track									& oneway!=*	&  highway=secondary {set oneway=no}	[0x1040b resolution 24 continue]

cycleway=yes	& oneway!=*											&  highway=secondary	[0x10605 road_class=1 road_speed=0 resolution 24 continue]

cycleway=both & ( extremecarver=mr | route=mtb ) 		& oneway=*	&  highway=secondary {set oneway=no}	[0x01 road_class=1 road_speed=0 resolution 24 continue]
cycleway=both											& oneway=*	&  highway=secondary {set oneway=no}	[0x30e road_class=0 road_speed=0 resolution 24 continue]
cycleway=both											& oneway!=*	&  highway=secondary {set oneway=no}	[0x10605 resolution 24 continue]


cycleway=lane				& oneway!=*									&  highway=tertiary	[0x10606 resolution 24 continue]
cycleway=track				& oneway!=*								 	&  highway=tertiary	[0x10408 resolution 24 continue]

cycleway=opposite & ( extremecarver=mr | route=mtb ) & oneway=*			&  highway=tertiary {set oneway=no}	[0x01 road_class=1 road_speed=1 resolution 24 continue]
cycleway=opposite	& oneway=*											&  highway=tertiary {set oneway=no}	[0x304 road_class=0 road_speed=1 resolution 24 continue]
cycleway=opposite	& oneway!=*											&  highway=tertiary {set oneway=no}	[0x1040b resolution 24 continue]

cycleway=opposite_lane & ( extremecarver=mr | route=mtb ) 	& oneway=*	&  highway=tertiary {set oneway=no}	[0x01 road_class=1 road_speed=1 resolution 24 continue]
cycleway=opposite_lane & oneway=*							 			&  highway=tertiary {set oneway=no}	[0x304 road_class=0 road_speed=1 resolution 24 continue]
cycleway=opposite_lane & oneway!=*							 			&  highway=tertiary {set oneway=no}	[0x1040b resolution 24 continue]

cycleway=opposite_track & ( extremecarver=mr | route=mtb )	& oneway=*	&  highway=tertiary {set oneway=no}	[0x01 road_class=1 road_speed=1 resolution 24 continue]
cycleway=opposite_track										& oneway=*	&  highway=tertiary {set oneway=no}	[0x306 road_class=0 road_speed=1 resolution 24 continue]
cycleway=opposite_track										& oneway!=*	&  highway=tertiary {set oneway=no}	[0x1040d resolution 24 continue]

cycleway=yes		& oneway!=*											&  highway=tertiary	[0x10408 resolution 24 continue]
cycleway=both & ( extremecarver=mr | route=mtb ) & oneway=*				&  highway=tertiary {set oneway=no}	[0x01 road_class=1 road_speed=0 resolution 24 continue]
cycleway=both		& oneway=*											&  highway=tertiary {set oneway=no}	[0x310 road_class=0 road_speed=1 resolution 24 continue]
cycleway=both		& oneway!=*											&  highway=tertiary {set oneway=no}	[0x10408 resolution 24 continue]

cycleway=both		& oneway=*											&  highway=unclassified {set oneway=no}	[0x01 road_class=0 road_speed=1 resolution 24 continue]
cycleway=both		& oneway=*											&  highway=unclassified {set oneway=no}	[0x1040f road_class=0 road_speed=1 resolution 24 continue]

# cycleway=lane		& oneway=*											&  ( highway=residential | highway=service )	[0x1071b resolution 24 continue]
# cycleway=track	& oneway=*								 			&  ( highway=residential | highway=service )	[0x1071a resolution 24 continue]

cycleway=opposite & ( extremecarver=mr | route=mtb ) & oneway=*	&  (highway=residential | highway=service) {set oneway=no}	[0x01 road_class=1 road_speed=1 resolution 24 continue]
cycleway=opposite & oneway=yes 		&  (highway=residential | highway=service) {set oneway=no}	[0x307 road_class=0 road_speed=1 resolution 24 continue]
cycleway=opposite & oneway=-1		&  (highway=residential | highway=service) {set oneway=no}	[0x308 road_class=0 road_speed=1 resolution 24 continue]

cycleway=opposite_lane & ( extremecarver=mr | route=mtb ) & oneway=*	&  ( highway=residential | highway=service ) {set oneway=no}	[0x01 road_class=1 road_speed=1 resolution 24 continue]
cycleway=opposite_lane & oneway=yes 					&  ( highway=residential | highway=service ) {set oneway=no}	[0x307 road_class=0 road_speed=1 resolution 24 continue]
cycleway=opposite_lane & oneway=-1						&  ( highway=residential | highway=service ) {set oneway=no}	[0x308 road_class=0 road_speed=1 resolution 24 continue]

cycleway=opposite_track & (extremecarver=mr | route=mtb)	& oneway=*	&  (highway=residential | highway=service) {set oneway=no}	[0x01 road_class=1 road_speed=1 resolution 24 continue]
cycleway=opposite_track	& oneway=*			&  ( highway=residential | highway=service ) {set oneway=no}	[0x309 road_class=0 road_speed=1 resolution 24 continue]

cycleway=both & ( extremecarver=mr | route=mtb ) & oneway=*	&  (highway=residential | highway=service) {set oneway=no}	[0x01 road_class=1 road_speed=1 resolution 24 continue]
cycleway=both									 & oneway=*	&  (highway=residential | highway=service) {set oneway=no}	[0x30d road_class=0 road_speed=1 resolution 24 continue]

cycleway=track & highway=unclassified	& oneway!=*						 										[0x10705 resolution 24 continue]
# cycleway=lane & highway=unclassified	& oneway!=*						 										[0x10706 resolution 24 continue]




cycleway=opposite & ( extremecarver=mr | route=mtb ) & oneway=*	& highway!=residential & highway!=service & highway!=primary & highway!=secondary & highway!=tertiary	{set oneway=no}	[0x01 road_class=1 road_speed=1 resolution 24 continue]
cycleway=opposite & oneway=yes & highway!=primary & highway!=secondary & highway!=tertiary & highway!=unclassifed & highway!=residential & highway!=service & copy!=* {set oneway=no}	[0x30a road_class=0 road_speed=1 resolution 24 continue]
cycleway=opposite & oneway=-1  & highway!=primary & highway!=secondary & highway!=tertiary & highway!=unclassifed & highway!=residential & highway!=service & copy!=* {set oneway=no}	[0x30b road_class=0 road_speed=1 resolution 24 continue]

cycleway=opposite_lane & oneway=* & ( extremecarver=mr | route=mtb ) 		& highway!=residential & highway!=service & highway!=primary & highway!=secondary & highway!=tertiary & copy!=*	{set oneway=no}	[0x01 road_class=1 road_speed=1 resolution 24 continue]
cycleway=opposite_lane & oneway=yes & highway!=primary & highway!=secondary & highway!=tertiary & highway!=unclassifed & highway!=residential & highway!=service & copy!=* {set oneway=no}	[0x30a road_class=0 road_speed=1 resolution 24 continue]
cycleway=opposite_lane & oneway=-1  & highway!=primary & highway!=secondary & highway!=tertiary & highway!=unclassifed & highway!=residential & highway!=service & copy!=* {set oneway=no}	[0x30b road_class=0 road_speed=1 resolution 24 continue]

cycleway=opposite_track & oneway=* & ( extremecarver=mr | route=mtb ) & highway!=residential & highway!=service & highway!=primary & highway!=secondary & highway!=tertiary & copy!=*	{set oneway=no} [0x01 road_class=1 road_speed=1 resolution 24 continue]
cycleway=opposite_track & oneway=yes & highway!=primary & highway!=secondary & highway!=tertiary & highway!=residential & highway!=unclassifed & copy!=* {set oneway=no}	[0x30a road_class=0 road_speed=1 resolution 24 continue]
cycleway=opposite_track & oneway=-1  & highway!=primary & highway!=secondary & highway!=tertiary & highway!=residential & highway!=unclassifed & copy!=* {set oneway=no}	[0x30b road_class=0 road_speed=1 resolution 24 continue]

# cycleway=yes & oneway=* & highway!=cycleway & highway!=path & highway!=footway & highway!=primary & highway!=secondary & highway!=tertiary & highway!=residential & highway!=service & highway!=cycleway & copy!=*  	[0x10f1c resolution 24 continue]

cycleway=both & oneway=yes & highway!=primary & highway!=secondary & highway!=tertiary & highway!=residential & highway!=service & highway!=unclassifed & copy!=* {set oneway=no}	[0x30a road_class=0 road_speed=1 resolution 24 continue]
cycleway=both & oneway=-1  & highway!=primary & highway!=secondary & highway!=tertiary & highway!=residential & highway!=service & highway!=unclassifed & copy!=* {set oneway=no}	[0x30b road_class=0 road_speed=1 resolution 24 continue]







#############################  Create a new system for integrating class:bicycle  #############################

### Unify notation for mkgmap
class:bicycle="+3" {set class:bicycle=3}
class:bicycle="+2" {set class:bicycle=2}
class:bicycle="+1" {set class:bicycle=1}
class:bicycle:roadcycling="+3" {set class:bicycle:roadcycling=3}
class:bicycle:roadcycling="+2" {set class:bicycle:roadcycling=2}
class:bicycle:roadcycling="+1" {set class:bicycle:roadcycling=1}
class:bicycle:commute="+3" {set class:bicycle:commute=3}
class:bicycle:commute="+2" {set class:bicycle:commute=2}
class:bicycle:commute="+1" {set class:bicycle:commute=1}
class:bicycle:touring="+3" {set class:bicycle:touring=3}
class:bicycle:touring="+2" {set class:bicycle:touring=2}
class:bicycle:touring="+1" {set class:bicycle:touring=1}



### Join all class:bicycle subkeys and old keys to create a single key for fewer rules needed ###
class:bicycle:roadcycling=-3 | class:bicycle:roadcycling=-2 {set toll=yes}

class:bicycle:touring=3 {set class:bicycle=3}
class:bicycle:touring=2 {set class:bicycle=2}
class:bicycle:touring=-2 {set class:bicycle=-2}
class:bicycle:touring=-3 {set class:bicycle=-3}

class:bicycle:commute=3 {add class:bicycle=2}
class:bicycle:commute=2 | class:bicycle:commute=1 {add class:bicycle=1}
class:bicycle:commute=-3 {add class:bicycle=-3}
class:bicycle:commute=-2 {add class:bicycle=-2}

class:bicycle:touring=1 {add class:bicycle=1}
class:bicycle:touring=0 {add class:bicycle=0}
class:bicycle:touring=-1 {add class:bicycle=-1}
class:bicycle:commute=-1 {add class:bicycle=-1}

class:bicycle:roadcycling=-3 {add class:bicycle=-2}
class:bicycle:roadcycling=-2 {add class:bicycle=-1}
class:bicycle:roadcycling=-1 {add class:bicycle=-1}
class:bicycle:roadcycling=1 {add class:bicycle=1}
class:bicycle:roadcycling=2 {add class:bicycle=1}
class:bicycle:roadcycling=3 {add class:bicycle=2}

class:bicycle:mtb:technical=3 | class:bicycle:mtb:technical=2 | class:bicycle:mtb:technical=1 { set toll=yes; add mkgmap:unpaved=1 }

cycleworth=* {add class:bicycle='${cycleworth}'}
rtc_rate=A {add class:bicycle=2}
rtc_rate=B {add class:bicycle=1}
# rtc_rate=C {add class:bicycle=0}
rtc_rate=D {add class:bicycle=-1}
rtc_rate=E {add class:bicycle=-1}
rtc_rate=F {add class:bicycle=-2}
rtc_rate=XX {add class:bicycle=-3}



class:bicycle=3  & oneway=yes & lanes>1 & ( highway=primary | highway=secondary | highway=tertiary | highway=unclassified ) {set class:bicycle=1; set adjusted=down}
class:bicycle=2  & oneway=yes & lanes>1 & ( highway=primary | highway=secondary | highway=tertiary | highway=unclassified ) {set class:bicycle=1; set adjusted=down}
class:bicycle=1  & oneway=yes & lanes>1 & ( highway=primary | highway=secondary | highway=tertiary | highway=unclassified ) {set class:bicycle=0; set adjusted=down}
class:bicycle=0  & oneway=yes & lanes>1 & ( highway=primary | highway=secondary | highway=tertiary | highway=unclassified ) {set class:bicycle=-2; set adjusted=down}
class:bicycle=-1 & oneway=yes & lanes>1 & ( highway=primary | highway=secondary | highway=tertiary | highway=unclassified ) {set class:bicycle=-2; set adjusted=down}
class:bicycle=-2 & oneway=yes & lanes>1 & ( highway=primary | highway=secondary | highway=tertiary | highway=unclassified ) {set class:bicycle=-3; set adjusted=down}
class:bicycle=-3 & oneway=yes & lanes>1 & ( highway=primary | highway=secondary | highway=tertiary | highway=unclassified ) {set class:bicycle=-3; set adjusted=down}

class:bicycle=3  & source:maxspeed ~ '.*local' & ( highway=primary | highway=secondary | highway=tertiary | highway=unclassified | highway=residential )	& adjusted!=down {set class:bicycle=2; set adjusted=down}
class:bicycle=2  & source:maxspeed ~ '.*local' & ( highway=primary | highway=secondary | highway=tertiary | highway=unclassified | highway=residential )	& adjusted!=down {set class:bicycle=1; set adjusted=down}
class:bicycle=1  & source:maxspeed ~ '.*local' & ( highway=primary | highway=secondary | highway=tertiary | highway=unclassified | highway=residential )	& adjusted!=down {set class:bicycle=0; set adjusted=down}
class:bicycle=0  & source:maxspeed ~ '.*local' & ( highway=primary | highway=secondary | highway=tertiary | highway=unclassified | highway=residential )	& adjusted!=down {set class:bicycle=-1; set adjusted=down}
class:bicycle=-1 & source:maxspeed ~ '.*local' & ( highway=primary | highway=secondary | highway=tertiary | highway=unclassified | highway=residential )	& adjusted!=down {set class:bicycle=-2; set adjusted=down}
class:bicycle=-2 & source:maxspeed ~ '.*local' & ( highway=primary | highway=secondary | highway=tertiary | highway=unclassified | highway=residential )	& adjusted!=down {set class:bicycle=-3; set adjusted=down}
class:bicycle=-3 & source:maxspeed ~ '.*local' & ( highway=primary | highway=secondary | highway=tertiary | highway=unclassified | highway=residential )	& adjusted!=down {set class:bicycle=-3; set adjusted=down}

# class:bicycle=3  & ( source:maxspeed ~ '.*urban' | maxspeed>60 ) 	{set class:bicycle=3; set adjusted=up}
class:bicycle=2  & ( source:maxspeed ~ '.*urban' | maxspeed>60 )  	& adjusted!=down {set class:bicycle=3; set adjusted=up}
class:bicycle=1  & ( source:maxspeed ~ '.*urban' | maxspeed>60 )  	& adjusted!=down {set class:bicycle=2; set adjusted=up}
class:bicycle=0  & ( source:maxspeed ~ '.*urban' | maxspeed>60 )  	& adjusted!=down {set class:bicycle=1; set adjusted=up}
class:bicycle=-1 & ( source:maxspeed ~ '.*urban' | maxspeed>60 )  	& adjusted!=down {set class:bicycle=0; set adjusted=up}
class:bicycle=-2 & ( source:maxspeed ~ '.*urban' | maxspeed>60 )  	& adjusted!=down {set class:bicycle=-1; set adjusted=up}
# class:bicycle=-3 & ( source:maxspeed ~ '.*urban' | maxspeed>60 )  	& adjusted!=down {set class:bicycle=-3; set adjusted=up}


( class:bicycle:commute=-1 | class:bicycle:touring=-1 | class:bicycle=-1) & cycleway=track & class:bicycle>-2 { set class:bicycle=-2 }
( class:bicycle:commute=-2 | class:bicycle:touring=-2 | class:bicycle=-2) & cycleway=track & class:bicycle>-1 { set class:bicycle=-3 }
( class:bicycle:commute=-3 | class:bicycle:touring=-3 ) & cycleway=track 					 				  { set class:bicycle=-3 }

( class:bicycle:commute=3 | class:bicycle:touring=3 ) & cycleway=lane 										{ set class:bicycle=3 }
( class:bicycle:commute=2 | class:bicycle:touring=2 ) & cycleway=lane & adjusted!=down & class:bicycle<2 	{ set class:bicycle=2 }
( class:bicycle:commute=1 | class:bicycle:touring=1 ) & cycleway=lane & adjusted!=down & class:bicycle<1	{ set class:bicycle=1 }

class:bicycle=3 & tracktype=extremecarver {set class:bicycle=-1}
class:bicycle=2 & tracktype=extremecarver {set class:bicycle=-1}
class:bicycle=1 & tracktype=extremecarver {set class:bicycle=-1}
class:bicycle=0 & tracktype=extremecarver {set class:bicycle=-2}
class:bicycle=-1 & tracktype=extremecarver {set class:bicycle=-3}
class:bicycle=-2 & tracktype=extremecarver {set class:bicycle=-3}
 
class:bicycle=3 & tracktype=5 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=0}
class:bicycle=2 & tracktype=5 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=0}
class:bicycle=1 & tracktype=5 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=-1}
class:bicycle=0 & tracktype=5 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=-2}
class:bicycle=-1 & tracktype=5 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=-2}
class:bicycle=-2 & tracktype=5 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=-3}

class:bicycle=3 & tracktype=4 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=1}
class:bicycle=2 & tracktype=4 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=0}
class:bicycle=1 & tracktype=4 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=0}
class:bicycle=0 & tracktype=4 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=-1}
class:bicycle=-1 & tracktype=4 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=-2}
class:bicycle=-2 & tracktype=4 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=-3}

class:bicycle=3 & tracktype=3 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=2}
class:bicycle=2 & tracktype=3 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=1}
class:bicycle=1 & tracktype=3 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=0}
class:bicycle=0 & tracktype=3 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=-1}
class:bicycle=-1 & tracktype=3 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=-2}
class:bicycle=-2 & tracktype=3 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=-3}

class:bicycle=3 & tracktype=2 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=2}
class:bicycle=2 & tracktype=2 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=1}
class:bicycle=1 & tracktype=2 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=0}
class:bicycle=0 & tracktype=2 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=-1}
class:bicycle=-1 & tracktype=2 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=-2}
class:bicycle=-2 & tracktype=2 & highway!=service & highway!=track & highway!=byway & highway!=road & highway!=unsurfaced & highway!=minor & highway!=unclassified {set class:bicycle=-2}


	
# Main Section - Streets
junction=roundabout & ( highway=motorway_link | highway=motorway ) 				{set roundaboutdone=yes}	[0x10511 resolution 23-22 continue with_actions]
junction=roundabout & ( highway=motorway_link | highway=motorway ) 											[0x10512 resolution 24 continue]
junction=roundabout & ( highway=motorway_link | highway=motorway ) 											[0x10510 resolution 21-21 continue]
junction=roundabout & ( highway=trunk | highway=trunk_link | motorroad=yes ) 	{set roundaboutdone=yes}	[0x10418 resolution 23-22 continue with_actions]
junction=roundabout & ( highway=trunk | highway=trunk_link | motorroad=yes ) 								[0x10418 resolution 21-21 continue]
junction=roundabout & ( highway=trunk | highway=trunk_link | motorroad=yes ) 								[0x10f00 resolution 24 continue]
junction=roundabout & highway=primary 											{set roundaboutdone=yes}	[0x02 resolution 24 continue with_actions]
junction=roundabout & highway=primary 																		[0x10516 resolution 23-21 continue]
junction=roundabout & highway=primary 																		[0x1050d resolution 20-20 continue]
junction=roundabout & highway=secondary 										{set roundaboutdone=yes}	[0x04 resolution 24 continue with_actions]
junction=roundabout & highway=secondary 																	[0x1050e resolution 23-21 continue]
# junction=roundabout & highway=secondary 																	[0x1051e resolution 20-20 continue]
junction=roundabout & highway=tertiary 											{set roundaboutdone=yes}	[0x05 resolution 24 continue with_actions]
junction=roundabout & highway=tertiary 											{set roundaboutdone=yes}	[0x1050f resolution 23-21 continue]
junction=roundabout & highway=unclassified 										{set roundaboutdone=yes}	[0x11009 resolution 21 continue with_actions]
junction=roundabout & roundaboutdone!=yes 																	[0x11009 resolution 22 continue with_actions]

junction=roundabout & ( extremecarver=mr | route=mtb  | route=bicycle ) & ( highway=primary | highway=secondary ) [0x0c road_class=2 road_speed=1 resolution 24 continue]
junction=roundabout & ( extremecarver=mr | route=mtb  | route=bicycle ) 											[0x0c road_class=1 road_speed=0 resolution 24 continue]
junction=roundabout & ( highway=primary | highway=secondary | highway=tertiary | highway=unclassified )									[0x0c road_class=1 road_speed=1 resolution 24]
junction=roundabout 																													[0x0c road_class=1 road_speed=0 resolution 24]



################## Route Preference ##############################


class:bicycle=3 & route!=bicycle & highway!=steps [0x01 road_class=4 road_speed=2 continue]
class:bicycle=2 & route!=bicycle & highway!=steps [0x01 road_class=4 road_speed=2 continue]
class:bicycle=3 & route!=bicycle & highway!=steps [0x01 road_class=2 road_speed=0 continue]
class:bicycle=2 & route!=bicycle & highway!=steps [0x01 road_class=2 road_speed=0 continue]
class:bicycle=1 & route!=bicycle & highway!=steps [0x01 road_class=3 road_speed=1 continue]



(class:bicycle=-1 | class:bicycle=-2 | class:bicycle=-3) {set class:bicycle:bad=yes}

( icn=yes | ncn=yes ) & route=bicycle 						  {set toll=yes} 	[0x01 road_class=2 road_speed=0 resolution 24 continue]
( icn=yes | ncn=yes ) & route=bicycle 						  {set toll=yes} 	[0x01 road_class=3 road_speed=2 resolution 24 continue]
( icn=yes | ncn=yes ) & route=bicycle & class:bicycle:bad!=yes  {set toll=yes} 	[0x01 road_class=4 road_speed=3 resolution 24 continue]
( rcn=yes ) & route=bicycle & class:bicycle:bad!=yes {set toll=yes} 				[0x01 road_class=3 road_speed=1 resolution 24 continue]
( rcn=yes ) & route=bicycle & class:bicycle:bad!=yes {set toll=yes} 				[0x01 road_class=4 road_speed=2 resolution 24 continue]

( highway=cycleway | highway=residential | highway=unclassified | highway=tertiary ) & (route=mtb | extremecarver6=mr) & class:bicycle:bad!=yes & route!=bicycle {set toll=yes} [0x01 road_class=4 road_speed=2 resolution 24 continue]
( highway=cycleway | highway=residential | highway=unclassified | highway=tertiary ) & (route=mtb | extremecarver6=mr) & class:bicycle:bad!=yes & route!=bicycle {set toll=yes} [0x01 road_class=3 road_speed=1 resolution 24 continue]


( highway=cycleway | highway=track | highway=residential | highway=unclassified | highway=path | highway=byway | highway=service | highway=tertiary ) & class:bicycle:bad!=yes & icn!=yes & ncn!=yes & rcn!=yes & route=bicycle   [0x01 road_class=4 road_speed=2 resolution 24 continue]
( highway=cycleway | highway=track | highway=path | highway=byway | highway=service | highway=secondary ) & icn!=yes & ncn!=yes & rcn!=yes & class:bicycle:bad!=yes & ( route=bicycle	)  [0x01 road_class=3 road_speed=1 resolution 24 continue]


( highway=footway ) & class:bicycle!=* & ( route=bicycle	) & icn!=yes & ncn!=yes & rcn!=yes {set toll=yes} [0x01 road_class=3 road_speed=2 resolution 24 continue]

# route=bicycle	& class:bicycle!=* 										[0x01 road_class=2 road_speed=0 resolution 24 continue]
# route=bicycle & class:bicycle!=* & highway!=primary 					[0x01 road_class=4 road_speed=2 resolution 24 continue]








##################### Main Section #################################

highway=pedestrian & ( extremecarver=mr | route=mtb ) 	& bridge=yes  										[0x01 road_class=3 road_speed=2 resolution 24 continue]
highway=pedestrian & route=bicycle	& bridge=yes  								[0x01 road_class=3 road_speed=2 resolution 24 continue]
highway=pedestrian & ( bicycle=yes | bicycle=permissive | bicycle=designated )	& bridge=yes  				[0x01 road_class=3 road_speed=1 resolution 24 continue]

highway=pedestrian & ( extremecarver=mr | route=mtb ) 	& bridge=yes  										[0x11000 resolution 21]
highway=pedestrian & route=bicycle	& bridge=yes  								[0x11000 resolution 21]
highway=pedestrian & ( bicycle=yes | bicycle=permissive | bicycle=designated )	& bridge=yes  				[0x11000 resolution 22]

highway=pedestrian & (bicycle=no | bicycle=nope)							& bridge=yes  {add taxi=no}						[0x01 road_class=0 road_speed=1 resolution 24 continue]
highway=pedestrian & (bicycle=no | bicycle=nope)							& bridge=yes  									[0x11000 resolution 24]
highway=footway & ( extremecarver=mr | route=mtb  | route=bicycle ) & bridge=yes  	[0x03 road_class=3 road_speed=2 resolution 21]

highway=pedestrian 										& bridge=yes  {add taxi=no}							[0x01 road_class=2 road_speed=1 resolution 24 continue]
highway=pedestrian 										& bridge=yes  {add taxi=no}							[0x11000 resolution 22]

highway=pedestrian & ( route=bicycle | extremecarver=mr | route=mtb )  [0x11000 resolution 21-21 continue]
highway=pedestrian 																[0x11000 resolution 22 continue]
highway=pedestrian & class:bicycle=3 											[0x01 road_class=2 road_speed=2 resolution 24]
highway=pedestrian & class:bicycle=2 											[0x01 road_class=2 road_speed=2 resolution 24]
highway=pedestrian & class:bicycle=1 											[0x01 road_class=1 road_speed=1 resolution 24]
highway=pedestrian & ( extremecarver=mr | route=mtb ) 							[0x01 road_class=2 road_speed=1 resolution 24]
highway=pedestrian & route=bicycle  					[0x01 road_class=1 road_speed=1 resolution 24]
highway=pedestrian & ( bicycle=yes | bicycle=permissive | bicycle=designated )	[0x01 road_class=1 road_speed=1 resolution 24]
highway=pedestrian & (bicycle=no | bicycle=nope)	{add taxi=no; add mkgmap:unpaved=1}			[0x01 road_class=0 road_speed=0 resolution 24]
highway=pedestrian 	{add taxi=no; add mkgmap:unpaved=1}							[0x01 road_class=0 road_speed=1 resolution 24]



# highway=motorway & ref=* {set namecopy='${ref} ${name}'}
# highway=motorway & ref=* {set name='${ref} ${name}'}
# highway=motorway & int_ref=*	[0x10013 resolution 15-15 continue]
# highway=motorway 				[0x10013 resolution 17-16 continue]
# highway=motorway & ref=* {name '${ref|highway-symbol:box:7:5} ${name}' | '${ref|highway-symbol:box:7:5}' | '${name}'; add display_name='${namecopy}'; set shieldpresent=yes}
# highway=motorway 								[0x10013 resolution 20-18 continue]
highway=motorway & (tunnel!=* & tunnel!=no | tunnel=no )		[0x10013 resolution 21-21 continue]
highway=motorway & (tunnel!=* & tunnel!=no | tunnel=no )		[0x10509 resolution 23-22 continue]
highway=motorway & (tunnel!=* & tunnel!=no | tunnel=no )		[0x1050a resolution 24]
highway=motorway_link | highway=motorway_junction [0x10510 resolution 21-21 continue]
highway=motorway_link | highway=motorway_junction [0x10511 resolution 23-22 continue]
highway=motorway_link | highway=motorway_junction [0x10512 resolution 24]

# highway=trunk & int_ref=* 		[0x1050c resolution 17-16 continue]
# highway=trunk & ref=* {set namecopy='${ref} ${name}'}
# highway=trunk & ref=* {set name='${ref} ${name}'}
# highway=trunk & ref=* {name '${ref|highway-symbol:box:7:5} ${name}' | '${ref|highway-symbol:box:7:5}' | '${name}'; add display_name='${namecopy}'; set shieldpresent=yes}
highway=trunk		& bicycle=yes & motorroad!=yes {set delivery=no}	[0x01 road_class=0 road_speed=0 resolution 24 continue]
highway=trunk_link 	& bicycle=yes & motorroad!=yes {set delivery=no}	[0x01 road_class=0 road_speed=0 resolution 24 continue]
# highway=trunk 								[0x1050c resolution 20-18 continue]
highway=trunk & (tunnel!=* & tunnel!=no | tunnel=no )	[0x1050c resolution 21-21 continue]
highway=trunk & (tunnel!=* & tunnel!=no | tunnel=no )	[0x10418 resolution 23-22 continue]
highway=trunk & (tunnel!=* & tunnel!=no | tunnel=no )	[0x10f00 resolution 24]
highway=trunk_link 				[0x10513 resolution 21-21 continue]
highway=trunk_link 				[0x10514 resolution 23-22 continue]
highway=trunk_link 				[0x10515 resolution 24]

# highway=primary & motorroad=yes [0x10508 resolution 18-18 continue]
motorroad=yes 		[0x10508 resolution 21-21 continue]
motorroad=yes 		[0x1050b resolution 22]

highway=* & highway!=proposed & ( proposed!=* | proposed=no ) & bridge=yes {set access=yes} [0x01 road_class=2 road_speed=0 resolution 24 continue]

highway=* 		& ( extremecarver=mr | route=mtb | route=bicycle )	& bridge=yes {set access=yes}	[0x01 road_class=3 road_speed=0 resolution 24 continue]
highway=* 		& ( extremecarver=mr | route=mtb | route=bicycle )	& bridge=yes {set access=yes}	[0x01 road_class=3 road_speed=0 resolution 24 continue]





highway=unsurfaced 				& ( extremecarver=mr | route=mtb )		& bridge=yes {set access=yes}	[0x07 road_class=3 road_speed=1 resolution 24 continue]
highway=unsurfaced 				& ( extremecarver=mr | route=mtb )		& bridge=yes 					[0x11009 resolution 23-21]
highway=unclassified 			& ( extremecarver=mr | route=mtb )		& bridge=yes {set access=yes}	[0x0b road_class=3 road_speed=1 resolution 21]
highway=byway 					& ( extremecarver=mr | route=mtb )		& bridge=yes {set access=yes}	[0x0a road_class=3 road_speed=1 resolution 21]
highway=bridleway 				& ( extremecarver=mr | route=mtb )		& bridge=yes {set access=yes} 	[0x0a road_class=3 road_speed=1 resolution 21]
highway=service & access=yes	& ( extremecarver=mr | route=mtb )		& bridge=yes {set access=yes}	[0x10 road_class=3 road_speed=1 resolution 21]
highway=service 				& ( extremecarver=mr | route=mtb )		& bridge=yes {set access=yes}	[0x10 road_class=3 road_speed=1 resolution 21]
highway=road 					& ( extremecarver=mr | route=mtb )		& bridge=yes {set access=yes} 	[0x07 road_class=3 road_speed=1 resolution 24 continue]
highway=road 					& ( extremecarver=mr | route=mtb )		& bridge=yes 				 	[0x11009 resolution 23-21]

highway=unsurfaced 				& route=bicycle	& bridge=yes {set access=yes}	[0x07 road_class=3 road_speed=1 resolution 24 continue]
highway=unsurfaced 				& route=bicycle	& bridge=yes 					[0x11009 resolution 23-21]
highway=unclassified 			& route=bicycle	& bridge=yes {set access=yes}	[0x0b road_class=3 road_speed=1 resolution 21]
highway=byway 					& route=bicycle	& bridge=yes {set access=yes}	[0x0a road_class=3 road_speed=1 resolution 21]
highway=bridleway 				& route=bicycle	& bridge=yes {set access=yes} 	[0x03 road_class=3 road_speed=1 resolution 21]
highway=service & access=yes	& route=bicycle	& bridge=yes {set access=yes}	[0x10 road_class=3 road_speed=1 resolution 21]
highway=service 				& route=bicycle	& bridge=yes {set access=yes}	[0x10 road_class=3 road_speed=1 resolution 21]
highway=road 					& route=bicycle	& bridge=yes {set access=yes} 	[0x07 road_class=3 road_speed=1 resolution 24 continue]
highway=road 					& route=bicycle	& bridge=yes 				 	[0x11009 resolution 23-21]

highway=unsurfaced 						& bridge=yes {set access=yes} 	[0x07 road_class=3 road_speed=1 resolution 24 continue]
highway=unsurfaced 						& bridge=yes {set access=yes} 	[0x11009 resolution 23-22]
highway=unclassified 					& bridge=yes {set access=yes; add taxi=no; add mkgmap:unpaved=1} [0x0b road_class=3 road_speed=1 resolution 21]
highway=byway 							& bridge=yes {set access=yes}	[0x0a road_class=3 road_speed=1 resolution 22]
highway=bridleway 						& bridge=yes {set access=yes}	[0x07 road_class=3 road_speed=1 resolution 24 continue]
highway=bridleway 						& bridge=yes {set access=yes}	[0x11009 resolution 23-22]
highway=service & access=yes			& bridge=yes  					[0x10 road_class=3 road_speed=1 resolution 22]
highway=service & access=no				& bridge=yes {set access=yes; add taxi=no; add mkgmap:unpaved=1} [0x10 road_class=1 road_speed=1 resolution 22]
highway=service 						& bridge=yes {set access=yes; add taxi=no; add mkgmap:unpaved=1} [0x10 road_class=3 road_speed=1 resolution 22]
highway=construction					& bridge=yes  					[0x10503 resolution 22]
highway=road 							& bridge=yes {set access=yes}	[0x07 road_class=3 road_speed=1 resolution 24 continue]
highway=road 							& bridge=yes {set access=yes}	[0x11009 resolution 23-22]


highway=path 		& ( extremecarver=mr | route=mtb )	& bridge=yes  {set access=yes}	[0x03 road_class=3 road_speed=1 resolution 21]
highway=cycleway	& ( extremecarver=mr | route=mtb )	& bridge=yes  {set access=yes}	[0x03 road_class=3 road_speed=1 resolution 21]
highway=footway 	& ( extremecarver=mr | route=mtb )	& bridge=yes  {set access=yes}	[0x01 road_class=3 road_speed=1 resolution 24 continue]
highway=footway 	& ( extremecarver=mr | route=mtb )	& bridge=yes  					[0x10e08 resolution 21]
highway=track 		& ( extremecarver=mr | route=mtb )	& bridge=yes  {set access=yes}	[0x07 road_class=3 road_speed=1 resolution 24 continue]
highway=track 		& ( extremecarver=mr | route=mtb )	& bridge=yes  {set access=yes}	[0x11009 resolution 23-21]

highway=path 		& route=bicycle	& bridge=yes  {set access=yes}	[0x03 road_class=3 road_speed=1 resolution 21]
highway=cycleway	& route=bicycle	& bridge=yes  {set access=yes}	[0x03 road_class=3 road_speed=1 resolution 21]

highway=footway 	& route=bicycle	& bridge=yes  {set access=yes}	[0x01 road_class=3 road_speed=1 resolution 24 continue]
highway=footway 	& route=bicycle	& bridge=yes  					[0x10e08 resolution 21]
highway=track 		& route=bicycle	& bridge=yes  {set access=yes}	[0x07 road_class=3 road_speed=1 resolution 24 continue]
highway=track 		& route=bicycle	& bridge=yes  {set access=yes}	[0x11009 resolution 23-21]

highway=path 							& bridge=yes  	{set access=yes}			[0x03 road_class=3 road_speed=1 resolution 22]
highway=cycleway						& bridge=yes  	{set access=yes}			[0x03 road_class=3 road_speed=1 resolution 22]
highway=footway 						& bridge=yes  	{set access=yes}			[0x01 road_class=3 road_speed=1 resolution 24 continue]
highway=footway 						& bridge=yes  								[0x10e08 resolution 22]
highway=track 							& bridge=yes  	{set access=yes}			[0x07 road_class=3 road_speed=1 resolution 24 continue]
highway=track 							& bridge=yes  								[0x11009 resolution 23-22]

service=parking_aisle | service=parkingaisle | highway=parking_aisle {add taxi=no} [0x01 road_class=0 road_speed=0 resolution 24 continue]
service=parking_aisle | service=parkingaisle | highway=parking_aisle {add taxi=no} [0x1100a resolution 24]




# highway=primary & importantprimary=yes						[0x10518 resolution 18-18 continue]
# highway=primary & oneway=* & lanes>1 {set no0x150e=yes}		[0x10518 resolution 20-19 continue with_actions]
highway=primary & oneway=* & lanes>1 						[0x10516 resolution 23-21 continue]

# highway=primary & no0x150e!=yes	[0x1050d resolution 20-19 continue]
highway=primary & no0x150e!=yes	[0x10516 resolution 23-21 continue]

# highway=primary_link 										[0x10517 resolution 20-19 continue]
highway=primary_link 										[0x10517 resolution 21-21 continue]
highway=primary_link 										[0x10518 resolution 23-22 continue]

( highway=primary | highway=primary_link ) 	& ( extremecarver=mr | route=mtb )							& bridge=yes  	[0x02 road_class=3 road_speed=1 resolution 24]
( highway=primary | highway=primary_link ) 	& route=bicycle					& bridge=yes 	[0x02 road_class=3 road_speed=1 resolution 24]
( highway=primary | highway=primary_link ) 	& cycleway=lane												& bridge=yes 	[0x02 road_class=3 road_speed=1 resolution 24]
( highway=primary | highway=primary_link ) 	& cycleway=track											& bridge=yes  	[0x02 road_class=3 road_speed=1 resolution 24]
( highway=primary | highway=primary_link ) 	& ( bicycle=yes | bicycle=permissive | bicycle=designated )	& bridge=yes   	[0x02 road_class=3 road_speed=1 resolution 24]
( highway=primary | highway=primary_link ) 	& (bicycle=no | bicycle=nope) & bridge=yes 				{set delivery=no; set toll=yes}	[0x02 road_class=0 road_speed=1 resolution 24]
( highway=primary | highway=primary_link ) 	& (bicycle=no | bicycle=nope) & tunnel=yes 				{set delivery=no; set toll=yes}	[0x02 road_class=0 road_speed=1 resolution 24]
( highway=primary | highway=primary_link ) 	& ( bicycle=yes | bicycle=permissive | bicycle=designated )	& tunnel=yes   	[0x02 road_class=3 road_speed=1 resolution 24]
( highway=primary | highway=primary_link ) 				 			& tunnel=yes 										[0x02 road_class=2 road_speed=1 resolution 24]
( highway=primary | highway=primary_link )																& bridge=yes  	[0x02 road_class=3 road_speed=1 resolution 24]



( highway=primary | highway=primary_link ) 	& class:bicycle=3 [0x02 road_class=3 road_speed=2 resolution 24]
( highway=primary | highway=primary_link ) 	& class:bicycle=2 [0x02 road_class=2 road_speed=2 resolution 24]
( highway=primary | highway=primary_link ) 	& class:bicycle=1 [0x02 road_class=2 road_speed=1 resolution 24]
( highway=primary | highway=primary_link ) 	& class:bicycle=-1 [0x02 road_class=0 road_speed=1 resolution 24]
( highway=primary | highway=primary_link ) 	& class:bicycle=-2 [0x02 road_class=0 road_speed=0 resolution 24]
( highway=primary | highway=primary_link ) 	& class:bicycle=-3 [0x02 road_class=0 road_speed=0 resolution 24]


highway=primary 	& oneway=yes & cycleway=track		[0x02 road_class=1 road_speed=0 resolution 24]
highway=primary 	& oneway=yes & cycleway=lane		[0x02 road_class=1 road_speed=1 resolution 24]
highway=primary 	& oneway=yes & lanes>1				[0x02 road_class=0 road_speed=0 resolution 24]
highway=primary 	& importantprimary=yes 				[0x02 road_class=0 road_speed=0 resolution 24]
highway=primary 	& lanes>3							[0x02 road_class=0 road_speed=1 resolution 24]
highway=primary 	& source:maxspeed ~ '.*local'		[0x02 road_class=0 road_speed=1 resolution 24]
highway=primary 	&   ( bicycle=designated ) 			[0x02 road_class=1 road_speed=1 resolution 24 continue]
highway=primary 	& ( cycleway=track | cycleway=lane ) & ( source:maxspeed ~ '.*urban' | maxspeed>60 )	[0x02 road_class=1 road_speed=2 resolution 24]
( highway=primary | highway=primary_link ) 	& (bicycle=no | bicycle=nope) {set toll=yes}					[0x02 road_class=0 road_speed=0 resolution 24]
highway=primary		& source:maxspeed ~ '.*urban'					[0x02 road_class=1 road_speed=2 resolution 24]
highway=primary 	& oneway=yes									[0x02 road_class=0 road_speed=1 resolution 24]
highway=primary 	&	route=hiking								[0x02 road_class=1 road_speed=1 resolution 24]
highway=primary		& maxspeed>60									[0x02 road_class=1 road_speed=2 resolution 24]
highway=primary 	&   ( bicycle=designated ) 						[0x02 road_class=1 road_speed=2 resolution 24]
highway=primary		& ( maxspeed=* & maxspeed<61 & maxspeed>39 )	[0x02 road_class=0 road_speed=1 resolution 24]
highway=primary 	& maxspeed!=*									[0x02 road_class=1 road_speed=1 resolution 24]
highway=primary 	&	cycleway=lane								[0x02 road_class=1 road_speed=2 resolution 24]
highway=primary 	&	cycleway=track								[0x02 road_class=1 road_speed=2 resolution 24]
highway=primary 													[0x02 road_class=0 road_speed=1 resolution 24]
highway=primary_link 												[0x02 road_class=1 road_speed=1 resolution 24]




# Search for ref to not start with "lf" ref ~ '[^LF].*' highway=secondary 	& oneway=yes & lanes>1

# highway=secondary & importantsecondary=yes						[0x1051e resolution 19-19 continue]
highway=secondary & oneway=yes & lanes>1						[0x1050e resolution 23-21 continue]
# highway=secondary & no0x150e!=yes								[0x1051e resolution 20-20 continue]
highway=secondary & no0x150e!=yes								[0x1050e resolution 23-21 continue]
highway=secondary_link 											[0x10519 resolution 21-21 continue]
highway=secondary_link 											[0x1051a resolution 23-22 continue]


highway=secondary 	&	( extremecarver=mr | route=mtb )		& bridge=yes  		[0x04 road_class=3 road_speed=1 resolution 24]
highway=secondary 	&	route=bicycle & bridge=yes  		[0x04 road_class=3 road_speed=1 resolution 24]
highway=secondary 	& (bicycle=no | bicycle=nope) & bridge=yes  {set delivery=no; set toll=yes}	[0x04 road_class=0 road_speed=1 resolution 24]
highway=secondary 											& bridge=yes  			[0x04 road_class=2 road_speed=1 resolution 24]


( highway=secondary | highway=secondary_link ) 	& class:bicycle=3 	[0x04 road_class=3 road_speed=2 resolution 24]
( highway=secondary | highway=secondary_link ) 	& class:bicycle=2 	[0x04 road_class=3 road_speed=2 resolution 24]
( highway=secondary | highway=secondary_link ) 	& class:bicycle=1 	[0x04 road_class=3 road_speed=2 resolution 24]
( highway=secondary | highway=secondary_link ) 	& class:bicycle=-1 	[0x04 road_class=1 road_speed=1 resolution 24]
( highway=secondary | highway=secondary_link ) 	& class:bicycle=-2 	[0x04 road_class=1 road_speed=0 resolution 24]
( highway=secondary | highway=secondary_link ) 	& class:bicycle=-3 	[0x04 road_class=0 road_speed=0 resolution 24]


highway=secondary 	& ( extremecarver=mr | route=mtb ) & oneway=yes 	   		 [0x04 road_class=2 road_speed=2 resolution 24]
highway=secondary 	& route=bicycle & oneway=yes  	 [0x04 road_class=2 road_speed=1 resolution 24]
highway=secondary 	&	( extremecarver=mr | route=mtb )						 [0x04 road_class=2 road_speed=1 resolution 24]
highway=secondary 	&	route=bicycle 				 [0x04 road_class=2 road_speed=2 resolution 24]
highway=secondary 	& oneway=yes & lanes>1										 [0x04 road_class=0 road_speed=1 resolution 24]
highway=secondary	& source:maxspeed ~ '.*local'								 [0x04 road_class=1 road_speed=0 resolution 24]
highway=secondary 	& ( cycleway=track | cycleway=lane ) & ( source:maxspeed ~ '.*urban' | maxspeed>60 ) [0x04 road_class=2 road_speed=2 resolution 24]
highway=secondary 	& (  bicycle=designated )	 								 [0x04 road_class=2 road_speed=1 resolution 24]
highway=secondary 	& (bicycle=no | bicycle=nope) 								 [0x04 road_class=0 road_speed=0 resolution 24]
highway=secondary 	& source:maxspeed ~ '.*urban'								 [0x04 road_class=2 road_speed=2 resolution 24]
highway=secondary 	& maxspeed>60												 [0x04 road_class=2 road_speed=2 resolution 24]
highway=secondary 	& oneway=yes & cycleway=track								 [0x04 road_class=2 road_speed=1 resolution 24]
highway=secondary 	& oneway=yes												 [0x04 road_class=1 road_speed=1 resolution 24]
highway=secondary 	& route=hiking								 				 [0x04 road_class=2 road_speed=2 resolution 24]
highway=secondary 	& cycleway=lane												 [0x04 road_class=2 road_speed=2 resolution 24]
highway=secondary 	& cycleway=track											 [0x04 road_class=2 road_speed=2 resolution 24]
highway=secondary 	& maxspeed=* & maxspeed!=50 & maxspeed!=60 & maxspeed!=40	 [0x04 road_class=2 road_speed=1 resolution 24]
highway=secondary 	& maxspeed!=* 												 [0x04 road_class=2 road_speed=1 resolution 24]
highway=secondary 																 [0x04 road_class=1 road_speed=1 resolution 24]
highway=secondary_link															 [0x04 road_class=2 road_speed=1 resolution 24]





highway=tertiary 		[0x1050f resolution 23-21 continue]
highway=tertiary_link 	[0x1051b resolution 23-21 continue]

highway=tertiary 	&	( extremecarver=mr | route=mtb ) & bridge=yes   								[0x05 road_class=3 road_speed=1 resolution 24]
highway=tertiary    & route=bicycle & bridge=yes   							[0x05 road_class=3 road_speed=1 resolution 24]
highway=tertiary 	&	cycleway=lane						& bridge=yes  								[0x05 road_class=3 road_speed=1 resolution 24]
highway=tertiary 	&	cycleway=track						& bridge=yes 								[0x05 road_class=3 road_speed=1 resolution 24]
highway=tertiary 	& ( bicycle=yes | bicycle=permissive | bicycle=designated ) 	& bridge=yes  		[0x05 road_class=3 road_speed=1 resolution 24]
highway=tertiary 	& 	(bicycle=no | bicycle=nope)							& bridge=yes  {add mkgmap:unpaved=1}	[0x05 road_class=1 road_speed=1 resolution 24]
highway=tertiary 											& bridge=yes  								[0x05 road_class=3 road_speed=1 resolution 24]



highway=tertiary 		& class:bicycle=3 	[0x04 road_class=4 road_speed=3 resolution 24 continue]
( highway=tertiary ) 	& class:bicycle=3 	[0x04 road_class=2 road_speed=2 resolution 24]
( highway=tertiary ) 	& class:bicycle=2 	[0x04 road_class=3 road_speed=2 resolution 24]
( highway=tertiary ) 	& class:bicycle=1 	[0x04 road_class=3 road_speed=2 resolution 24]
( highway=tertiary | highway=tertiary_link ) 	& class:bicycle=-1 	[0x04 road_class=2 road_speed=1 resolution 24]
( highway=tertiary | highway=tertiary_link ) 	& class:bicycle=-2 	[0x04 road_class=1 road_speed=0 resolution 24]
( highway=tertiary | highway=tertiary_link ) 	& class:bicycle=-3 	[0x04 road_class=0 road_speed=0 resolution 24]
( highway=tertiary_link ) 	& class:bicycle=3 	[0x04 road_class=3 road_speed=1 resolution 24]
( highway=tertiary_link ) 	& class:bicycle=2 	[0x04 road_class=2 road_speed=1 resolution 24]

highway=tertiary 	& ( cycleway=track | cycleway=lane ) & (source:maxspeed ~ '.*urban' | maxspeed>60 ) [0x05 road_class=3 road_speed=2 resolution 24]
highway=tertiary 	& ( extremecarver=mr | route=mtb )	& oneway=yes  									[0x05 road_class=2 road_speed=1 resolution 24]
highway=tertiary   	& route=bicycle	& oneway=yes  							[0x05 road_class=2 road_speed=1 resolution 24]
highway=tertiary 	& oneway=yes & cycleway=track														[0x05 road_class=1 road_speed=1 resolution 24]
highway=tertiary	& oneway=yes & lanes>1										 						[0x05 road_class=1 road_speed=1 resolution 24]
highway=tertiary	& route=hiking																		[0x05 road_class=3 road_speed=2 resolution 24]
highway=tertiary 	& source:maxspeed ~ '.*local' & cycleway=track				 						[0x05 road_class=2 road_speed=1 resolution 24]
highway=tertiary	& source:maxspeed ~ '.*local'														[0x05 road_class=2 road_speed=1 resolution 24]
highway=tertiary 	& oneway=yes																		[0x05 road_class=2 road_speed=1 resolution 24]
highway=tertiary 	&	( extremecarver=mr | route=mtb )	 											[0x05 road_class=3 road_speed=2 resolution 24]
highway=tertiary  	& route=bicycle	 										[0x05 road_class=3 road_speed=2 resolution 24]
highway=tertiary 	&	cycleway=lane																	[0x05 road_class=3 road_speed=2 resolution 24]
highway=tertiary 	&	cycleway=track	& maxspeed!=50													[0x05 road_class=3 road_speed=2 resolution 24]
highway=tertiary 	& ( bicycle=yes | bicycle=permissive | bicycle=designated ) 						[0x05 road_class=3 road_speed=2 resolution 24]
highway=tertiary 	& 	(bicycle=no | bicycle=nope)	{add mkgmap:unpaved=1}							[0x05 road_class=0 road_speed=0 resolution 24]
highway=tertiary 	& source:maxspeed ~ '.*urban'								 						[0x05 road_class=4 road_speed=2 resolution 24]
highway=tertiary 	& maxspeed!=50 & maxspeed!=60 & maxspeed!=40				 						[0x05 road_class=3 road_speed=2 resolution 24]
highway=tertiary 																						[0x05 road_class=2 road_speed=2 resolution 24]
highway=tertiary_link 																					[0x05 road_class=2 road_speed=1 resolution 24]





highway=residential 	& class:bicycle=* & route=bicycle  			[0x11009 resolution 21-21 continue]
highway=residential 	& class:bicycle=3 	[0x07 road_class=3 road_speed=3 resolution 24 continue]
highway=residential  	& class:bicycle=3 	[0x07 road_class=2 road_speed=2 resolution 24 continue]
highway=residential  	& class:bicycle=2 	[0x07 road_class=2 road_speed=2 resolution 24 continue]
highway=residential  	& class:bicycle=1 	[0x07 road_class=2 road_speed=2 resolution 24 continue]
highway=residential  	& class:bicycle=3 	[0x11009 resolution 23-22]
highway=residential  	& class:bicycle=2 	[0x11009 resolution 23-22]
highway=residential  	& class:bicycle=1 	[0x11009 resolution 23-22]
highway=residential		& class:bicycle=*	[0x10008 resolution 23-22 continue]
highway=residential  	& class:bicycle=-1 	[0x07 road_class=1 road_speed=1 resolution 24]
highway=residential  	& class:bicycle=-2 	[0x07 road_class=1 road_speed=1 resolution 24]
highway=residential 	& class:bicycle=-3 	[0x07 road_class=0 road_speed=0 resolution 24]

highway=residential & route=bicycle [0x11009 resolution 23-21 continue]
highway=residential & ( extremecarver=mr | route=mtb )	  								[0x07 road_class=3 road_speed=2 resolution 22]
highway=residential & route=bicycle  							[0x07 road_class=2 road_speed=2 resolution 24]


highway=residential & fixme='check import' & ( route=* | extremecarver6=* )				[0x11009 resolution 22-21 continue]
highway=residential	& fixme!='check import'												[0x10008 resolution 22-22 continue]
highway=residential	& fixme!='check import'												[0x11009 resolution 23-23 continue]
highway=residential	& fixme='check import'												[0x10008 resolution 23-23 continue]


highway=residential & cycleway=lane							& bridge=yes   				[0x07 road_class=3 road_speed=1 resolution 24]
highway=residential & cycleway=track						& bridge=yes  				[0x07 road_class=3 road_speed=1 resolution 24]
highway=residential &  bicycle=designated	& bridge=yes  				  				[0x07 road_class=3 road_speed=1 resolution 24]
highway=residential &  (bicycle=no | bicycle=nope) & bridge=yes  {add mkgmap:unpaved=1} [0x07 road_class=1 road_speed=1 resolution 24]
highway=residential 										& bridge=yes  				[0x07 road_class=3 road_speed=1 resolution 24]

highway=residential & route=hiking							  							[0x07 road_class=2 road_speed=2 resolution 24]
highway=residential & ( extremecarver6=* | tracktype=* | sac_scale=* | mtb:scale=* | mtb:scale:uphill=* | smoothness=* )	[0x07 road_class=2 road_speed=1 resolution 24]

highway=residential & ( source:maxspeed ~ '.*urban' | maxspeed>50 )						[0x07 road_class=2 road_speed=1 resolution 24]
highway=residential & maxspeed<51 & maxspeed>30											[0x07 road_class=1 road_speed=1 resolution 24]
highway=residential & maxspeed<31														[0x07 road_class=1 road_speed=1 resolution 24]
highway=residential & cycleway=lane														[0x07 road_class=1 road_speed=1 resolution 24]
highway=residential & cycleway=track													[0x07 road_class=1 road_speed=1 resolution 24]
highway=residential &  bicycle=designated	 											[0x07 road_class=2 road_speed=1 resolution 24]
highway=residential &  (bicycle=no | bicycle=nope)	{add mkgmap:unpaved=1}				[0x07 road_class=0 road_speed=1 resolution 24]

highway=residential_link 																[0x07 road_class=0 road_speed=0 resolution 24]

highway=living_street 	& route=bicycle  							[0x10e07 resolution 21-21 continue]
highway=living_street 	& ( route=bicycle | bridge=yes )  			[0x10e07 resolution 22 continue]
highway=living_street 	& route!=bicycle & bridge!=yes	  			[0x10e06 resolution 22 continue]

highway=living_street 	& class:bicycle=3 	[0x01 road_class=3 road_speed=2 resolution 24 continue]
highway=living_street  	& class:bicycle=3 	[0x01 road_class=3 road_speed=1 resolution 24]
highway=living_street  	& class:bicycle=2 	[0x01 road_class=2 road_speed=1 resolution 24]
highway=living_street  	& class:bicycle=1 	[0x01 road_class=1 road_speed=1 resolution 24]
highway=living_street  	& class:bicycle=-1 	[0x01 road_class=0 road_speed=1 resolution 24]
highway=living_street  	& class:bicycle=-2 	[0x01 road_class=0 road_speed=0 resolution 24]
highway=living_street 	& class:bicycle=-3 	[0x01 road_class=0 road_speed=0 resolution 24]

highway=living_street & ( extremecarver=mr | route=mtb )	 	{set oneway=no} 													[0x01 road_class=3 road_speed=2 resolution 24]
highway=living_street & route=bicycle {set oneway=no} 													[0x01 road_class=2 road_speed=2 resolution 24]
highway=living_street & cycleway=* 								& bridge=yes 				 										[0x01 road_class=2 road_speed=1 resolution 24]
highway=living_street & bicycle=designated 						& bridge=yes  {set oneway=no} 										[0x01 road_class=2 road_speed=1 resolution 24]
highway=living_street & ( bicycle=yes | bicycle=permissive ) 	& bridge=yes  {set oneway=no} 										[0x01 road_class=2 road_speed=1 resolution 24]
highway=living_street & (bicycle=no | bicycle=nope)				& bridge=yes  {set oneway=no; add taxi=no; add mkgmap:unpaved=1}	[0x01 road_class=1 road_speed=1 resolution 24]
highway=living_street 											& bridge=yes  {set oneway=no}										[0x01 road_class=2 road_speed=1 resolution 24]

highway=living_street & ( cycleway=* &	( bicycle=yes | bicycle=permissive | bicycle=designated ))  {add taxi=no} 					[0x01 road_class=1 road_speed=2 resolution 24]
highway=living_street & cycleway=* 																	{add taxi=no} 					[0x01 road_class=1 road_speed=2 resolution 24]
highway=living_street & (route=bicycle | route=mtb | extremecarver=mr )		{set oneway=no}					[0x01 road_class=2 road_speed=1 resolution 24]
highway=living_street & bicycle=designated 															{set oneway=no}					[0x01 road_class=1 road_speed=1 resolution 24]
highway=living_street & route=hiking	 															{set oneway=no}					[0x01 road_class=1 road_speed=1 resolution 24]
highway=living_street & ( bicycle=yes | bicycle=permissive ) 										{set oneway=no; add taxi=no} 	[0x01 road_class=0 road_speed=1 resolution 24]
highway=living_street & (bicycle=no | bicycle=nope)										{set oneway=no; set toll=yes; add taxi=no} 	[0x01 road_class=0 road_speed=0 resolution 24]
highway=living_street 																				{set oneway=no; add taxi=no} 	[0x01 road_class=0 road_speed=1 resolution 24]

highway=steps 	& route=bicycle & bridge=yes  {add taxi=no}		[0x08 road_class=3 road_speed=1 resolution 21]
highway=steps 	&	( extremecarver=mr | route=mtb ) & bridge=yes  {add taxi=no}			[0x08 road_class=3 road_speed=1 resolution 21]
highway=steps 		& bridge=yes 															[0x08 road_class=3 road_speed=1 resolution 22]
highway=steps 	& route=bicycle & bridge=yes  {add taxi=no}		[0x08 road_class=2 road_speed=1 resolution 21]
highway=steps 	&	( extremecarver=mr | route=mtb ) & bridge=yes  {add taxi=no} 			[0x08 road_class=3 road_speed=1 resolution 21]

highway=steps & (incline=down | incline=up | incline>1 | incline<-1) {add taxi=no; add mkgmap:unpaved=1}		[0x08 road_class=0 road_speed=0 resolution 22]
highway=steps 		{add taxi=no; add mkgmap:unpaved=1}										[0x08 road_class=1 road_speed=0 resolution 22]


( highway=mini_roundabout | highway=roundabout | junction=roundabout )  & 	(route=mtb | route=bicycle | extremecarver6=*) [0x11009 resolution 21-21 continue]
( highway=mini_roundabout | highway=roundabout | junction=roundabout )  		[0x11009 resolution 23-22 continue]
highway=mini_roundabout & 	(route=mtb | route=bicycle | extremecarver6=*)		[0x07 road_class=2 road_speed=1 resolution 24]
highway=mini_roundabout 														[0x07 road_class=0 road_speed=1 resolution 24]
highway=roundabout & 		(route=mtb | route=bicycle | extremecarver6=*)		[0x07 road_class=2 road_speed=1 resolution 24]
highway=roundabout 																[0x07 road_class=0 road_speed=1 resolution 24]
junction=roundabout & 		(route=mtb | route=bicycle | extremecarver6=*)		[0x07 road_class=2 road_speed=1 resolution 24]
junction=roundabout 															[0x07 road_class=0 road_speed=0 resolution 24]



( highway=path | highway=cycleway ) & route=bicycle & (tracktype=grade1) {set 21res=yes}					[0x03 resolution 21-21 continue with_actions]
( highway=path | highway=cycleway ) & route=bicycle & tracktype=grade2 & 21res!=yes {set 21res=yes}		[0x0d resolution 21-21 continue with_actions]
( highway=path | highway=cycleway ) & route=bicycle & tracktype=grade3 & 21res!=yes {set 21res=yes}		[0x0e resolution 21-21 continue with_actions]
( highway=path | highway=cycleway ) & route=bicycle & tracktype=grade4 & 21res!=yes {set 21res=yes}		[0x0f resolution 21-21 continue with_actions]
( highway=path | highway=cycleway ) & route=bicycle & tracktype=grade5 & 21res!=yes {set 21res=yes}		[0x12 resolution 21-21 continue with_actions]
( highway=path | highway=cycleway ) & route=bicycle & sac_scale=hiking & 21res!=yes {set 21res=yes}		[0x0f resolution 21-21 continue with_actions]
( highway=path | highway=cycleway ) & route=bicycle & (mkgmap:unpaved!=1) & 21res!=yes {set 21res=yes}	[0x16 resolution 21-21 continue with_actions]
( highway=path | highway=cycleway ) & route=bicycle & sac_scale=* & 21res!=yes {set 21res=yes}			[0x12 resolution 21-21 continue with_actions]
( highway=path | highway=cycleway ) & route=bicycle & mtb:scale=0 & 21res!=yes {set 21res=yes}			[0x0f resolution 21-21 continue with_actions]
( highway=path | highway=cycleway ) & route=bicycle & mtb:scale=* & 21res!=yes {set 21res=yes}			[0x12 resolution 21-21 continue with_actions]
( highway=path | highway=cycleway ) & route=bicycle & ( bicycle=no | bicycle=nope ) & 21res!=yes {set 21res=yes}	[0x06 resolution 21-21 continue with_actions]
highway=cycleway 	& route=bicycle & 21res!=yes {set 21res=yes}						[0x03 resolution 21-21 continue with_actions]
highway=path 	& route=bicycle & 21res!=yes {set 21res=yes}							[0x11003 resolution 21-21 continue with_actions]



highway=cycleway	& class:bicycle=3 	[0x01 road_class=4 road_speed=3 resolution 24 continue]
highway=cycleway	& class:bicycle=3 	[0x03 road_class=4 road_speed=2 resolution 22]
highway=cycleway	& class:bicycle=2 	[0x01 road_class=4 road_speed=3 resolution 24 continue]
highway=cycleway	& class:bicycle=2 	[0x03 road_class=4 road_speed=2 resolution 22]
highway=cycleway	& class:bicycle=1 	[0x03 road_class=4 road_speed=2 resolution 22]
highway=cycleway	& class:bicycle=-1 	[0x16 road_class=2 road_speed=1 resolution 22]
highway=cycleway	& class:bicycle=-2 	[0x0e road_class=0 road_speed=1 resolution 22]
highway=cycleway	& class:bicycle=-3 	[0x12 road_class=0 road_speed=0 resolution 22]


highway=cycleway & tracktype=4													[0x0f road_class=1 road_speed=0 resolution 22]
highway=cycleway & tracktype=5													[0x12 road_class=0 road_speed=0 resolution 22]
highway=cycleway & ( tracktype=extremecarver & bicycle=designated ) 				[0x12 road_class=0 road_speed=0 resolution 22]
highway=cycleway & ( tracktype=2 & bicycle=designated )						[0x16 road_class=1 road_speed=1 resolution 22]
highway=cycleway & ( tracktype=2 & ( bicycle=yes | bicycle=permissive ))		[0x16 road_class=1 road_speed=1 resolution 22]
highway=cycleway & ( tracktype=3 & ( bicycle=yes | bicycle=permissive ))		[0x0e road_class=1 road_speed=1 resolution 22]
highway=cycleway & ( tracktype=2 & (bicycle=no | bicycle=nope) )	{add mkgmap:unpaved=1}		[0x16 road_class=0 road_speed=1 resolution 22]
highway=cycleway & ( tracktype=3 & (bicycle=no | bicycle=nope) )	{add mkgmap:unpaved=1}		[0x0e road_class=0 road_speed=0 resolution 22]
highway=cycleway & tracktype=3													[0x0e road_class=1 road_speed=1 resolution 22]
highway=cycleway & tracktype=2 												[0x16 road_class=1 road_speed=1 resolution 22]
highway=cycleway & sac_scale=hiking													[0x12 road_class=0 road_speed=0 resolution 22]
highway=cycleway & sac_scale=mountain_hiking										[0x12 resolution 22]
highway=cycleway & sac_scale=demanding_mountain_hiking								[0x12 resolution 22]
highway=cycleway & sac_scale=alpine_hiking											[0x12 resolution 22]
highway=cycleway & sac_scale=demanding_alpine_hiking								[0x12 resolution 24]
highway=cycleway & sac_scale=difficult_alpine_hiking		 						[0x12 resolution 24]
highway=cycleway & mtb:scale=*   				{add mkgmap:unpaved=1}				[0x12 road_class=0 road_speed=0 resolution 22]
highway=cycleway & tracktype=extremecarver 				 							[0x12 road_class=0 road_speed=0 resolution 22]

highway=cycleway & oneway=yes														[0x01 road_class=1 road_speed=2 resolution 24 continue]
highway=cycleway & oneway=yes														[0x10409 resolution 22]
highway=cycleway & route!=bicycle				{set toll=yes}			[0x03 road_class=3 road_speed=2 resolution 24 continue]
highway=cycleway 				& route=bicycle 	{set toll=yes}		[0x03 road_class=2 road_speed=1 resolution 24 continue]
highway=cycleway 				& route=bicycle 			[0x03 road_class=4 road_speed=2 resolution 22]
highway=cycleway & segregated=no													[0x03 road_class=3 road_speed=2 resolution 22]

highway=cycleway & highway=footway	& bicycle=designated 							[0x03 road_class=3 road_speed=2 resolution 22]
highway=cycleway & highway=footway						 							[0x03 road_class=2 road_speed=2 resolution 22]
highway=cycleway 																	[0x03 road_class=3 road_speed=2 resolution 22]

bicycle=nope {set bicycle=no}




highway=path	& class:bicycle=3 	[0x01 road_class=4 road_speed=3 resolution 24 continue]
highway=path	& class:bicycle=3 	[0x03 road_class=4 road_speed=2 resolution 22]
highway=path	& class:bicycle=2 	[0x03 road_class=4 road_speed=3 resolution 24 continue]
highway=path	& class:bicycle=2 	[0x03 road_class=4 road_speed=2 resolution 22]
highway=path	& class:bicycle=1 	[0x03 road_class=3 road_speed=2 resolution 22]
highway=path	& class:bicycle=-1 	[0x16 road_class=1 road_speed=1 resolution 22]
highway=path	& class:bicycle=-2 	[0x0e road_class=0 road_speed=1 resolution 22]
highway=path	& class:bicycle=-3 	[0x12 resolution 23]


highway=path & tracktype=4													[0x0f road_class=0 road_speed=0 resolution 22]
highway=path & tracktype=5													[0x12 resolution 23]
highway=path & ( tracktype=extremecarver & bicycle=designated ) 			[0x12 road_class=0 road_speed=0 resolution 23]
highway=path & ( tracktype=2 & bicycle=designated )							[0x0d road_class=1 road_speed=1 resolution 22]
highway=path & ( tracktype=2 & ( bicycle=yes | bicycle=permissive ))		[0x0d road_class=1 road_speed=0 resolution 22]
highway=path & ( tracktype=3 & ( bicycle=yes | bicycle=permissive ))		[0x0e road_class=0 road_speed=0 resolution 22]
highway=path & ( tracktype=2 & (bicycle=no | bicycle=nope) ) {add mkgmap:unpaved=1}		[0x0d resolution 23]
highway=path & ( tracktype=3 & (bicycle=no | bicycle=nope) )				[0x0e resolution 23]
highway=path & tracktype=3													[0x0e road_class=0 road_speed=0 resolution 22]
highway=path & tracktype=2 													[0x0d road_class=1 road_speed=0 resolution 22]
highway=path & sac_scale=hiking												[0x0f road_class=0 road_speed=0 resolution 22]
highway=path & sac_scale=mountain_hiking									[0x12 resolution 22]
highway=path & sac_scale=demanding_mountain_hiking							[0x12 resolution 23]
highway=path & sac_scale=alpine_hiking										[0x12 resolution 23]
highway=path & sac_scale=demanding_alpine_hiking	{delete highway}
highway=path & sac_scale=difficult_alpine_hiking	{delete highway}
highway=path & tracktype=extremecarver 				 						[0x12 resolution 23]
highway=path & mtb:scale=0   												[0x0f road_class=0 road_speed=0 resolution 22]
highway=path & mtb:scale=1   												[0x12 road_class=0 road_speed=0 resolution 22]
highway=path & mtb:scale=*   												[0x12 resolution 23]
highway=path & designation=cycleway											[0x03 road_class=3 road_speed=2 resolution 22]
highway=path & bicycle=yes													[0x03 road_class=3 road_speed=2 resolution 22]


highway=path & (bicycle=no | bicycle=nope)										[0x06 resolution 22]
highway=path & ( tracktype=1 & bicycle=designated )								[0x03 road_class=3 road_speed=2 resolution 22]
highway=path & ( tracktype=1 & ( bicycle=yes | bicycle=permissive ))			[0x03 road_class=3 road_speed=2 resolution 22]
highway=path & ( tracktype=1 & (bicycle=no | bicycle=nope) )	{add mkgmap:unpaved=1}		[0x06 road_class=1 road_speed=1 resolution 22]
highway=path & tracktype=1 														[0x03 road_class=3 road_speed=2 resolution 22]
highway=path & segregated=yes	& route=bicycle  		[0x03 road_class=4 road_speed=2 resolution 22]
highway=path & segregated=no	& route=bicycle 		[0x03 road_class=4 road_speed=2 resolution 22]
highway=path & bicycle=official	& route=bicycle 		[0x03 road_class=4 road_speed=2 resolution 22]
highway=path & bicycle=designated & route=bicycle 	[0x03 road_class=4 road_speed=2 resolution 22]
highway=path 					& route=bicycle 		[0x03 road_class=4 road_speed=2 resolution 22]
highway=path & bicycle=designated	 											[0x03 road_class=3 road_speed=2 resolution 22]

highway=path & segregated=yes													[0x03 road_class=3 road_speed=2 resolution 22]
highway=path & segregated=no													[0x03 road_class=2 road_speed=2 resolution 22]
highway=path & bicycle=official													[0x01 road_class=2 road_speed=2 resolution 24 continue]
highway=path & bicycle=official													[0x10409 resolution 22]
highway=path & mtb:scale:uphill=0												[0x0e road_class=0 road_speed=0 resolution 22]
highway=path & mtb:scale:uphill>2												[0x12 road_class=0 road_speed=0 resolution 22]
highway=path & mtb:scale:uphill>0												[0x0f road_class=0 road_speed=0 resolution 22]
highway=path & ( foot=designated | designation=footway )						[0x06 road_class=0 road_speed=0 resolution 22]

highway=path 																	[0x01 road_class=1 road_speed=1 resolution 24 continue]
highway=path 																	[0x11003 resolution 22]



( highway=footway | highway=bridleway ) & route=bicycle & (tracktype=grade1) {set 21res=yes}					[0x03 resolution 21-21 continue with_actions]
( highway=footway | highway=bridleway ) & route=bicycle & tracktype=grade2 & 21res!=yes {set 21res=yes}		[0x0d resolution 21-21 continue with_actions]
( highway=footway | highway=bridleway ) & route=bicycle & tracktype=grade3 & 21res!=yes {set 21res=yes}		[0x0e resolution 21-21 continue with_actions]
( highway=footway | highway=bridleway ) & route=bicycle & tracktype=grade4 & 21res!=yes {set 21res=yes}		[0x0f resolution 21-21 continue with_actions]
( highway=footway | highway=bridleway ) & route=bicycle & tracktype=grade5 & 21res!=yes {set 21res=yes}		[0x12 resolution 21-21 continue with_actions]
( highway=footway | highway=bridleway ) & route=bicycle & sac_scale=hiking & 21res!=yes {set 21res=yes}		[0x0f resolution 21-21 continue with_actions]
( highway=footway | highway=bridleway ) & route=bicycle & (mkgmap:unpaved!=1) & 21res!=yes {set 21res=yes}	[0x16 resolution 21-21 continue with_actions]
( highway=footway | highway=bridleway ) & route=bicycle & sac_scale=* & 21res!=yes {set 21res=yes}			[0x12 resolution 21-21 continue with_actions]
( highway=footway | highway=bridleway ) & route=bicycle & mtb:scale=0 & 21res!=yes {set 21res=yes}			[0x0f resolution 21-21 continue with_actions]
( highway=footway | highway=bridleway ) & route=bicycle & mtb:scale=* & 21res!=yes {set 21res=yes}			[0x12 resolution 21-21 continue with_actions]
( highway=footway | highway=bridleway ) & route=bicycle & ( bicycle=no | bicycle=nope ) & 21res!=yes {set 21res=yes}	[0x06 resolution 21-21 continue with_actions]
highway=footway 	& route=bicycle & 21res!=yes {set 21res=yes}												[0x06 resolution 21-21 continue with_actions]
highway=path 	& route=bicycle & 21res!=yes {set 21res=yes}													[0x10017 resolution 21-21 continue with_actions]



highway=footway	& class:bicycle=3 	[0x01 road_class=4 road_speed=2 resolution 24 continue]
highway=footway	& class:bicycle=3 	[0x03 road_class=3 road_speed=2 resolution 22]
highway=footway	& class:bicycle=2 	[0x03 road_class=4 road_speed=2 resolution 22]
highway=footway	& class:bicycle=1 	[0x03 road_class=3 road_speed=2 resolution 22]
highway=footway	& class:bicycle=-1 	[0x06 road_class=1 road_speed=1 resolution 22]
highway=footway	& class:bicycle=-2 	[0x0d road_class=0 road_speed=0 resolution 22]
highway=footway	& class:bicycle=-3 	[0x12 resolution 23]

highway=footway & ( tracktype=2 & bicycle=designated )						[0x16 road_class=1 road_speed=1 resolution 22]
highway=footway & ( tracktype=2 & ( bicycle=yes | bicycle=permissive ))		[0x16 road_class=1 road_speed=0 resolution 22]
highway=footway & ( tracktype=3 & ( bicycle=yes | bicycle=permissive ))		[0x0d road_class=0 road_speed=0 resolution 22]
highway=footway & ( tracktype=2 & (bicycle=no | bicycle=nope) )				[0x06 road_class=0 road_speed=0 resolution 23]
highway=footway & ( tracktype=3 & (bicycle=no | bicycle=nope) )				[0x06 road_class=0 road_speed=0 resolution 23]
highway=footway & tracktype=3												[0x0e road_class=0 road_speed=0 resolution 22]
highway=footway & mtb:scale=0   											[0x0f road_class=0 road_speed=0 resolution 22]
highway=footway & mtb:scale=1   											[0x12 resolution 22]
highway=footway & mtb:scale>1   											[0x12 resolution 23]
highway=footway & tracktype=4												[0x0f road_class=0 road_speed=0 resolution 22]
highway=footway & tracktype=5												[0x12 resolution 23]
highway=footway & ( tracktype=extremecarver & bicycle=designated ) 			[0x12 resolution 23]
highway=footway & sac_scale=mountain_hiking									[0x1f resolution 22]
highway=footway & sac_scale=demanding_mountain_hiking						[0x12 resolution 23]
highway=footway & sac_scale=alpine_hiking									[0x12 resolution 23]
highway=footway & sac_scale=demanding_alpine_hiking	{delete highway}
highway=footway & sac_scale=difficult_alpine_hiking	{delete highway}
highway=footway & tracktype=extremecarver			{delete highway}
highway=footway & ( bicycle=designated )									[0x03 road_class=1 road_speed=2 resolution 22]
highway=footway & ( bicycle=yes	| bicycle=permissive)						[0x16 road_class=1 road_speed=1 resolution 22]



highway=footway & ( tracktype=1 & bicycle=designated )							[0x03 road_class=3 road_speed=2 resolution 22]
highway=footway & ( tracktype=1 & ( bicycle=yes | bicycle=permissive ))			[0x03 road_class=3 road_speed=2 resolution 22]
highway=footway & ( tracktype=1 & (bicycle=no | bicycle=nope) )	{add mkgmap:unpaved=1}	[0x06 road_class=0 road_speed=0 resolution 22]
highway=footway & segregated=yes	& route=bicycle  	[0x03 road_class=3 road_speed=2 resolution 22]
highway=footway & segregated=no	& route=bicycle 		[0x16 road_class=2 road_speed=1 resolution 22]
highway=footway & bicycle=official	& route=bicycle 	[0x03 road_class=2 road_speed=1 resolution 22]
highway=footway & bicycle=designated & route=bicycle 	[0x03 road_class=3 road_speed=2 resolution 22]
highway=footway 					& route=bicycle 	[0x16 road_class=2 road_speed=1 resolution 22]
highway=footway & bicycle=designated	 										[0x03 road_class=2 road_speed=2 resolution 22]
highway=footway & segregated=yes												[0x03 road_class=1 road_speed=2 resolution 22]
highway=footway & bicycle=official												[0x01 road_class=1 road_speed=1 resolution 24 continue]
highway=footway & bicycle=official												[0x10409 resolution 22]
highway=footway & tracktype=2 													[0x06 road_class=0 road_speed=0 resolution 22]
highway=footway & segregated=no													[0x16 road_class=1 road_speed=1 resolution 22]


highway=footway & tracktype=1 													[0x01 road_class=0 road_speed=1 resolution 24 continue]
highway=footway & tracktype=1 													[0x11003 resolution 22]
highway=footway & mtb:scale:uphill=0											[0x0e road_class=0 road_speed=0 resolution 22]
highway=footway & mtb:scale:uphill>2											[0x12 road_class=0 road_speed=0 resolution 22]
highway=footway & mtb:scale:uphill>0											[0x0f road_class=0 road_speed=0 resolution 22]
highway=footway & sac_scale=hiking												[0x0f resolution 22]
highway=footway & (bicycle=no | bicycle=nope)									[0x06 resolution 23]
highway=footway 																[0x06 road_class=0 road_speed=0 resolution 22]



highway=bridleway	& class:bicycle=3 	[0x01 road_class=4 road_speed=3 resolution 24 continue]
highway=bridleway	& class:bicycle=3 	[0x03 road_class=4 road_speed=2 resolution 22]
highway=bridleway	& class:bicycle=2 	[0x01 road_class=4 road_speed=3 resolution 24 continue]
highway=bridleway	& class:bicycle=2 	[0x03 road_class=4 road_speed=2 resolution 22]
highway=bridleway	& class:bicycle=1 	[0x03 road_class=3 road_speed=2 resolution 22]
highway=bridleway	& class:bicycle=-1 	[0x0d road_class=1 road_speed=1 resolution 22]
highway=bridleway	& class:bicycle=-2 	[0x0e road_class=0 road_speed=0 resolution 22]
highway=bridleway	& class:bicycle=-3 	[0x10017 resolution 23]

highway=bridleway & tracktype=4												[0x0f resolution 22]
highway=bridleway & tracktype=5												[0x12 resolution 23]
highway=bridleway & ( tracktype=extremecarver & bicycle=designated ) 		[0x12 resolution 23]
highway=bridleway & ( tracktype=2 & bicycle=designated )					[0x0d road_class=0 road_speed=0 resolution 22]
highway=bridleway & ( tracktype=2 & ( bicycle=yes | bicycle=permissive ))	[0x0d road_class=0 road_speed=0 resolution 22]
highway=bridleway & ( tracktype=3 & ( bicycle=yes | bicycle=permissive ))	[0x0e road_class=0 road_speed=0 resolution 22]
highway=bridleway & ( tracktype=2 & (bicycle=no | bicycle=nope) ) {add mkgmap:unpaved=1}	[0x0d road_class=0 road_speed=0 resolution 23]
highway=bridleway & ( tracktype=3 & (bicycle=no | bicycle=nope) )			[0x0e road_class=0 road_speed=0 resolution 23]
highway=bridleway & tracktype=2 											[0x0d road_class=0 road_speed=0 resolution 22]
highway=bridleway & sac_scale=mountain_hiking								[0x12 resolution 23]
highway=bridleway & tracktype=3												[0x10017 resolution 22]
highway=bridleway & sac_scale=demanding_mountain_hiking						[0x12 resolution 23]
highway=bridleway & sac_scale=alpine_hiking									[0x12 resolution 23]
highway=bridleway & sac_scale=demanding_alpine_hiking	{delete highway}
highway=bridleway & sac_scale=difficult_alpine_hiking	{delete highway}
highway=bridleway & tracktype=extremecarver 				 				[0x12 resolution 23]
highway=bridleway & bicycle=yes												[0x10014 resolution 22 continue]
highway=bridleway & bicycle=yes												[0x03 road_class=2 road_speed=0 resolution 22]


highway=bridleway & (bicycle=no | bicycle=nope)	{add taxi=no; add mkgmap:unpaved=1} 		[0x0e road_class=0 road_speed=0 resolution 22]
highway=bridleway & ( tracktype=1 & bicycle=designated )						[0x03 road_class=3 road_speed=2 resolution 22]
highway=bridleway & ( tracktype=1 & ( bicycle=yes | bicycle=permissive ))		[0x03 road_class=3 road_speed=2 resolution 22]
highway=bridleway & ( tracktype=1 & (bicycle=no | bicycle=nope) )	{add mkgmap:unpaved=1}	[0x0d road_class=0 road_speed=0 resolution 23]
highway=bridleway & tracktype=1 												[0x03 road_class=1 road_speed=1 resolution 22]
highway=bridleway & segregated=yes	& route=bicycle  	[0x03 road_class=3 road_speed=2 resolution 22]
highway=bridleway & segregated=no	& route=bicycle 	[0x16 road_class=0 road_speed=1 resolution 22]
highway=bridleway & bicycle=official & (route=bicycle ) 	[0x03 road_class=1 road_speed=2 resolution 22]
highway=bridleway & bicycle=designated & (route=bicycle) 	[0x03 road_class=3 road_speed=2 resolution 22]
highway=bridleway 					& route=bicycle 	[0x16 road_class=1 road_speed=2 resolution 22]
highway=bridleway & bicycle=designated	 										[0x03 road_class=2 road_speed=2 resolution 22]


highway=bridleway & segregated=yes												[0x03 road_class=1 road_speed=2 resolution 22]
highway=bridleway & segregated=no												[0x16 road_class=1 road_speed=1 resolution 22]
highway=bridleway & bicycle=official											[0x01 road_class=1 road_speed=1 resolution 24 continue]
highway=bridleway & bicycle=official											[0x10409 resolution 22]
highway=bridleway & mtb:scale=0   												[0x0f resolution 22]
highway=bridleway & mtb:scale=*   												[0x12 resolution 23]
highway=bridleway & sac_scale=hiking											[0x10017 resolution 22]
highway=bridleway 																[0x01 road_class=0 road_speed=1 resolution 24 continue]
highway=bridleway 																[0x10017 resolution 23]

bicycle=no & importantaccess!=yes {set bicycle=nope}



# Make sure that at resolution 21 all ways pertaining to a cycleroute are shown.
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & route=bicycle & ( tracktype=grade5 ) & 21res!=* {set 21res=yes} [0x12 resolution 21-21 continue with_actions]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & route=bicycle & ( tracktype=grade4 ) & 21res!=* {set 21res=yes} [0x0f resolution 21-21 continue with_actions]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & route=bicycle & ( tracktype=grade3 ) & 21res!=* {set 21res=yes} [0x0e resolution 21-21 continue with_actions]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & route=bicycle & ( tracktype=grade2 ) & 21res!=* {set 21res=yes} [0x0d resolution 21-21 continue with_actions]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & route=bicycle & ( tracktype=grade1 | class:bicycle>0 ) {set 21res=yes} [0x0a resolution 21-21 continue with_actions]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & (bicycle=no | bicycle=nope) & (route=bicycle) & 21res!=* {set 21res=yes} [0x11004 resolution 21-21 continue with_actions]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & class:bicycle<-1 & (route=bicycle) & 21res!=* {set 21res=yes} [0x10009 resolution 21-21 continue with_actions]
( highway=track | highway=unsurfaced | highway=road ) & (route=bicycle) & 21res!=* {set 21res=yes} [0x11004 resolution 21-21 continue with_actions]
( highway=service | highway=byway ) & (route=bicycle) & 21res!=* {set 21res=yes} [0x10 resolution 21-21 continue with_actions]


(highway=unclassified | highway=road | highway=service ) & ( tracktype=3 | tracktype=4 | tracktype=5 | tracktype=extremecarver ) { set highway=unsurfaced }
highway=unclassified & (route=bicycle) & tracktype=grade2 & 21res!=* {set 21res=yes} [0x0d resolution 21-21 continue with_actions]
highway=unclassified & (route=bicycle) & 21res!=* {set 21res=yes} [0x0b resolution 21-21 continue with_actions]

highway=unclassified & class:bicycle=3	& tracktype=2 [0x01 road_class=3 road_speed=2 resolution 24 continue]
highway=unclassified & class:bicycle=3	& tracktype=2 [0x01 road_class=3 road_speed=1 resolution 24 continue]
highway=unclassified & class:bicycle=3	& tracktype=2 [0x0d road_class=4 road_speed=3 resolution 21]
highway=unclassified & class:bicycle=2	& tracktype=2 [0x0d road_class=3 road_speed=2 resolution 21]
highway=unclassified & class:bicycle=1	& tracktype=2 [0x0d road_class=2 road_speed=2 resolution 21]
highway=unclassified & class:bicycle=0	& tracktype=2 [0x0d road_class=2 road_speed=1 resolution 22]
highway=unclassified & class:bicycle=-1	& tracktype=2 [0x0d road_class=1 road_speed=1 resolution 22]
highway=unclassified & class:bicycle=-2	& tracktype=2 [0x0d road_class=0 road_speed=1 resolution 22]
highway=unclassified & class:bicycle=-3	& tracktype=2 [0x0e road_class=0 road_speed=0 resolution 22]


highway=unclassified & class:bicycle=3 	[0x0b road_class=4 road_speed=3 resolution 21 continue]
highway=unclassified & class:bicycle=2 	[0x0b road_class=4 road_speed=3 resolution 21 continue]
highway=unclassified & class:bicycle=3 	[0x01 road_class=4 road_speed=1 resolution 24 continue]
highway=unclassified & class:bicycle=2 	[0x01 road_class=4 road_speed=1 resolution 24 continue]
highway=unclassified & class:bicycle=3 	[0x01 road_class=3 road_speed=2 resolution 24]
highway=unclassified & class:bicycle=2 	[0x01 road_class=3 road_speed=2 resolution 24]
highway=unclassified & class:bicycle=1 	[0x0b road_class=4 road_speed=2 resolution 21] 
highway=unclassified & class:bicycle=0 	[0x0b road_class=3 road_speed=2 resolution 21]
highway=unclassified & class:bicycle=-1 	[0x0b road_class=1 road_speed=2 resolution 22]
highway=unclassified & class:bicycle=-2 	[0x07 road_class=0 road_speed=1 resolution 22]
highway=unclassified & class:bicycle=-3 	[0x07 road_class=0 road_speed=0 resolution 24]

( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=3	& tracktype=5 [0x0f road_class=2 road_speed=1 resolution 22]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=2	& tracktype=5 [0x12 road_class=1 road_speed=1 resolution 22]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=1	& tracktype=5 [0x12 road_class=1 road_speed=1 resolution 22]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=0	& tracktype=5 [0x12 road_class=0 road_speed=1 resolution 23]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=-1	& tracktype=5 [0x12 resolution 23]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=-2	& tracktype=5 [0x12 resolution 23]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=-3	& tracktype=5 [0x0e resolution 23]

( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=3	& tracktype=4 [0x0f road_class=3 road_speed=1 resolution 22]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=2	& tracktype=4 [0x0e road_class=2 road_speed=1 resolution 22]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=1	& tracktype=4 [0x0e road_class=1 road_speed=1 resolution 22]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=0	& tracktype=4 [0x0e road_class=0 road_speed=0 resolution 23]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=-1	& tracktype=4 [0x0e road_class=0 road_speed=0 resolution 23]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=-2	& tracktype=4 [0x0e resolution 23]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=-3	& tracktype=4 [0x0e resolution 23]

( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=3	& tracktype=3 [0x0d road_class=4 road_speed=1 resolution 24 continue]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=3	& tracktype=3 [0x0d road_class=4 road_speed=2 resolution 22]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=2	& tracktype=3 [0x0e road_class=3 road_speed=2 resolution 22]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=1	& tracktype=3 [0x0e road_class=1 road_speed=1 resolution 22]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=0	& tracktype=3 [0x0e road_class=0 road_speed=0 resolution 22]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=-1	& tracktype=3 [0x0e road_class=0 road_speed=0 resolution 22]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=-2	& tracktype=3 [0x0f resolution 23]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=-3	& tracktype=3 [0x0f resolution 23]

( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=3	& tracktype=2 [0x0d road_class=4 road_speed=1 resolution 24 continue]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=3	& tracktype=2 [0x0d road_class=4 road_speed=2 resolution 22]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=2	& tracktype=2 [0x0d road_class=3 road_speed=2 resolution 22]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=1	& tracktype=2 [0x0d road_class=2 road_speed=2 resolution 22]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=0	& tracktype=2 [0x0d road_class=1 road_speed=1 resolution 22]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=-1	& tracktype=2 [0x0d road_class=0 road_speed=1 resolution 22]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=-2	& tracktype=2 [0x0d road_class=0 road_speed=0 resolution 22]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=-3	& tracktype=2 [0x0e resolution 23]

( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=3	& tracktype=1 [0x0a road_class=4 road_speed=1 resolution 24 continue]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced )& class:bicycle=3	& tracktype=1 [0x0a road_class=4 road_speed=0 resolution 24 continue]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=2	& tracktype=1 [0x0a road_class=3 road_speed=1 resolution 24 continue]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=3	& tracktype=1 [0x0a road_class=4 road_speed=2 resolution 22]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=2	& tracktype=1 [0x0a road_class=3 road_speed=2 resolution 22]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=1	& tracktype=1 [0x0a road_class=2 road_speed=2 resolution 22]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=0	& tracktype=1 [0x0a road_class=1 road_speed=2 resolution 22]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=-1	& tracktype=1 [0x0a road_class=0 road_speed=1 resolution 22]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=-2	& tracktype=1 [0x0d road_class=0 road_speed=1 resolution 22]
( highway=service | highway=track | highway=byway | highway=road | highway=unsurfaced ) & class:bicycle=-3	& tracktype=1 [0x0d resolution 23]

bicycle=nope {set bicycle=no}

higwhay=unsurfaced & class:bicycle=3 	[0x0d road_class=4 road_speed=1 resolution 24 continue]
higwhay=unsurfaced & class:bicycle=2 	[0x0d road_class=4 road_speed=1 resolution 24 continue]
higwhay=unsurfaced & class:bicycle=3 	[0x0d road_class=4 road_speed=2 resolution 22]
higwhay=unsurfaced & class:bicycle=2 	[0x0d road_class=3 road_speed=2 resolution 22]
higwhay=unsurfaced & class:bicycle=1 	[0x0d road_class=1 road_speed=2 resolution 22] 
higwhay=unsurfaced & class:bicycle=0 	[0x0d road_class=1 road_speed=1 resolution 22]
higwhay=unsurfaced & class:bicycle=-1 	[0x0d road_class=0 road_speed=1 resolution 22]
higwhay=unsurfaced & class:bicycle=-2 	[0x0d road_class=0 road_speed=0 resolution 23]
higwhay=unsurfaced & class:bicycle=-3 	[0x0e resolution 23]

highway=track & class:bicycle=3 	[0x0a road_class=4 road_speed=1 resolution 24 continue]
highway=track & class:bicycle=2 	[0x0a road_class=4 road_speed=1 resolution 24 continue]
highway=track & class:bicycle=3 	[0x0a road_class=4 road_speed=2 resolution 22]
highway=track & class:bicycle=2 	[0x0a road_class=3 road_speed=2 resolution 22]
highway=track & class:bicycle=1 	[0x0a road_class=2 road_speed=2 resolution 22]
highway=track & (class:bicycle=0 | class:bicycle=-1) [0x10009 resolution 23-22 continue]
highway=track & (class:bicycle=0 | class:bicycle=-1) [0x11004 resolution 24 continue]
highway=track & class:bicycle=0 	[0x01 road_class=0 road_speed=1 resolution 24]
highway=track & class:bicycle=-1 	[0x01 road_class=0 road_speed=1 resolution 24]
highway=track & (class:bicycle=-2 | class:bicycle=-3) [0x10009 resolution 23 continue]
highway=track & class:bicycle=-2 	[0x01 road_class=0 road_speed=0 resolution 24]
highway=track & class:bicycle=-3 	[0x01 resolution 24]

higwhay=byway & class:bicycle=3 	[0x0a road_class=4 road_speed=1 resolution 24 continue]
higwhay=byway & class:bicycle=2 	[0x0a road_class=4 road_speed=1 resolution 24 continue]
higwhay=byway & class:bicycle=3 	[0x0a road_class=4 road_speed=2 resolution 22]
higwhay=byway & class:bicycle=2 	[0x0a road_class=3 road_speed=2 resolution 22]
higwhay=byway & class:bicycle=1 	[0x0a road_class=2 road_speed=2 resolution 22] 
higwhay=byway & class:bicycle=0 	[0x0a road_class=0 road_speed=1 resolution 22]
higwhay=byway & class:bicycle=-1 	[0x0a road_class=0 road_speed=1 resolution 22]
higwhay=byway & class:bicycle=-2 	[0x0d road_class=0 road_speed=0 resolution 23]
higwhay=byway & class:bicycle=-3 	[0x0e resolution 23]

higwhay=service & class:bicycle=3 	[0x10 road_class=4 road_speed=1 resolution 24 continue]
higwhay=service & class:bicycle=2 	[0x10 road_class=4 road_speed=1 resolution 24 continue]
higwhay=service & class:bicycle=3 	[0x10 road_class=4 road_speed=2 resolution 22]
higwhay=service & class:bicycle=2 	[0x10 road_class=3 road_speed=2 resolution 22]
higwhay=service & class:bicycle=1 	[0x10 road_class=2 road_speed=2 resolution 22] 
higwhay=service & class:bicycle=0 	[0x10 road_class=0 road_speed=1 resolution 22]
higwhay=service & class:bicycle=-1 	[0x10 road_class=0 road_speed=1 resolution 22]
higwhay=service & class:bicycle=-2 	[0x0d road_class=0 road_speed=0 resolution 23]
higwhay=service & class:bicycle=-3 	[0x0e resolution 23]

higwhay=road & class:bicycle=3 	[0x0a road_class=4 road_speed=1 resolution 24 continue]
higwhay=road & class:bicycle=2 	[0x0a road_class=4 road_speed=1 resolution 24 continue]
higwhay=road & class:bicycle=3 	[0x0a road_class=4 road_speed=2 resolution 22]
higwhay=road & class:bicycle=2 	[0x0a road_class=3 road_speed=2 resolution 22]
higwhay=road & class:bicycle=1 	[0x10 road_class=2 road_speed=2 resolution 22] 
higwhay=road & class:bicycle=0 	[0x10 road_class=0 road_speed=1 resolution 22]
higwhay=road & class:bicycle=-1 [0x10 road_class=0 road_speed=1 resolution 22]
higwhay=road & class:bicycle=-2 [0x0d road_class=0 road_speed=0 resolution 23]
higwhay=road & class:bicycle=-3 [0x0e resolution 23]



( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & mtb:scale=1		[0x12 resolution 22]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & mtb:scale>1		[0x12 resolution 23]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & ( tracktype=1 & ( bicycle=designated | bicycle=yes | bicycle=permissive ))	[0x0a road_class=2 road_speed=2 resolution 22 continue]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & ( tracktype=2 & ( bicycle=designated | bicycle=yes | bicycle=permissive ))	[0x0d road_class=2 road_speed=1 resolution 22]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & ( tracktype=3 & ( bicycle=designated | bicycle=yes | bicycle=permissive ))	[0x0e road_class=1 road_speed=1 resolution 22]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & ( tracktype=4 & ( bicycle=designated | bicycle=yes | bicycle=permissive ))	[0x0f road_class=0 road_speed=0 resolution 22]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & ( tracktype=5 & ( bicycle=designated | bicycle=yes | bicycle=permissive ))	[0x12 road_class=0 road_speed=0 resolution 23]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & tracktype=extremecarver [0x12 resolution 23]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & sac_scale=demanding_mountain_hiking		[0x12 resolution 23]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & sac_scale=alpine_hiking					[0x12 resolution 24]

( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & bicycle=designated		[0x01 road_class=3 road_speed=2 resolution 24 continue]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & bicycle=designated		[0x11004 resolution 22]

	
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & ( tracktype=1 & (bicycle=no | bicycle=nope) )			[0x0a road_class=1 road_speed=1 resolution 22]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & ( tracktype=2 & (bicycle=no | bicycle=nope) )			[0x0d road_class=0 road_speed=0 resolution 23]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & ( tracktype=3 & (bicycle=no | bicycle=nope) )			[0x0e road_class=0 road_speed=0 resolution 23]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & ( tracktype=4 & (bicycle=no | bicycle=nope) )			[0x0f road_class=0 road_speed=0 resolution 23]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & ( tracktype=5 & (bicycle=no | bicycle=nope) )			[0x12 road_class=0 road_speed=0 resolution 23]

( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & (bicycle=no | bicycle=nope)							 		[0x01 road_class=0 road_speed=0 resolution 24 continue]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & (bicycle=no | bicycle=nope)							 		[0x11004 resolution 23]
	
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & tracktype=1 								[0x0a road_class=3 road_speed=2 resolution 22]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & tracktype=2 								[0x0d road_class=1 road_speed=0 resolution 22]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & tracktype=3 								[0x0e road_class=0 road_speed=0 resolution 22]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & tracktype=4 								[0x0f road_class=0 road_speed=0 resolution 22]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & tracktype=5 								[0x12 road_class=0 road_speed=0 resolution 22]

( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=service ) & sac_scale=hiking																		[0x0e road_class=0 road_speed=0 resolution 22]
( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=unclassified | highway=service ) & sac_scale=mountain_hiking						[0x0e road_class=0 road_speed=0 resolution 22]


( highway=track | highway=unsurfaced | highway=road | highway=byway | highway=service ) & mtb:scale=0 [0x0f road_class=0 road_speed=0  resolution 22]



highway=cycletrack &  route=bicycle 	[0x03 road_class=4 road_speed=2 resolution 21]
highway=cycletrack & ( extremecarver=mr | route=mtb ) 			[0x03 road_class=4 road_speed=2 resolution 21]
highway=cycletrack & highway=footway	& bicycle=designated 	[0x03 road_class=3 road_speed=2 resolution 22]
highway=cycletrack & highway=footway						 	[0x03 road_class=3 road_speed=2 resolution 22]
highway=cycletrack											 	[0x03 road_class=3 road_speed=2 resolution 22]


highway=track 					& route=bicycle							[0x01 road_class=2 road_speed=2 resolution 24 continue]
highway=track 					& route=bicycle							[0x11004 resolution 23-22]
highway=unsurfaced 				& route=bicycle							[0x0d road_class=1 road_speed=1 resolution 22]
highway=unclassified 			& route=bicycle							[0x0b road_class=4 road_speed=2 resolution 22]
highway=byway 					& route=bicycle							[0x0a road_class=3 road_speed=1 resolution 22]
highway=service & access=yes	& route=bicycle							[0x10 road_class=1 road_speed=2 resolution 22]
highway=service & access=no	& route=bicycle {add taxi=no; set access=yes}	[0x10 road_class=1 road_speed=2 resolution 22]
highway=service 				& route=bicycle							[0x10 road_class=1 road_speed=2 resolution 22]
highway=construction			& route=bicycle							[0x01 road_class=0 road_speed=1 resolution 24 continue]
highway=construction			& route=bicycle							[0x10503 resolution 21]
highway=road 					& route=bicycle							[0x01 road_class=3 road_speed=2 resolution 24 continue]
highway=road 					& route=bicycle							[0x10808 resolution 22]

highway=unclassified 			& ( extremecarver=mr | route=mtb )									[0x0b road_class=4 road_speed=2 resolution 22]
highway=byway 					& ( extremecarver=mr | route=mtb )									[0x0a road_class=0 road_speed=1 resolution 22]


highway=track & fixme='check import' 								[0x0f road_class=0 road_speed=0 resolution 24]
highway=track & fixme=* & import=* 									[0x0f road_class=0 road_speed=0 resolution 24]
highway=track & fixme=*			 									[0x01 road_class=0 road_speed=0 resolution 24 continue]
highway=track & fixme=*			 									[0x10009 resolution 22]
highway=track 														[0x10009 resolution 23-22 continue]
highway=track 														[0x01 road_class=0 road_speed=1 resolution 24 continue]
highway=track 														[0x11004 resolution 24]
highway=unsurfaced 													[0x0d road_class=0 road_speed=1 resolution 22]
highway=unclassified & fixme=*										[0x07 road_class=2 road_speed=2 resolution 23]
highway=unclassified 												[0x0b road_class=3 road_speed=2 resolution 24 continue]
highway=unclassified												[0x07 resolution 23-21]
highway=ford 			{add taxi=no; add mkgmap:unpaved=1}			[0x0d road_class=0 road_speed=0 resolution 22]
highway=byway 														[0x0a road_class=0 road_speed=1 resolution 22]

bicycle=no & importantaccess!=yes {set bicycle=nope}

highway=residential & fixme='check import' 							[0x07 road_class=0 road_speed=0 resolution 24]
highway=residential & fixme=* & import=* 							[0x07 road_class=0 road_speed=0 resolution 24]
highway=residential & fixme=*			 							[0x07 road_class=0 road_speed=1 resolution 24]
highway=residential 					 							[0x07 road_class=0 road_speed=1 resolution 24]


highway=service & access=yes													[0x10 road_class=0 road_speed=2 resolution 22]
highway=service & access=no	& bicycle=* & bicycle!=nope							[0x10 road_class=0 road_speed=2 resolution 22]
highway=service & access=no	& foot=* & foot!=no	{add mkgmap:unpaved=1}			[0x10 road_class=0 road_speed=0 resolution 22]
highway=service & access=no				{add mkgmap:unpaved=1}					[0x10 road_class=0 road_speed=0 resolution 22]
highway=service 																[0x10 road_class=0 road_speed=1 resolution 22]
highway=services 					{add taxi=no; add mkgmap:unpaved=1}			[0x10 road_class=0 road_speed=0 resolution 23]
highway=construction & tunnel!=yes	{add taxi=no; add mkgmap:unpaved=1}			[0x10503 resolution 22]
highway=road 						{add taxi=no}								[0x01 road_class=1 road_speed=1 resolution 24 continue]
highway=road 						{add taxi=no}								[0x11008 resolution 22]
highway=turning_circle															[0x01 road_class=0 road_speed=0 resolution 24 continue]
highway=turning_circle															[0x10008 resolution 22]
(highway=unknown	| highway=undefined ) {add taxi=no; add mkgmap:unpaved=1}	[0x01 road_class=0 road_speed=1 resolution 24 continue]
(highway=unknown	| highway=undefined ) 										[0x10808 road_class=0 road_speed=1 resolution 22]

highway=crossing																[0x07 road_class=2 road_speed=1 resolution 24 continue]
highway=bridge																	[0x07 road_class=2 road_speed=1 resolution 24 continue]
highway=crossing																[0x11009 resolution 23-22]
highway=bridge																	[0x11009 resolution 23-22]

highway=driveway							{add taxi=no; add mkgmap:unpaved=1}	[0x01 road_class=0 road_speed=0 resolution 24 continue]
highway=driveway																[0x1100a resolution 22]
highway=pier | man_made=pier									{add taxi=no}	[0x07 road_class=0 road_speed=0 resolution 24 continue]
(highway=incline | highway=incline_steep)	{add taxi=no; add mkgmap:unpaved=1}	[0x01 road_class=2 road_speed=2 resolution 24 continue]
highway=fixme 								{add taxi=no; add mkgmap:unpaved=1}	[0x01 road_class=0 road_speed=0 resolution 24 continue]
highway=pier | man_made=pier													[0x10008 resolution 22]
(highway=incline | highway=incline_steep)										[0x10008 resolution 22]
highway=fixme 																	[0x10008 resolution 22]

highway=cyclelane &  (route=bicycle ) {add taxi=no}	[0x03 road_class=3 road_speed=2 resolution 21]
highway=cyclelane & ( extremecarver=mr | route=mtb )		{add taxi=no}	[0x03 road_class=3 road_speed=2 resolution 22]
highway=cyclelane & highway=footway	& bicycle=designated 	{add taxi=no}	[0x16 road_class=2 road_speed=2 resolution 22]
highway=cyclelane & highway=footway						 	{add taxi=no}	[0x16 road_class=1 road_speed=2 resolution 22]
highway=cyclelane											{add taxi=no} 	[0x03 road_class=1 road_speed=2 resolution 22]

# experimental - add invisible sidewalks
highway=sidewalk {add taxi=no} [0x00 road_class=0 road_speed=0 resolution 24]


More information about the mkgmap-dev mailing list