New upstream version 0.0.0+svn4257
Bas Couwenberg
5 years ago
0 | svn.version: 4245 | |
1 | build.timestamp: 2018-10-19T06:22:23+0100 | |
0 | svn.version: 4257 | |
1 | build.timestamp: 2018-11-26T14:51:21+0000 |
13 | 13 | (aeroway=taxiway | aeroway=taxilane) & highway!=* & is_closed()=false {name '${ref}'} [0x27 resolution 24] |
14 | 14 | |
15 | 15 | # Assign the street name for house number search |
16 | highway=* & name=* { set mkgmap:street='${name}' } | |
16 | highway=* & name=* {set mkgmap:street='${name}'} | |
17 | 17 | |
18 | 18 | # Mark highways with the toll flag |
19 | highway=* & (toll=yes|toll=true) { set mkgmap:toll=yes } | |
19 | highway=* & (toll=yes | toll=true) {set mkgmap:toll=yes} | |
20 | 20 | |
21 | 21 | # mark multipolygons as area |
22 | 22 | highway=* & mkgmap:mp_created=true {add area=yes} |
23 | 23 | |
24 | 24 | # Hide proposed ways |
25 | (highway=proposed | highway=proposal | highway=planned | highway ~ '.*proposed.*') {delete highway;delete junction} | |
25 | highway=proposed | highway=proposal | highway=planned | highway~'.*proposed.*' {delete highway; delete junction} | |
26 | 26 | # Hide removed ways |
27 | (highway=razed | highway=dismantled) {deletealltags} | |
27 | highway=razed | highway=dismantled {deletealltags} | |
28 | 28 | # Hide abandoned ways. Abandoned highways have some evidence of their former existence but are no longer used. These |
29 | 29 | # abandoned highways could be useful in topographical maps. |
30 | 30 | # https://wiki.openstreetmap.org/wiki/Key:abandoned: |
31 | ((abandoned:highway=* & highway!=*) | highway=abandoned) {deletealltags} | |
31 | (abandoned:highway=* & highway!=*) | highway=abandoned {deletealltags} | |
32 | 32 | # Hide other non-existent ways |
33 | (highway=unbuilt | highway=neverbuilt | highway=rejected | highway ~ 'x-.*') {delete highway;delete junction} | |
33 | highway=unbuilt | highway=neverbuilt | highway=rejected | highway~'x-.*' {delete highway; delete junction} | |
34 | 34 | # Remove highway tag from ways which are not suitable for routing |
35 | highway=traffic_signals | highway=junction | highway=island | highway=centre_line | highway=traffic_island | highway=stopline {delete highway} | |
35 | highway=traffic_signals | highway=junction | highway=island | highway=centre_line | highway=traffic_island | highway=stopline | |
36 | {delete highway} | |
36 | 37 | highway=piste | highway=ski {delete highway} |
37 | 38 | highway=no | highway=none {delete highway} |
38 | ||
39 | ||
39 | 40 | # Hide unaccessible tunnels |
40 | highway=* & tunnel=yes & (access=private|access=no) | |
41 | & foot!=* & bicycle!=* {delete highway;delete junction} | |
41 | highway=* & tunnel=yes & (access=private | access=no) & foot!=* & bicycle!=* {delete highway; delete junction} | |
42 | 42 | # Disable dead-end-checks for unaccessible oneways |
43 | highway=* & oneway=yes & (access=private|access=no) | |
44 | {add mkgmap:dead-end-check=false} | |
43 | highway=* & oneway=yes & (access=private | access=no) {add mkgmap:dead-end-check=false} | |
45 | 44 | # Validation-like checks (uncomment to enable) |
46 | #highway=motorway_link & oneway!=yes & oneway!=no { echo "motorway_link lacks oneway" } | |
47 | highway=motorway|highway=motorway_link { add oneway=yes; add mkgmap:numbers=false } | |
45 | #highway=motorway_link & oneway!=yes & oneway!=no {echo "motorway_link lacks oneway"} | |
46 | highway=motorway | highway=motorway_link {add oneway=yes; add mkgmap:numbers=false} | |
48 | 47 | |
49 | 48 | # start of rules for process-exits and process-destination options |
50 | 49 | # which may add info to a part of these highway=*_link roads: |
51 | 50 | # motorway_link, trunk_link, primary_link, secondary_link, tertiary_link |
52 | # build destination hint | |
53 | mkgmap:dest_hint=* | |
54 | { set dest_hint = '${destination:ref|subst: =>} ${mkgmap:dest_hint|subst:;=> |subst:/=> }' | | |
55 | '${ref|subst: =>} ${mkgmap:dest_hint|subst:;=> |subst:/=> }' | | |
56 | '${mkgmap:dest_hint|subst:;=> |subst:/=> }'; | |
57 | } | |
58 | # build exit hint | |
59 | mkgmap:exit_hint=true | |
60 | { set exit_hint = 'Exit ${mkgmap:exit_hint_ref} ${mkgmap:exit_hint_name}' | | |
61 | 'Exit ${mkgmap:exit_hint_ref} ${mkgmap:exit_hint_exit_to}' | | |
62 | 'Exit ${mkgmap:exit_hint_exit_to}' | | |
63 | 'Exit ${mkgmap:exit_hint_name}' | | |
64 | 'Exit ${mkgmap:exit_hint_ref}'; | |
65 | } | |
66 | ||
67 | # use destination hint and/or exit hint to build name | |
68 | (mkgmap:exit_hint=true | mkgmap:dest_hint=*) | |
69 | { name '${exit_hint} ${dest_hint}' | '${dest_hint}' | '${exit_hint}' } | |
51 | # build destination hint | |
52 | mkgmap:dest_hint=* { | |
53 | set tmp:dest_hint='${destination:ref|subst: =>} ${mkgmap:dest_hint|subst:;=> |subst:/=> }' | | |
54 | '${ref|subst: =>} ${mkgmap:dest_hint|subst:;=> |subst:/=> }' | | |
55 | '${mkgmap:dest_hint|subst:;=> |subst:/=> }'; | |
56 | } | |
57 | # build exit hint | |
58 | mkgmap:exit_hint=true { | |
59 | set tmp:exit_hint='Exit ${mkgmap:exit_hint_ref} ${mkgmap:exit_hint_name}' | | |
60 | 'Exit ${mkgmap:exit_hint_ref} ${mkgmap:exit_hint_exit_to}' | | |
61 | 'Exit ${mkgmap:exit_hint_exit_to}' | | |
62 | 'Exit ${mkgmap:exit_hint_name}' | | |
63 | 'Exit ${mkgmap:exit_hint_ref}'; | |
64 | } | |
65 | # use destination hint and/or exit hint to build name | |
66 | mkgmap:exit_hint=true | mkgmap:dest_hint=* {name '${tmp:exit_hint} ${tmp:dest_hint}' | '${tmp:dest_hint}' | '${tmp:exit_hint}'} | |
70 | 67 | # end of rules for process-exits and process-destination options |
71 | 68 | |
72 | 69 | # Flag paved roads |
73 | highway=* & (surface=asphalt | surface=paved | surface=sett | | |
74 | surface=concrete | surface=concrete:lanes | surface=concrete:plates | | |
75 | surface=paving_stones | surface=cobblestone | | |
76 | surface=cobblestone:flattened | surface=metal | surface=wood) | |
77 | { set mkgmap:unpaved=0 } | |
78 | highway=* & tracktype=grade1 & surface!=* { set mkgmap:unpaved=0 } | |
70 | highway=* & (surface=asphalt | surface=paved | surface=sett | | |
71 | surface=concrete | surface=concrete:lanes | surface=concrete:plates | | |
72 | surface=paving_stones | surface=cobblestone | | |
73 | surface=cobblestone:flattened | surface=metal | surface=wood) | |
74 | {set mkgmap:unpaved=0} | |
75 | highway=* & tracktype=grade1 & surface!=* {set mkgmap:unpaved=0} | |
79 | 76 | |
80 | 77 | # Flag unpaved roads. |
81 | highway=* & mkgmap:unpaved!=0 & ( | |
78 | highway=* & mkgmap:unpaved!=0 & ( | |
82 | 79 | surface=* | |
83 | mtb:scale=* | | |
84 | tracktype ~ 'grade[2-6]') | |
85 | { add mkgmap:unpaved=1 } | |
80 | mtb:scale=* | | |
81 | tracktype~'grade[2-6]') | |
82 | {add mkgmap:unpaved=1} | |
86 | 83 | highway=* & ( |
87 | mtb:scale ~ '[2-6].' | | |
88 | sac_scale ~ '.*(mountain|alpine)_hiking' | | |
84 | mtb:scale~'[2-6].' | | |
85 | sac_scale~'.*(mountain|alpine)_hiking' | | |
89 | 86 | sport=via_ferrata) |
90 | { set mkgmap:unpaved=1 } | |
91 | (highway=bridleway | highway=path | highway=track) & mkgmap:unpaved!=0 { add mkgmap:unpaved=1 } | |
92 | (highway=unsurfaced | highway=via_ferrata) { set mkgmap:unpaved=1 } | |
93 | ||
94 | highway=* & mkgmap:unpaved!=1 & smoothness ~ '.*(bad|horrible|impassable)' { add mkgmap:road-speed = '-2' } | |
87 | {set mkgmap:unpaved=1} | |
88 | (highway=bridleway | highway=path | highway=track) & mkgmap:unpaved!=0 {add mkgmap:unpaved=1} | |
89 | (highway=unsurfaced | highway=via_ferrata) {set mkgmap:unpaved=1} | |
90 | ||
91 | highway=* & mkgmap:unpaved!=1 & smoothness~'.*(bad|horrible|impassable)' {add mkgmap:road-speed='-2'} | |
95 | 92 | |
96 | 93 | # Good ways without relation |
97 | highway=* & mkgmap:fast_road!=* & (int_ref=* | network=e-road | network=AH | network=TAH | network=US:I | network=US:US) {add mkgmap:fast_road=yes} | |
94 | highway=* & mkgmap:fast_road!=* & (int_ref=* | network=e-road | network=AH | network=TAH | network=US:I | network=US:US) | |
95 | {add mkgmap:fast_road=yes} | |
98 | 96 | # Not best for car routing |
99 | highway=* & (access=hov | hov=designated | oneway=reversible) {set mkgmap:road-class=-2; set mkgmap:road-speed=-2; delete mkgmap:fast_road} | |
97 | highway=* & (access=hov | hov=designated | oneway=reversible) | |
98 | {set mkgmap:road-class=-2; set mkgmap:road-speed=-2; delete mkgmap:fast_road} | |
100 | 99 | |
101 | 100 | # Convert generic path to most specific |
102 | highway=footway & snowplowing!=no | |
103 | & (bicycle=yes|bicycle=designated|bicycle=permissive|bicycle=official) | |
104 | {set highway=cycleway; set bicycle=yes; set foot=yes} | |
105 | highway=path & snowplowing!=no | |
106 | & (bicycle=designated|bicycle=permissive|bicycle=official) | |
107 | {set highway=cycleway; set bicycle=yes} | |
108 | highway=path & (horse=designated|horse=permissive|horse=official) | |
109 | {set highway=bridleway; set horse=yes} | |
110 | ||
111 | leisure=track & area!=yes | |
112 | {add highway=footway; name '${name} (${sport})' | '${name}'} | |
113 | (man_made=pier | man_made=piste:halfpipe) & area!=yes | |
114 | {add highway=footway; name '${ref} ${name}' | '${ref}' | '${name}' } | |
101 | highway=footway & snowplowing!=no & (bicycle=yes | bicycle=designated | bicycle=permissive | bicycle=official) | |
102 | {set highway=cycleway; set bicycle=yes; set foot=yes} | |
103 | highway=path & snowplowing!=no & (bicycle=designated | bicycle=permissive | bicycle=official) | |
104 | {set highway=cycleway; set bicycle=yes} | |
105 | highway=path & (horse=designated | horse=permissive | horse=official) | |
106 | {set highway=bridleway; set horse=yes} | |
107 | ||
108 | leisure=track & area!=yes {add highway=footway; name '${name} (${sport})' | '${name}'} | |
109 | (man_made=pier | man_made=piste:halfpipe) & area!=yes {add highway=footway; name '${ref} ${name}' | '${ref}' | '${name}'} | |
115 | 110 | |
116 | 111 | # Roundabouts |
117 | 112 | junction=roundabout & (highway=trunk | highway=trunk_link) [0x0c road_class=4 road_speed=2 resolution 24 continue] |
138 | 133 | # Ways that may or may not be useable |
139 | 134 | |
140 | 135 | # Treat ways under construction almost as highway=path, see also extra rule in inc/access |
141 | highway=construction { add mkgmap:dead-end-check = false; } | |
142 | [0x16 road_class=0 road_speed=0 resolution 23] | |
136 | highway=construction {add mkgmap:dead-end-check=false} [0x16 road_class=0 road_speed=0 resolution 23] | |
143 | 137 | |
144 | 138 | # Lower the road speed of ways under some construction. |
145 | highway=* & construction=* & maxspeed!=* { add mkgmap:road-speed = '-1' } | |
139 | highway=* & construction=* & maxspeed!=* {add mkgmap:road-speed='-1'} | |
146 | 140 | # Lower the road speed of disused ways. |
147 | highway=* & disused=yes & maxspeed!=* { add mkgmap:road-speed = '-2' } | |
141 | highway=* & disused=yes & maxspeed!=* {add mkgmap:road-speed='-2'} | |
148 | 142 | |
149 | 143 | # Ways sorted roughly by descending order of class |
150 | 144 | highway=motorway & mkgmap:fast_road=yes [0x01 road_class=4 road_speed=7 resolution 14] |
180 | 174 | highway=bridleway [0x07 road_class=0 road_speed=0 resolution 23] |
181 | 175 | highway=byway [0x16 road_class=0 road_speed=0 resolution 23] |
182 | 176 | |
183 | highway=service & service=parking_aisle | |
184 | [0x07 road_class=0 road_speed=1 resolution 24] | |
185 | highway=service & (service=alley|service=driveway) | |
186 | [0x07 road_class=0 road_speed=0 resolution 23] | |
177 | highway=service & service=parking_aisle [0x07 road_class=0 road_speed=1 resolution 24] | |
178 | highway=service & (service=alley|service=driveway) [0x07 road_class=0 road_speed=0 resolution 23] | |
187 | 179 | highway=service [0x07 road_class=0 road_speed=2 resolution 22] |
188 | 180 | |
189 | 181 | highway=cycleway [0x07 road_class=0 road_speed=1 resolution 23] |
190 | 182 | |
191 | highway=footway|highway=path|highway=steps [0x16 road_class=0 road_speed=0 resolution 23] | |
183 | highway=footway | highway=path | highway=steps [0x16 road_class=0 road_speed=0 resolution 23] | |
192 | 184 | highway=track [0x0a road_class=0 road_speed=1 resolution 22] |
193 | 185 | highway=unsurfaced [0x0a road_class=0 road_speed=1 resolution 22] |
194 | highway=road { add mkgmap:dead-end-check = false} [0x06 road_class=0 road_speed=1 resolution 22] | |
186 | highway=road {add mkgmap:dead-end-check=false} [0x06 road_class=0 road_speed=1 resolution 22] | |
195 | 187 | |
196 | 188 | # Mop up any unrecognised highway types |
197 | highway=* & area!=yes [0x07 road_class=0 road_speed=0 resolution 23] | |
189 | highway=* & area!=yes [0x07 road_class=0 road_speed=0 resolution 23] | |
198 | 190 | |
199 | 191 | natural=coastline [0x15 resolution 12] |
200 | 192 | power=line [0x29 resolution 21] |
201 | 193 | |
202 | 194 | railway=abandoned [0x0a road_class=0 road_speed=1 resolution 22] |
203 | 195 | railway=platform [0x16 road_class=0 road_speed=0 resolution 23] |
204 | # Railway lines, note that many devices display type 0x14 only at resolution 24 | |
205 | (railway=rail | railway=tram | railway=disused | railway=subway | railway=narrow_gauge | railway=light_rail | railway=preserved) & !(tunnel=yes) [0x14 resolution 22] | |
206 | ||
207 | (man_made=cable|(man_made=* & man_made ~ '.*pipe.*')) & area!=yes & | |
208 | tunnel!=yes & location != underground | |
209 | {name '${name} (${operator})' | '${name}' | '${operator}' } | |
210 | [0x28 resolution 23] | |
196 | # Railway lines, note that many devices display type 0x14 only at resolution 24 | |
197 | (railway=rail | railway=tram | railway=disused | railway=subway | railway=narrow_gauge | railway=light_rail | railway=preserved) & !(tunnel=yes) | |
198 | [0x14 resolution 22] | |
199 | ||
200 | (man_made=cable | (man_made=* & man_made~'.*pipe.*')) & area!=yes & tunnel!=yes & location!=underground | |
201 | {name '${name} (${operator})' | '${name}' | '${operator}'} [0x28 resolution 23] | |
211 | 202 | |
212 | 203 | # The following boundary styles are after the highway rules because ways |
213 | 204 | # are frequently tagged with both and we want the highway to take priority. |
214 | boundary=administrative { name '${mkgmap:boundary_name}' } | |
205 | boundary=administrative {name '${mkgmap:boundary_name}'} | |
215 | 206 | boundary=administrative & admin_level<3 [0x1e resolution 12] |
216 | 207 | boundary=administrative & admin_level<5 [0x1d resolution 19] |
217 | 208 | boundary=administrative & admin_level<7 [0x1c resolution 21] |
220 | 211 | boundary=national [0x1e resolution 17] |
221 | 212 | boundary=political [0x1c resolution 19] |
222 | 213 | |
223 | route=ferry {set mkgmap:numbers = false } | |
224 | route=ferry & (motorcar=no | motor_vehicle=no) {add mkgmap:ferry=1} [0x1b road_class=0 road_speed=0 resolution 23] | |
225 | route=ferry {add mkgmap:ferry=1} [0x1b road_class=3 road_speed=0 resolution 19] | |
214 | route=ferry & (toll=no | toll=false) {set mkgmap:toll=no} | |
215 | route=ferry {set mkgmap:numbers=false; set mkgmap:ferry=1; add mkgmap:toll=yes} | |
216 | route=ferry & (motorcar=no | motor_vehicle=no) [0x1b road_class=0 road_speed=0 resolution 23] | |
217 | route=ferry [0x1b road_class=3 road_speed=0 resolution 19] | |
226 | 218 | |
227 | 219 | (waterway=river | waterway=canal) & intermittent=yes [0x26 resolution 20] |
228 | 220 | (waterway=stream | waterway=drain) & intermittent=yes [0x10A02 resolution 22] |
239 | 231 | |
240 | 232 | include 'inc/address'; |
241 | 233 | # calculate the road speed based on maxspeed tag |
242 | include 'inc/roadspeed'; | |
234 | include 'inc/roadspeed'; | |
243 | 235 | # calculate the access rules |
244 | 236 | include 'inc/access'; |
245 | 237 | |
246 | 238 | #limit artificial cycleways to resolution 24 |
247 | mkgmap:synthesised=yes & mkgmap:bicycle=yes { set mkgmap:highest-resolution-only = true } | |
239 | mkgmap:synthesised=yes & mkgmap:bicycle=yes {set mkgmap:highest-resolution-only=true} | |
248 | 240 | |
249 | 241 | # don't add house numbers to unnamed or artifical bicycle ways |
250 | 242 | mkgmap:bicycle=yes & (mkgmap:foot=no & mkgmap:car=no & mkgmap:street!=* | mkgmap:synthesised=yes) {set mkgmap:numbers=false} |
251 | 243 | |
252 | 244 | # Display highway shield for mayor roads if they have a ref and make them searchable by their name |
253 | (highway=motorway | highway=trunk) & ref=* { name '${ref|highway-symbol:hbox}'; addlabel '${name}' } | |
254 | highway=primary & ref=* { name '${ref|highway-symbol:box}'; addlabel '${name}' } | |
255 | (highway=secondary | highway=tertiary) & ref=* { name '${ref|highway-symbol:oval}'; addlabel '${name}' } | |
256 | ||
257 | name=* { name '${name}' } | |
258 | highway=* & ref=* & highway!=motorway & highway!=trunk & highway!=primary & highway!=secondary & highway!=tertiary { addlabel '${ref}' } | |
259 | ||
260 | highway=* & int_ref=* { addlabel '${int_ref}' } | |
261 | highway=* & nat_ref=* { addlabel '${nat_ref}' } | |
262 | highway=* & reg_ref=* { addlabel '${reg_ref}' } | |
245 | (highway=motorway | highway=trunk) & ref=* {name '${ref|highway-symbol:hbox}'; addlabel '${name}'} | |
246 | highway=primary & ref=* {name '${ref|highway-symbol:box}'; addlabel '${name}'} | |
247 | (highway=secondary | highway=tertiary) & ref=* {name '${ref|highway-symbol:oval}'; addlabel '${name}'} | |
248 | ||
249 | name=* {name '${name}'} | |
250 | highway=* & ref=* & highway!=motorway & highway!=trunk & highway!=primary & highway!=secondary & highway!=tertiary | |
251 | {addlabel '${ref}'} | |
252 | ||
253 | highway=* & int_ref=* {addlabel '${int_ref}'} | |
254 | highway=* & nat_ref=* {addlabel '${nat_ref}'} | |
255 | highway=* & reg_ref=* {addlabel '${reg_ref}'} |
8 | 8 | # for more information. |
9 | 9 | |
10 | 10 | addr:housenumber=* {set mkgmap:execute_finalize_rules=true} |
11 | barrier=* & bicycle=* { set mkgmap:bicycle='${bicycle|subst:private=>no}' } | |
12 | barrier=* & foot=* { set mkgmap:foot='${foot|subst:private=>no}' } | |
13 | barrier=* & hgv=* { set mkgmap:truck='${hgv|subst:private=>no}' } | |
14 | barrier=* & motorcar=* { set mkgmap:car='${motorcar|subst:private=>no}' } | |
15 | barrier=* & psv=* { set mkgmap:bus='${psv|subst:private=>no}' } | |
16 | barrier=* & taxi=* { set mkgmap:taxi='${taxi|subst:private=>no}' } | |
17 | barrier=* & emergency=* { set mkgmap:emergency='${emergency|subst:private=>no}' } | |
18 | barrier=* & delivery=* { set mkgmap:delivery='${delivery|subst:private=>no}' } | |
19 | barrier=* & access=* { addaccess '${access|subst:private=>no}' } | |
20 | ||
21 | barrier=bollard | barrier=cycle_barrier | |
22 | { add mkgmap:bicycle=yes; | |
23 | add mkgmap:foot=yes; | |
24 | addaccess no; | |
25 | set mkgmap:road-speed=1; } | |
26 | barrier=bus_trap | |
27 | { add mkgmap:bus=yes; | |
28 | add mkgmap:foot=yes; | |
29 | add mkgmap:bicycle=yes; | |
30 | addaccess no; | |
31 | set mkgmap:road-speed=1; } | |
32 | barrier=gate | |
33 | { add mkgmap:bicycle=yes; | |
34 | add mkgmap:foot=yes; | |
35 | addaccess no; | |
36 | set mkgmap:road-speed=0; } | |
37 | barrier=kissing_gate | barrier=stile | barrier=block | |
38 | { add mkgmap:foot=yes; | |
39 | addaccess no; | |
40 | set mkgmap:road-speed=0; } | |
41 | ||
42 | internet_access=yes { name 'Internet ${name}' | 'Internet' } [0x2f12 resolution 24 continue] | |
43 | internet_access=* & internet_access!=no & internet_access!=yes { name 'Internet(${internet_access}) ${name|def:}' } [0x2f12 resolution 24 continue] | |
11 | ||
12 | barrier=* & bicycle=* {set mkgmap:bicycle = '${bicycle|subst:private=>no}'} | |
13 | barrier=* & foot=* {set mkgmap:foot = '${foot|subst:private=>no}'} | |
14 | barrier=* & hgv=* {set mkgmap:truck = '${hgv|subst:private=>no}'} | |
15 | barrier=* & motorcar=* {set mkgmap:car = '${motorcar|subst:private=>no}'} | |
16 | barrier=* & psv=* {set mkgmap:bus = '${psv|subst:private=>no}'} | |
17 | barrier=* & taxi=* {set mkgmap:taxi = '${taxi|subst:private=>no}'} | |
18 | barrier=* & emergency=* {set mkgmap:emergency='${emergency|subst:private=>no}'} | |
19 | barrier=* & delivery=* {set mkgmap:delivery = '${delivery|subst:private=>no}'} | |
20 | barrier=* & access=* {addaccess '${access|subst:private=>no}'} | |
21 | ||
22 | barrier=bollard | barrier=cycle_barrier { | |
23 | add mkgmap:bicycle=yes; | |
24 | add mkgmap:foot=yes; | |
25 | addaccess no; | |
26 | set mkgmap:road-speed=1; | |
27 | } | |
28 | barrier=bus_trap { | |
29 | add mkgmap:bus=yes; | |
30 | add mkgmap:foot=yes; | |
31 | add mkgmap:bicycle=yes; | |
32 | addaccess no; | |
33 | set mkgmap:road-speed=1; | |
34 | } | |
35 | barrier=gate { | |
36 | add mkgmap:bicycle=yes; | |
37 | add mkgmap:foot=yes; | |
38 | addaccess no; | |
39 | set mkgmap:road-speed=0; | |
40 | } | |
41 | barrier=kissing_gate | barrier=stile | barrier=block { | |
42 | add mkgmap:foot=yes; | |
43 | addaccess no; | |
44 | set mkgmap:road-speed=0; | |
45 | } | |
46 | ||
47 | internet_access=yes {name 'Internet ${name}' | 'Internet'} [0x2f12 resolution 24 continue] | |
48 | internet_access=* & internet_access!=no & internet_access!=yes | |
49 | {name 'Internet(${internet_access}) ${name}' | 'Internet(${internet_access})'} [0x2f12 resolution 24 continue] | |
44 | 50 | |
45 | 51 | (public_transport=platform | highway=bus_stop | railway=tram_stop | railway=halt | railway=station) |
46 | & (ref=* | route_ref=*) { | |
47 | set ref='${ref|def:}(${route_ref})'; | |
48 | } | |
52 | & (ref=* | route_ref=*) | |
53 | {set ref='${ref|def:}(${route_ref})'} | |
49 | 54 | (public_transport=platform | highway=bus_stop | railway=tram_stop | railway=halt | railway=station) |
50 | & lit=yes & (shelter=yes | covered=yes) | |
51 | { | |
52 | set ref='${ref|def:}*'; | |
53 | } | |
55 | & lit=yes & (shelter=yes | covered=yes) | |
56 | {set ref='${ref|def:}*'} | |
54 | 57 | (public_transport=platform | highway=bus_stop | railway=tram_stop | railway=halt | railway=station) |
55 | & lit!=yes & (shelter=yes | covered=yes) | |
56 | { | |
57 | set ref='${ref|def:}+'; | |
58 | } | |
58 | & lit!=yes & (shelter=yes | covered=yes) | |
59 | {set ref='${ref|def:}+'} | |
59 | 60 | (public_transport=platform | highway=bus_stop | railway=tram_stop | railway=halt | railway=station) |
60 | & (shelter=no | covered=no) | |
61 | { | |
62 | set ref='${ref|def:}-'; | |
63 | } | |
61 | & (shelter=no | covered=no) | |
62 | {set ref='${ref|def:}-'} | |
64 | 63 | |
65 | 64 | include 'inc/name'; |
66 | 65 | |
67 | place=city & population > 999999 & name=* {set cityxx=yes} [0x0100 resolution 12 continue with_actions] | |
68 | place=city & population > 799999 & cityxx!=yes & name=* {set cityxx=yes} [0x0200 resolution 14 continue with_actions] | |
69 | place=city & population > 399999 & cityxx!=yes & name=* {set cityxx=yes} [0x0300 resolution 15 continue with_actions] | |
70 | place=city & population > 299999 & cityxx!=yes & name=* {set cityxx=yes} [0x0400 resolution 16 continue with_actions] | |
71 | place=city & population > 199999 & cityxx!=yes & name=* {set cityxx=yes} [0x0500 resolution 16 continue with_actions] | |
72 | place=city & population > 99999 & cityxx!=yes & name=* {set cityxx=yes} [0x0600 resolution 17 continue with_actions] | |
73 | place=city & population > 49999 & cityxx!=yes & name=* {set cityxx=yes} [0x0700 resolution 17 continue with_actions] | |
74 | place=city & population > 9999 & cityxx!=yes & name=* {set cityxx=yes} [0x0800 resolution 18 continue with_actions] | |
75 | ||
76 | place=city & population > 0 & cityxx!=yes & name=* {set cityxx=yes} [0x0800 resolution 18 continue with_actions] | |
77 | place=city & cityxx!=yes & name=* {set cityxx=yes} [0x0700 resolution 18 continue with_actions] | |
78 | ||
79 | place=town & population > 69999 & cityxx!=yes & name=* {set cityxx=yes} [0x0600 resolution 17 continue with_actions] | |
80 | place=town & population > 19999 & cityxx!=yes & name=* {set cityxx=yes} [0x0700 resolution 18 continue with_actions] | |
81 | place=town & population > 9999 & cityxx!=yes & name=* {set cityxx=yes} [0x0800 resolution 19 continue with_actions] | |
82 | place=town & population > 4999 & cityxx!=yes & name=* {set cityxx=yes} [0x0900 resolution 19 continue with_actions] | |
83 | place=town & population > 999 & cityxx!=yes & name=* {set cityxx=yes} [0x0a00 resolution 19 continue with_actions] | |
84 | place=town & population > 0 & cityxx!=yes & name=* {set cityxx=yes} [0x0b00 resolution 20 continue with_actions] | |
85 | place=town & cityxx!=yes & name=* {set cityxx=yes} [0x0800 resolution 19 continue with_actions] | |
86 | ||
87 | place=island & cityxx!=yes {set cityxx=yes} [0x650c resolution 20 continue with_actions] | |
88 | place=islet & cityxx!=yes {set cityxx=yes} [0x650c resolution 22 continue with_actions] | |
89 | place=village & cityxx!=yes {set cityxx=yes} [0x0900 resolution 22 continue with_actions] | |
90 | place=suburb & cityxx!=yes {set cityxx=yes} [0x0a00 resolution 22 continue with_actions] | |
91 | place=hamlet & cityxx!=yes {set cityxx=yes} [0x0b00 resolution 24 continue with_actions] | |
66 | place=city & population > 999999 & name=* {set tmp:city=yes} [0x0100 resolution 12 continue with_actions] | |
67 | place=city & population > 799999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0200 resolution 14 continue with_actions] | |
68 | place=city & population > 399999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0300 resolution 15 continue with_actions] | |
69 | place=city & population > 299999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0400 resolution 16 continue with_actions] | |
70 | place=city & population > 199999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0500 resolution 16 continue with_actions] | |
71 | place=city & population > 99999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0600 resolution 17 continue with_actions] | |
72 | place=city & population > 49999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0700 resolution 17 continue with_actions] | |
73 | place=city & population > 9999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0800 resolution 18 continue with_actions] | |
74 | ||
75 | place=city & population > 0 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0800 resolution 18 continue with_actions] | |
76 | place=city & tmp:city!=yes & name=* {set tmp:city=yes} [0x0700 resolution 18 continue with_actions] | |
77 | ||
78 | place=town & population > 69999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0600 resolution 17 continue with_actions] | |
79 | place=town & population > 19999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0700 resolution 18 continue with_actions] | |
80 | place=town & population > 9999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0800 resolution 19 continue with_actions] | |
81 | place=town & population > 4999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0900 resolution 19 continue with_actions] | |
82 | place=town & population > 999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0a00 resolution 19 continue with_actions] | |
83 | place=town & population > 0 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0b00 resolution 20 continue with_actions] | |
84 | place=town & tmp:city!=yes & name=* {set tmp:city=yes} [0x0800 resolution 19 continue with_actions] | |
85 | ||
86 | place=island & tmp:city!=yes {set tmp:city=yes} [0x650c resolution 20 continue with_actions] | |
87 | place=islet & tmp:city!=yes {set tmp:city=yes} [0x650c resolution 22 continue with_actions] | |
88 | place=village & tmp:city!=yes {set tmp:city=yes} [0x0900 resolution 22 continue with_actions] | |
89 | place=suburb & tmp:city!=yes {set tmp:city=yes} [0x0a00 resolution 22 continue with_actions] | |
90 | place=hamlet & tmp:city!=yes {set tmp:city=yes} [0x0b00 resolution 24 continue with_actions] | |
92 | 91 | |
93 | 92 | #aeroway=airport [0x5900 resolution 22] |
94 | 93 | aeroway=airport [0x2f04 resolution 22] |
109 | 108 | amenity=car_sharing [0x2f02 resolution 24] |
110 | 109 | amenity=car_wash [0x2f0e resolution 24] |
111 | 110 | amenity=casino [0x2d04 resolution 24] |
111 | amenity=charging_station [0x2f01 resolution 24 default_name 'Car charging'] | |
112 | 112 | amenity=cinema [0x2d03 resolution 24] |
113 | 113 | amenity=college [0x2c05 resolution 24] |
114 | 114 | amenity=concert_hall [0x2c09 resolution 24] |
118 | 118 | amenity=community_center [0x3005 resolution 24] |
119 | 119 | amenity=courthouse [0x3004 resolution 24] |
120 | 120 | amenity=drinking_water [0x5000 resolution 24 default_name 'Water'] |
121 | amenity=embassy & country=* { set name='${country} ${name|def:}' } [0x3003 resolution 24] | |
121 | amenity=embassy & country=* {set name='${country} ${name|def:Embassy}'} [0x3003 resolution 24] | |
122 | 122 | amenity=embassy & country!=* [0x3003 resolution 24 default_name 'Embassy'] |
123 | 123 | amenity=emergency_phone [0x2f12 resolution 24 default_name 'Emergency Phone'] |
124 | 124 | amenity=ferry_terminal [0x2f08 resolution 22] |
125 | ||
125 | 126 | amenity=fast_food & cuisine=grill [0x2a03 resolution 24] |
126 | amenity=fast_food & cuisine ~ '.*pizza.*' [0x2a0a resolution 24] | |
127 | amenity=fast_food & cuisine~'.*pizza.*' [0x2a0a resolution 24] | |
128 | amenity=fast_food & cuisine=* {add name='${cuisine|subst:"_=> "}'} [0x2a07 resolution 24] | |
127 | 129 | amenity=fast_food [0x2a07 resolution 24] |
130 | ||
128 | 131 | amenity=fire_station [0x3008 resolution 24] |
129 | 132 | amenity=food_court [0x2a13 resolution 24] |
130 | amenity=fuel & fuel:HGV_diesel=yes [ 0x2f16 resolution 23] | |
131 | amenity=fuel & shop=convenience [ 0x2e06 resolution 24] | |
133 | amenity=fuel & fuel:HGV_diesel=yes [0x2f16 resolution 23] | |
134 | amenity=fuel & shop=convenience [0x2e06 resolution 24] | |
132 | 135 | amenity=fuel [0x2f01 resolution 24] |
136 | amenity=grave_yard | amenity=crematorium [0x6403 resolution 24] | |
133 | 137 | amenity=kindergarten [0x2c05 resolution 24] |
134 | 138 | amenity=library [0x2c03 resolution 24] |
135 | 139 | amenity=nightclub [0x2d02 resolution 24] |
138 | 142 | amenity=pharmacy [0x2e05 resolution 24] |
139 | 143 | amenity=place_of_worship [0x2c0b resolution 24] |
140 | 144 | amenity=police [0x3001 resolution 24] |
145 | amenity=post_box [0x2f15 resolution 24 default_name 'Post box'] | |
141 | 146 | amenity=post_office [0x2f05 resolution 24] |
142 | amenity=prison [0x3007 resolution 24] | |
147 | amenity=prison [0x3007 resolution 24 default_name 'Prison'] | |
143 | 148 | amenity=pub [0x2d02 resolution 24] |
144 | 149 | amenity=public_building [0x3007 resolution 24] |
145 | amenity=recycling [0x2f15 resolution 24] | |
150 | amenity=recycling [0x2f15 resolution 24 default_name 'Recycling'] | |
151 | ||
146 | 152 | amenity=restaurant & cuisine=american [0x2a01 resolution 24] |
147 | 153 | amenity=restaurant & cuisine=asian [0x2a02 resolution 24] |
148 | 154 | amenity=restaurant & cuisine=bagel [0x2a0d resolution 24] |
149 | 155 | amenity=restaurant & cuisine=barbecue [0x2a03 resolution 24] |
150 | 156 | amenity=restaurant & cuisine=british [0x2a11 resolution 24] |
151 | amenity=restaurant & cuisine='cafe/diner' [0x2a0e resolution 24] | |
152 | 157 | amenity=restaurant & cuisine=chinese [0x2a04 resolution 24] |
158 | amenity=restaurant & cuisine=curry [0x2a02 resolution 24] | |
153 | 159 | amenity=restaurant & cuisine=deli [0x2a05 resolution 24] |
154 | 160 | amenity=restaurant & cuisine=french [0x2a0f resolution 24] |
161 | amenity=restaurant & cuisine=fish_and_chips [0x2a11 resolution 24] | |
155 | 162 | amenity=restaurant & (cuisine=german | cuisine=bavarian) [0x2a10 resolution 24] |
156 | 163 | amenity=restaurant & cuisine=grill [0x2a03 resolution 24] |
164 | amenity=restaurant & cuisine=indian [0x2a02 resolution 24] | |
157 | 165 | amenity=restaurant & cuisine=international [0x2a06 resolution 24] |
158 | 166 | amenity=restaurant & cuisine=italian [0x2a08 resolution 24] |
159 | 167 | amenity=restaurant & cuisine=japanese [0x2a02 resolution 24] |
160 | 168 | amenity=restaurant & cuisine=korean [0x2a02 resolution 24] |
161 | 169 | amenity=restaurant & cuisine=mexican [0x2a09 resolution 24] |
162 | amenity=restaurant & cuisine ~ '.*pizza.*' [0x2a0a resolution 24] | |
170 | amenity=restaurant & cuisine~'.*pizza.*' [0x2a0a resolution 24] | |
163 | 171 | amenity=restaurant & cuisine=sea_food [0x2a0b resolution 24] |
172 | # often "seafood" is used instead of official tag "sea_food" | |
173 | amenity=restaurant & cuisine=seafood [0x2a0b resolution 24] | |
164 | 174 | amenity=restaurant & cuisine=spanish [0x2a09 resolution 24] |
165 | 175 | amenity=restaurant & cuisine=speciality [0x2a12 resolution 24] |
166 | 176 | amenity=restaurant & cuisine=steak [0x2a0c resolution 24] |
167 | 177 | amenity=restaurant & cuisine=thai [0x2a02 resolution 24] |
168 | amenity=restaurant & cuisine=* [0x2a13 resolution 24] | |
178 | amenity=restaurant & cuisine=* {add name='${cuisine|subst:"_=> "}'} [0x2a13 resolution 24] | |
169 | 179 | amenity=restaurant [0x2a00 resolution 24] |
180 | ||
170 | 181 | amenity=school [0x2c05 resolution 24] |
171 | 182 | # amenity=shelter is ambiguous; when possible, consider using other tags: |
172 | 183 | # tourism=lean_to or tourism=picnic_site |
178 | 189 | amenity=telephone [0x2f12 resolution 24 default_name 'Telephone'] |
179 | 190 | amenity=theatre [0x2d01 resolution 24] |
180 | 191 | amenity=toilets & highway=rest_area [0x2f0c resolution 24] |
181 | amenity=toilets [0x4e00 resolution 24 default_name 'Toilets' ] | |
192 | amenity=toilets [0x4e00 resolution 24 default_name 'Toilets'] | |
182 | 193 | amenity=townhall [0x3003 resolution 24] |
183 | 194 | amenity=university [0x2c05 resolution 24] |
184 | 195 | # amenity=zoo is superceded by tourism=zoo |
205 | 216 | leisure=marina [0x4300 resolution 24] |
206 | 217 | leisure=nature_reserve & name=* [0x6612 resolution 24] |
207 | 218 | leisure=park [0x2c06 resolution 24] |
208 | leisure=pitch { name '${name} (${sport})' | '${name}' } [0x2c08 resolution 24] | |
209 | leisure=playground [0x2c06 resolution 24] | |
210 | leisure=recreation_ground [0x2c08 resolution 24] | |
211 | leisure=sports_center | leisure=sports_centre { name '${name} (${sport})' | '${name}' } [0x2d0a resolution 24] | |
212 | leisure=stadium { name '${name} (${sport})' | '${name}' } [0x2c08 resolution 24] | |
213 | leisure=track { name '${name} (${sport})' | '${name}' } [0x2c08 resolution 24] | |
219 | leisure=pitch {name '${name} (${sport})' | '${name}'} [0x2c08 resolution 24] | |
220 | leisure=playground [0x2c06 resolution 24 default_name 'Playground'] | |
221 | leisure=recreation_ground [0x2c08 resolution 24 default_name 'Rec.'] | |
222 | leisure=sports_center | leisure=sports_centre {name '${name} (${sport})' | '${name}'} [0x2d0a resolution 24] | |
223 | leisure=stadium {name '${name} (${sport})' | '${name}'} [0x2c08 resolution 24] | |
224 | leisure=swimming_pool [0x2d09 resolution 24] | |
225 | leisure=track {name '${name} (${sport})' | '${name}'} [0x2c08 resolution 24] | |
214 | 226 | leisure=water_park [0x2d09 resolution 24] |
215 | 227 | |
216 | man_made=tower|man_made=mast|landmark=chimney [0x6411 resolution 24] | |
228 | man_made=tower | man_made=mast | landmark=chimney [0x6411 resolution 24] | |
217 | 229 | |
218 | 230 | # Edge 705 displays 0x650a,0x6511,0x6512,0x6513,0x6603,0x6614 as hollow white circles, no menu |
219 | 231 | natural=cave_entrance [0x6601 resolution 24] |
220 | 232 | natural=cape [0x6606 resolution 24] |
221 | 233 | natural=cliff [0x6607 resolution 24] |
222 | natural=peak {name '${name|def:}${ele|height:m=>ft|def:}' } [0x6616 resolution 24] | |
234 | natural=peak {name '${name|def:}${ele|height:m=>ft|def:}'} [0x6616 resolution 24] | |
223 | 235 | natural=rock [0x6614 resolution 24] |
224 | 236 | natural=volcano [0x2c0c resolution 24] |
225 | 237 | |
226 | 238 | railway=station [0x2f08 resolution 22] |
227 | ( public_transport=platform & rail=yes ) | railway=halt [0x2f08 resolution 23] | |
239 | (public_transport=platform & rail=yes) | railway=halt [0x2f08 resolution 23] | |
228 | 240 | public_transport=platform | highway=bus_stop | railway=tram_stop [0x2f17 resolution 24] |
229 | 241 | |
230 | 242 | shop=bakers [0x2e02 resolution 24] |
258 | 270 | shop=supermarket [0x2e02 resolution 24] |
259 | 271 | shop=tires [0x2f07 resolution 24] |
260 | 272 | shop=tyres [0x2f07 resolution 24] |
261 | shop=* & shop!=no & shop!=none [0x2e0c resolution 24] | |
273 | shop=* & shop!=no & shop!=none {add name='${shop|subst:"_=> "}'} [0x2e0c resolution 24] | |
262 | 274 | |
263 | 275 | sport=9pin [0x2d07 resolution 24] |
264 | 276 | sport=10pin | leisure=bowling_alley [0x2d07 resolution 24] |
273 | 285 | tourism=attraction [0x2c04 resolution 24] |
274 | 286 | tourism=artwork [0x2c04 resolution 24] |
275 | 287 | tourism=aquarium [0x2c07 resolution 24] |
288 | tourism=bed_and_breakfast [0x2b02 resolution 24] | |
276 | 289 | tourism=camp_site [0x2b05 resolution 24] |
277 | 290 | tourism=caravan_site [0x2b05 resolution 24] |
278 | 291 | tourism=chalet [0x2b02 resolution 24] |
289 | 302 | tourism=viewpoint {name '${name} - ${description}' | '${name}'} [0x2c04 resolution 24] |
290 | 303 | tourism=wine_cellar [0x2c0a resolution 24] |
291 | 304 | tourism=zoo [0x2c07 resolution 24] |
305 | tourism=* & tourism!=yes & tourism!=no {add name='${tourism|subst:"_=> "}'} | |
306 | tourism=* & tourism!=no [0x2c0d resolution 24] | |
292 | 307 | |
293 | 308 | barrier=bollard | barrier=bus_trap | barrier=gate [0x660f resolution 24] |
294 | 309 | barrier=block | barrier=cycle_barrier | barrier=stile | barrier=kissing_gate [0x660f resolution 24] |
295 | 310 | |
296 | landuse=basin|landuse=reservoir [0x650f resolution 24] | |
311 | landuse=basin | landuse=reservoir [0x650f resolution 24] | |
297 | 312 | |
298 | 313 | natural=beach [0x6604 resolution 24] |
299 | 314 | natural=glacier [0x650a resolution 24] |
303 | 318 | natural=waterfall | waterway=waterfall [0x6508 resolution 24] |
304 | 319 | natural=wetland & name=* [0x6513 resolution 24] |
305 | 320 | |
306 | landuse=cemetery|landuse=cemetary|amenity=grave_yard [0x6403 resolution 24] | |
307 | (landuse=wood|landuse=forest|natural=wood) & name=* [0x6618 resolution 24] | |
321 | landuse=cemetery | landuse=cemetary | amenity=grave_yard [0x6403 resolution 24] | |
322 | (landuse=wood | landuse=forest | natural=wood) & name=* [0x6618 resolution 24] | |
308 | 323 | |
309 | 324 | <finalize> |
310 | 325 | # The finalizer section is executed for each element when a rule with an element type matches |
311 | name=* { name '${name}' } | |
326 | ||
327 | name=* {name '${name}'} | |
312 | 328 | include 'inc/address'; |
9 | 9 | |
10 | 10 | addr:housenumber=* {set mkgmap:execute_finalize_rules=true} |
11 | 11 | |
12 | leisure=* & sport=* & name=* { set name='${name} (${sport})' } | |
13 | leisure=* & sport=* & name!=* { add name='${sport}' } | |
12 | leisure=* & sport=* & name=* {set name='${name} (${sport})'} | |
13 | leisure=* & sport=* & name!=* {add name='${sport}'} | |
14 | 14 | |
15 | 15 | include 'inc/name'; |
16 | 16 | |
17 | 17 | aeroway=airport [0x07 resolution 20] |
18 | 18 | aeroway=aerodrome [0x07 resolution 20] |
19 | 19 | aeroway=runway {name '${ref}'} [0x0e resolution 20] |
20 | (aeroway=taxiway | aeroway=taxilane) {name '${ref}'} [0x0e resolution 24] | |
20 | aeroway=taxiway | aeroway=taxilane {name '${ref}'} [0x0e resolution 24] | |
21 | 21 | aeroway=heliport [0x07 resolution 20] |
22 | 22 | aeroway=helipad [0x0e resolution 22] |
23 | 23 | |
33 | 33 | amenity=university [0x0a resolution 21] |
34 | 34 | |
35 | 35 | healthcare=hospital | amenity=hospital | amenity=clinic [0x0b resolution 22] |
36 | healthcare=* | amenity=dentist | amenity=doctors | amenity=nursing_home | |
37 | [0x0b resolution 23] | |
36 | healthcare=* | amenity=dentist | amenity=doctors | amenity=nursing_home [0x0b resolution 23] | |
38 | 37 | |
39 | 38 | leisure=common [0x17 resolution 21] |
40 | 39 | leisure=garden [0x17 resolution 21] |
52 | 51 | |
53 | 52 | place=village [0x03 resolution 19] |
54 | 53 | |
55 | shop=* [0x08 resolution 22] | |
54 | shop=* {add name='${shop|subst:"_=> "}'} [0x08 resolution 22] | |
56 | 55 | |
57 | 56 | # squares and plazas |
58 | 57 | highway=pedestrian & (area=yes | mkgmap:mp_created=true) [0x17 resolution 22] |
63 | 62 | historic=archaeological_site | historic=ruins [0x1e resolution 21] |
64 | 63 | |
65 | 64 | landuse=basin [0x3f resolution 20] |
66 | (landuse=reservoir | (natural=water & water=reservoir)) [0x3f resolution 20] | |
65 | landuse=reservoir | (natural=water & water=reservoir) [0x3f resolution 20] | |
67 | 66 | |
68 | 67 | natural=bay [0x3d resolution 18] |
69 | 68 | natural=glacier [0x4d resolution 18] |
72 | 71 | natural=wetland [0x51 resolution 20] |
73 | 72 | natural=water [0x3c resolution 18] |
74 | 73 | natural=waterfall | waterway=waterfall [0x47 resolution 21] |
75 | natural=sea { add mkgmap:skipSizeFilter=true; set mkgmap:drawLevel=2 } [0x32 resolution 10] | |
74 | natural=sea {add mkgmap:skipSizeFilter=true; set mkgmap:drawLevel=2} [0x32 resolution 10] | |
76 | 75 | |
77 | 76 | waterway=riverbank [0x46 resolution 20] |
78 | 77 | |
79 | 78 | landuse=allotments [0x4e resolution 21] |
80 | landuse=cemetery|landuse=cemetary|amenity=grave_yard [0x1a resolution 21] | |
79 | landuse=cemetery | landuse=cemetary | amenity=grave_yard [0x1a resolution 21] | |
81 | 80 | landuse=commercial [0x0c resolution 19] |
82 | 81 | landuse=construction [0x0c resolution 21] |
83 | landuse=farm |landuse=farmland [0x4e resolution 20] | |
82 | landuse=farm | landuse=farmland [0x4e resolution 20] | |
84 | 83 | landuse=farmyard [0x10 resolution 22] |
85 | landuse=forest|landuse=wood [0x50 resolution 20] | |
84 | landuse=forest | landuse=wood [0x50 resolution 20] | |
86 | 85 | landuse=greenfield [0x17 resolution 20] |
87 | 86 | landuse=meadow | landuse=grass [0x17 resolution 19] |
88 | 87 | landuse=military [0x04 resolution 19] |
89 | 88 | landuse=quarry [0x0c resolution 19] |
90 | 89 | landuse=recreation_ground [0x19 resolution 19] |
91 | 90 | # dedicate resolution 24 for building=* instead of related landuse=* |
92 | landuse=industrial [0x0c resolution 23-19] | |
93 | landuse=residential [0x10 resolution 23-19] | |
94 | landuse=retail [0x08 resolution 23-20] | |
91 | landuse=industrial [0x0c resolution 19-23] | |
92 | landuse=residential [0x10 resolution 19-23] | |
93 | landuse=retail [0x08 resolution 20-23] | |
95 | 94 | landuse=village_green [0x17 resolution 20] |
96 | 95 | landuse=vineyard [0x4e resolution 20] |
97 | 96 | landuse=orchard [0x4e resolution 20] |
105 | 104 | natural=wood [0x50 resolution 20] |
106 | 105 | |
107 | 106 | # building tag should be last |
108 | (building=* | amenity=*) & area!=no & amenity!=grave_yard [0x13 resolution 24] | |
109 | tourism=* & area!=no & waterway!=* [0x1f resolution 24] | |
107 | amenity=* & area!=no & amenity!=grave_yard {add name='${amenity|subst:"_=> "}'} [0x13 resolution 24] | |
108 | building=* & building!=no [0x13 resolution 24] | |
109 | tourism=* & area!=no & waterway!=* {add name='${tourism|subst:"_=> "}'} [0x1f resolution 24] | |
110 | ||
110 | 111 | # man_made can be used on areas or lines |
111 | man_made=* & area!=no | |
112 | & (man_made!=door & man_made!=embankment & man_made!=breakwater | |
113 | & man_made!=cable_line & man_made!=cutline & man_made!=cutting | |
114 | & man_made!=levee & man_made!=trench | |
115 | & man_made!=groyne & man_made!=reinforced_slope) | |
116 | [0x13 resolution 24] | |
112 | man_made=* & area!=no & ( | |
113 | man_made!=door & man_made!=embankment & man_made!=breakwater & man_made!=cable_line & man_made!=cutline & | |
114 | man_made!=cutting & man_made!=levee & man_made!=trench & man_made!=groyne & man_made!=reinforced_slope) | |
115 | {add name='${man_made|subst:"_=> "}'} [0x13 resolution 24] | |
117 | 116 | |
118 | man_made=* & area=yes | |
119 | [0x13 resolution 24] | |
117 | man_made=* & area=yes {add name='${man_made|subst:"_=> "}'} [0x13 resolution 24] | |
120 | 118 | |
121 | # render small named islands | |
119 | # render small named islands | |
122 | 120 | place=island & name=* & area_size() < 1000000 [0x53 resolution 19] |
123 | 121 | place=islet & name=* [0x53 resolution 20] |
124 | 122 | |
125 | 123 | <finalize> |
126 | 124 | # The finalizer section is executed for each element when a rule with an element type matches |
127 | 125 | |
128 | # we need addrees info from buildings for the address search | |
126 | # we need address info from buildings for the address search | |
129 | 127 | include 'inc/address'; |
130 | 128 | |
131 | name=* { name '${name}' } | |
129 | name=* {name '${name}'} |
281 | 281 | // in each of the day/night sections. |
282 | 282 | |
283 | 283 | if (numberOfColours > 4) |
284 | return ("Too many colours for a line or polygon"); | |
284 | return "Too many colours for a line or polygon"; | |
285 | 285 | if (numberOfColours == 0) |
286 | 286 | return "Line or polygon cannot have zero colours"; |
287 | 287 |
293 | 293 | List<RoadDef> roads = mr.getRoads(); |
294 | 294 | |
295 | 295 | for (RoadDef road : roads) { |
296 | String name = road.getName(); | |
297 | if (name == null || name.isEmpty()) | |
298 | continue; | |
299 | 296 | List<City> cities = road.getCities(); |
300 | 297 | if (cities.isEmpty()) |
301 | 298 | mdrFile.addStreet(road, null); |
184 | 184 | return false; |
185 | 185 | } |
186 | 186 | |
187 | public int getLabelPos(String label){ | |
188 | if (label == null) | |
189 | return -1; | |
190 | for (int i = 0; i < labels.length; i++){ | |
191 | if (labels[i] == null){ | |
192 | return -1; | |
193 | } | |
194 | if (labels[i].equals(label)) | |
195 | return i; | |
196 | } | |
197 | return -1; | |
198 | } | |
199 | ||
187 | 200 | public String toString(){ |
188 | 201 | if ((getName() == null || getName().isEmpty()) && getStreet() != null) |
189 | 202 | return "id="+this.getRoadDef().getId() + ", (" + this.getStreet() + ")"; |
25 | 25 | import java.nio.charset.CharacterCodingException; |
26 | 26 | import java.nio.charset.Charset; |
27 | 27 | import java.nio.charset.CharsetEncoder; |
28 | import java.nio.charset.StandardCharsets; | |
28 | 29 | import java.nio.file.StandardOpenOption; |
29 | 30 | |
30 | 31 | import uk.me.parabola.imgfmt.ExitException; |
210 | 211 | } |
211 | 212 | |
212 | 213 | private void setCodePage(String codePage) { |
213 | this.codePage = codePage; | |
214 | this.encoder = Charset.forName(codePage).newEncoder(); | |
214 | if ("cp65001".equalsIgnoreCase(codePage)) { | |
215 | this.codePage = "utf-8"; | |
216 | this.encoder = StandardCharsets.UTF_8.newEncoder(); | |
217 | } else { | |
218 | this.codePage = codePage; | |
219 | this.encoder = Charset.forName(codePage).newEncoder(); | |
220 | } | |
215 | 221 | } |
216 | 222 | |
217 | 223 | private String probeCharset(String file) { |
311 | 311 | return false; |
312 | 312 | if (getSign().equals(other.getSign()) == false) |
313 | 313 | return false; |
314 | if (getPlace() != other.getPlace()) { | |
315 | if (getPlace() == null) | |
316 | return false; | |
317 | if (getPlace().equals(other.getPlace()) == false) | |
318 | return false; | |
319 | } | |
314 | 320 | if (getZipCode() != null && other.getZipCode() != null){ |
315 | 321 | if (getZipCode().equals(other.getZipCode()) == false) |
316 | 322 | return false; |
558 | 558 | log.info("dropped label",droppedLabel,"for",road,"in preference to correct address search. Labels are now:",Arrays.toString(labels)); |
559 | 559 | } |
560 | 560 | } |
561 | ||
561 | 562 | if (furtherNames != null){ |
562 | 563 | boolean changed = false; |
563 | 564 | for (String furtherName : furtherNames){ |
564 | if (road.addLabel(furtherName)) | |
565 | changed = true; | |
565 | if (road.getLabelPos(furtherName) == -1) { | |
566 | if (road.addLabel(furtherName)) | |
567 | changed = true; | |
568 | else { | |
569 | log.warn("could not add further label",furtherName, "for",road); | |
570 | } | |
571 | } | |
566 | 572 | } |
567 | 573 | if (changed){ |
568 | 574 | log.info("added further labels for",road,"Labels are now:",Arrays.toString(labels)); |
107 | 107 | background.setPoints(mapper.getBounds().toCoords()); |
108 | 108 | background.setType(0x4b); // background type |
109 | 109 | background.setMinResolution(0); // On all levels |
110 | background.setFullArea(Long.MAX_VALUE-1); // sea also SEA_SIZE in SeaGenerator | |
110 | 111 | |
111 | 112 | mapper.addShape(background); |
112 | 113 | } |
103 | 103 | |
104 | 104 | /** |
105 | 105 | * When order-by-decreasing-area we need all bit of sea to be output consistently. |
106 | * Unless _draworder changes things, having seaSize as BIG causes polygons beyond the | |
106 | * Unless _draworder changes things, having SEA_SIZE as BIG causes polygons beyond the | |
107 | 107 | * coastline to be shown. To hide these and have the sea show up to the high-tide |
108 | 108 | * coastline, can set this to be very small instead (or use _draworder). |
109 | 109 | * <p> |
111 | 111 | * natural=sea { add mkgmap:skipSizeFilter=true; set mkgmap:drawLevel=2 } [0x32 resolution 10] |
112 | 112 | * which is equivalent to Long.MAX_VALUE-2. |
113 | 113 | */ |
114 | private static final long seaSize = Long.MAX_VALUE-2; // sea is BIG | |
114 | private static final long SEA_SIZE = Long.MAX_VALUE-2; // sea is BIG | |
115 | 115 | |
116 | 116 | /** |
117 | 117 | * Sort out options from the command line. |
669 | 669 | saver.addWay(w); |
670 | 670 | } |
671 | 671 | for (Way w : seaWays) { |
672 | w.setFullArea(seaSize); | |
672 | w.setFullArea(SEA_SIZE); | |
673 | 673 | saver.addWay(w); |
674 | 674 | } |
675 | 675 | } else { |
679 | 679 | // first add the complete bounding box as sea |
680 | 680 | Way sea = new Way(FakeIdGenerator.makeFakeId(),bounds.toCoords()); |
681 | 681 | sea.addTag("natural", "sea"); |
682 | sea.setFullArea(seaSize); | |
682 | sea.setFullArea(SEA_SIZE); | |
683 | 683 | |
684 | 684 | for (Way w : landWays) { |
685 | 685 | saver.addWay(w); |
953 | 953 | ne.getLongitude() + 1)); |
954 | 954 | sea.addPoint(sea.getPoints().get(0)); // close shape |
955 | 955 | sea.addTag("natural", "sea"); |
956 | sea.setFullArea(seaSize); | |
956 | sea.setFullArea(SEA_SIZE); | |
957 | 957 | |
958 | 958 | log.info("sea: ", sea); |
959 | 959 | saver.addWay(sea); |
256 | 256 | this.isViaWay = isViaWay; |
257 | 257 | } |
258 | 258 | |
259 | /** | |
260 | * Allows to manipulate the area size which might be used to sort shapes when | |
261 | * option --order-by-decreasing-area is active. | |
262 | * @param fullArea | |
263 | */ | |
259 | 264 | public void setFullArea(long fullArea) { |
260 | 265 | this.fullArea = fullArea; |
261 | 266 | } |
368 | 368 | */ |
369 | 369 | protected Xpm readXpm(TokenScanner scanner, String header, boolean simple) { |
370 | 370 | ColourInfo colourInfo = readColourInfo(scanner, header); |
371 | xpmCheck(scanner, colourInfo); | |
372 | ||
371 | 373 | String msg = colourInfo.analyseColours(simple); |
372 | 374 | if (msg != null) |
373 | 375 | throw new SyntaxException(scanner, msg); |
403 | 405 | if (!hasXpm) |
404 | 406 | throw new SyntaxException(scanner, "No XPM tag in section"); |
405 | 407 | } |
408 | ||
409 | /** | |
410 | * Check the colourInfo against any restrictions that apply to the element type. | |
411 | * | |
412 | * Subtypes make checks as appropriate, there are no common restrictions. | |
413 | */ | |
414 | protected void xpmCheck(TokenScanner scanner, ColourInfo colourInfo) { | |
415 | } | |
406 | 416 | } |
11 | 11 | */ |
12 | 12 | package uk.me.parabola.mkgmap.typ; |
13 | 13 | |
14 | import uk.me.parabola.imgfmt.app.typ.ColourInfo; | |
14 | 15 | import uk.me.parabola.imgfmt.app.typ.TypData; |
15 | 16 | import uk.me.parabola.imgfmt.app.typ.TypLine; |
16 | 17 | import uk.me.parabola.mkgmap.scan.SyntaxException; |
61 | 62 | current.finish(); |
62 | 63 | data.addLine(current); |
63 | 64 | } |
65 | ||
66 | protected void xpmCheck(TokenScanner scanner, ColourInfo colourInfo) { | |
67 | int width = colourInfo.getWidth(); | |
68 | ||
69 | if (width == 0) | |
70 | return; | |
71 | ||
72 | if (width != 32) | |
73 | throw new SyntaxException(scanner, "Line bitmaps must be 32 bits wide"); | |
74 | } | |
64 | 75 | } |
11 | 11 | */ |
12 | 12 | package uk.me.parabola.mkgmap.typ; |
13 | 13 | |
14 | import uk.me.parabola.imgfmt.app.typ.ColourInfo; | |
14 | 15 | import uk.me.parabola.imgfmt.app.typ.TypData; |
15 | 16 | import uk.me.parabola.imgfmt.app.typ.TypPolygon; |
17 | import uk.me.parabola.mkgmap.scan.SyntaxException; | |
16 | 18 | import uk.me.parabola.mkgmap.scan.TokenScanner; |
17 | 19 | |
18 | 20 | /** |
44 | 46 | validate(scanner); |
45 | 47 | data.addPolygon(current); |
46 | 48 | } |
49 | ||
50 | /** | |
51 | * Check xmp restrictions for polygons. | |
52 | * | |
53 | * The main one is that bitmaps must be 32x32. Only certain numbers of colours are | |
54 | * allowed as well. | |
55 | */ | |
56 | protected void xpmCheck(TokenScanner scanner, ColourInfo colourInfo) { | |
57 | int width = colourInfo.getWidth(); | |
58 | int height = colourInfo.getHeight(); | |
59 | ||
60 | switch (colourInfo.getNumberOfColours()) { | |
61 | case 1: | |
62 | case 2: | |
63 | case 4: | |
64 | break; | |
65 | default: | |
66 | throw new SyntaxException(scanner, "Polygons must have 1, 2 or 4 colours"); | |
67 | } | |
68 | ||
69 | if (width == 0 && height == 0) | |
70 | return; | |
71 | ||
72 | if (height != 32 || width != 32) | |
73 | throw new SyntaxException(scanner, "Polygon bitmaps must be 32x32"); | |
74 | } | |
47 | 75 | } |