# ------------------------------------------------------------------- # This is the default mkgmap style file for applying rules on # OSM relations. Usually you will set tags on the # elements that make up the relation, and the tags will be # processed by the rules defined in the "points" or "lines" files. # # Any line prefaced with # is a comment and will not be applied. # Each line is a rule, of the generalised format: # OSM_tag(s)_to_match [Garmin_type_code resolution] # See http://wiki.openstreetmap.org/wiki/Mkgmap/help/style_rules # and http://wiki.openstreetmap.org/wiki/Mkgmap/help/Custom_styles # for more information. # Names of administrative boundaries. # We could want to sort the relations in ascending order of admin_level # and alphabetically by name first. # Currently, the matching relations will be processed and the names # appended to the boundary lines in an arbitrary order. (type=boundary | type=multipolygon) & boundary=administrative & name=* { apply { set mkgmap:boundary_name='$(mkgmap:boundary_name)/${name}' | '${name}'; } } # Public transportation routes. # We could want to sort the matching relations by ref first. type=route & (route=bus|route=trolleybus|route=ferry|route=subway|route=train|route=tram) & (ref=* | name=*) { add ref='${name}'; # if ref is missing, use name # Append the ref of the route relation to the route_ref attribute of # the member nodes recursively (even to members of subrelations). # Stops can be grouped within subrelations comprising the vehicle # stop node and the passenger wait node. apply { # node role ~ '(start_|end_)stop' set route_ref='$(route_ref);${ref|not-contained:;:route_ref}' | '$(route_ref)' | '${ref}'; # In route relations, stops may be defined as relations that group # the passenger wait area and the vehicle stop area. If such # subrelations exist, copy the ref to them too. set mkgmap:relref='${ref}'; apply role=passengers { set route_ref='$(route_ref),${mkgmap:relref}' | '${mkgmap:relref}'; } delete mkgmap:relref; } # We could want to copy the route relation name to unnamed route=ferry ways. # apply way { add name='${name}' } } # European E-Road network route=road & network=e-road { apply { add ref='${ref}'; add int_ref='${int_ref}'; add network='e-road'; add mkgmap:fast_road=yes; } } #USA road network type=route & route=road & historic!=yes & network=US:I { apply { set mkgmap:us_interstate='$(mkgmap:us_interstate);${ref|not-contained:;:mkgmap:us_interstate}' | '$(mkgmap:us_interstate)' | '${ref}'; add network='US:I'; add mkgmap:fast_road=yes; } } type=route & route=road & historic!=yes & network~'US:I:.*' { apply { add network='US:I'; add mkgmap:fast_road=yes; } } type=route & route=road & historic!=yes & network=US:US { apply { set mkgmap:us_usroute='$(mkgmap:us_usroute);${ref|not-contained:;:mkgmap:us_usroute}' | '$(mkgmap:us_usroute)' | '${ref}'; add network='US:US'; add mkgmap:fast_road=yes; } } type=route & route=road & historic!=yes & network~'US:US:.*' { apply { add network='US:US'; add mkgmap:fast_road=yes; } } type=route & route=road & historic!=yes & network~'US:.*' & !(network=US:I | network=US:US | network~'US:.*:.*') { apply { add mkgmap:us_state='$(mkgmap:us_state);${ref|not-contained:;:mkgmap:us_state}' | '$(mkgmap:us_state)' | '${ref}'; add network='${network}'; } } #Trans African Highway type=route & route=road & historic!=yes & (network~'TAH.*' | ref~'TAH.*' | network~'Trans.African Highway') { apply { add network='TAH'; add int_ref='${ref}'; add mkgmap:fast_road=yes; } } #Asian Highway type=route & route=road & historic!=yes & (network=AsianHighway | network=AH) { apply { add network='AsianHighway'; add int_ref='${ref}'; add mkgmap:fast_road=yes; } } #any highway type=route & route=road & historic!=yes & ref=* { apply { add ref='${ref}'; } } route=bicycle & ( network=icn | icn=yes ) { apply { add icn=yes; }} route=bicycle & ( network=ncn | ncn=yes ) { apply { add ncn=yes; }} route=bicycle & ( network=rcn | rcn=yes ) { apply { add rcn=yes; }} route=bicycle & ( network=tcn | tcn=yes ) { apply { add tcn=yes; }} route=bicycle & ( network=lcn | lcn=yes ) { apply { add lcn=yes; }} route=bicycle { apply {add name='cycle ${ref}'} } (route=hiking | route=foot) & (color=red | colour=red | kct_red=yes | kct_red=major | kct_red ~ '\S') { apply {add marked_trail=red;}} (route=hiking | route=foot) & (color=green | colour=green | kct_green=yes | kct_green=major | kct_green=*) { apply {add marked_trail=green;}} (route=hiking | route=foot) & (color=blue | colour=blue | kct_blue=yes | kct_blue=major | kct_blue ~ '\S') { apply {add marked_trail=blue;}} (route=hiking | route=foot) & (color=yellow | colour=yellow | kct_yellow=yes | kct_yellow=major | kct_yellow ~ '\S') { apply {add marked_trail=yellow;}} (route=hiking | route=foot) & (color=learning | colour=learning | kct_learning=yes | kct_learning=major) { apply {add marked_trail=learning;}}