| 1 |
# ------------------------------------------------------------------- |
| 2 |
# This is the default mkgmap style file for applying rules on |
| 3 |
# OSM relations. Usually you will set tags on the |
| 4 |
# elements that make up the relation, and the tags will be |
| 5 |
# processed by the rules defined in the "points" or "lines" files. |
| 6 |
# |
| 7 |
# Any line prefaced with # is a comment and will not be applied. |
| 8 |
# Each line is a rule, of the generalised format: |
| 9 |
# OSM_tag(s)_to_match [Garmin_type_code resolution] |
| 10 |
# See http://wiki.openstreetmap.org/wiki/Mkgmap/help/style_rules |
| 11 |
# and http://wiki.openstreetmap.org/wiki/Mkgmap/help/Custom_styles |
| 12 |
# for more information. |
| 13 |
|
| 14 |
# Names of administrative boundaries. |
| 15 |
# We could want to sort the relations in ascending order of admin_level |
| 16 |
# and alphabetically by name first. |
| 17 |
# Currently, the matching relations will be processed and the names |
| 18 |
# appended to the boundary lines in an arbitrary order. |
| 19 |
|
| 20 |
(type=boundary | type=multipolygon) & boundary=administrative & name=* |
| 21 |
{ apply |
| 22 |
{ |
| 23 |
set mkgmap:boundary_name='$(mkgmap:boundary_name)/${name}' | '${name}'; |
| 24 |
} |
| 25 |
} |
| 26 |
|
| 27 |
# Public transportation routes. |
| 28 |
# We could want to sort the matching relations by ref first. |
| 29 |
type=route |
| 30 |
& (route=bus|route=trolleybus|route=ferry|route=subway|route=train|route=tram) |
| 31 |
& (ref=* | name=*) |
| 32 |
{ |
| 33 |
add ref='${name}'; # if ref is missing, use name |
| 34 |
# Append the ref of the route relation to the route_ref attribute of |
| 35 |
# the member nodes recursively (even to members of subrelations). |
| 36 |
# Stops can be grouped within subrelations comprising the vehicle |
| 37 |
# stop node and the passenger wait node. |
| 38 |
apply { # node role ~ '(start_|end_)stop' |
| 39 |
set route_ref='$(route_ref);${ref|not-contained:;:route_ref}' | '$(route_ref)' | '${ref}'; |
| 40 |
# In route relations, stops may be defined as relations that group |
| 41 |
# the passenger wait area and the vehicle stop area. If such |
| 42 |
# subrelations exist, copy the ref to them too. |
| 43 |
set mkgmap:relref='${ref}'; |
| 44 |
|
| 45 |
apply role=passengers { |
| 46 |
set route_ref='$(route_ref),${mkgmap:relref}' | '${mkgmap:relref}'; |
| 47 |
} |
| 48 |
|
| 49 |
delete mkgmap:relref; |
| 50 |
} |
| 51 |
# We could want to copy the route relation name to unnamed route=ferry ways. |
| 52 |
# apply way { add name='${name}' } |
| 53 |
} |
| 54 |
|
| 55 |
# European E-Road network |
| 56 |
route=road & network=e-road { |
| 57 |
apply { |
| 58 |
add ref='${ref}'; |
| 59 |
add int_ref='${int_ref}'; |
| 60 |
add network='e-road'; |
| 61 |
add mkgmap:fast_road=yes; |
| 62 |
} |
| 63 |
} |
| 64 |
|
| 65 |
#USA road network |
| 66 |
type=route & route=road & historic!=yes & network=US:I |
| 67 |
{ |
| 68 |
apply { |
| 69 |
set mkgmap:us_interstate='$(mkgmap:us_interstate);${ref|not-contained:;:mkgmap:us_interstate}' | '$(mkgmap:us_interstate)' | '${ref}'; |
| 70 |
add network='US:I'; |
| 71 |
add mkgmap:fast_road=yes; |
| 72 |
} |
| 73 |
} |
| 74 |
type=route & route=road & historic!=yes & network~'US:I:.*' |
| 75 |
{ |
| 76 |
apply { |
| 77 |
add network='US:I'; |
| 78 |
add mkgmap:fast_road=yes; |
| 79 |
} |
| 80 |
} |
| 81 |
type=route & route=road & historic!=yes & network=US:US |
| 82 |
{ |
| 83 |
apply { |
| 84 |
set mkgmap:us_usroute='$(mkgmap:us_usroute);${ref|not-contained:;:mkgmap:us_usroute}' | '$(mkgmap:us_usroute)' | '${ref}'; |
| 85 |
add network='US:US'; |
| 86 |
add mkgmap:fast_road=yes; |
| 87 |
} |
| 88 |
} |
| 89 |
type=route & route=road & historic!=yes & network~'US:US:.*' |
| 90 |
{ |
| 91 |
apply { |
| 92 |
add network='US:US'; |
| 93 |
add mkgmap:fast_road=yes; |
| 94 |
} |
| 95 |
} |
| 96 |
type=route & route=road & historic!=yes & network~'US:.*' & !(network=US:I | network=US:US | network~'US:.*:.*') |
| 97 |
{ |
| 98 |
apply { |
| 99 |
add mkgmap:us_state='$(mkgmap:us_state);${ref|not-contained:;:mkgmap:us_state}' | '$(mkgmap:us_state)' | '${ref}'; |
| 100 |
add network='${network}'; |
| 101 |
} |
| 102 |
} |
| 103 |
|
| 104 |
#Trans African Highway |
| 105 |
type=route & route=road & historic!=yes & (network~'TAH.*' | ref~'TAH.*' | network~'Trans.African Highway') |
| 106 |
{ |
| 107 |
apply { |
| 108 |
add network='TAH'; |
| 109 |
add int_ref='${ref}'; |
| 110 |
add mkgmap:fast_road=yes; |
| 111 |
} |
| 112 |
} |
| 113 |
|
| 114 |
#Asian Highway |
| 115 |
type=route & route=road & historic!=yes & (network=AsianHighway | network=AH) |
| 116 |
{ |
| 117 |
apply { |
| 118 |
add network='AsianHighway'; |
| 119 |
add int_ref='${ref}'; |
| 120 |
add mkgmap:fast_road=yes; |
| 121 |
} |
| 122 |
} |
| 123 |
|
| 124 |
#any highway |
| 125 |
type=route & route=road & historic!=yes & ref=* |
| 126 |
{ |
| 127 |
apply { |
| 128 |
add ref='${ref}'; |
| 129 |
} |
| 130 |
} |