Codebase list mkgmap / 27a34e8
New upstream version 0.0.0+svn4257 Bas Couwenberg 5 years ago
16 changed file(s) with 327 addition(s) and 237 deletion(s). Raw diff Collapse all Expand all
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
1313 (aeroway=taxiway | aeroway=taxilane) & highway!=* & is_closed()=false {name '${ref}'} [0x27 resolution 24]
1414
1515 # Assign the street name for house number search
16 highway=* & name=* { set mkgmap:street='${name}' }
16 highway=* & name=* {set mkgmap:street='${name}'}
1717
1818 # 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}
2020
2121 # mark multipolygons as area
2222 highway=* & mkgmap:mp_created=true {add area=yes}
2323
2424 # 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}
2626 # Hide removed ways
27 (highway=razed | highway=dismantled) {deletealltags}
27 highway=razed | highway=dismantled {deletealltags}
2828 # Hide abandoned ways. Abandoned highways have some evidence of their former existence but are no longer used. These
2929 # abandoned highways could be useful in topographical maps.
3030 # https://wiki.openstreetmap.org/wiki/Key:abandoned:
31 ((abandoned:highway=* & highway!=*) | highway=abandoned) {deletealltags}
31 (abandoned:highway=* & highway!=*) | highway=abandoned {deletealltags}
3232 # 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}
3434 # 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}
3637 highway=piste | highway=ski {delete highway}
3738 highway=no | highway=none {delete highway}
38
39
3940 # 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}
4242 # 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}
4544 # 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}
4847
4948 # start of rules for process-exits and process-destination options
5049 # which may add info to a part of these highway=*_link roads:
5150 # 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}'}
7067 # end of rules for process-exits and process-destination options
7168
7269 # 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}
7976
8077 # Flag unpaved roads.
81 highway=* & mkgmap:unpaved!=0 & (
78 highway=* & mkgmap:unpaved!=0 & (
8279 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}
8683 highway=* & (
87 mtb:scale ~ '[2-6].' |
88 sac_scale ~ '.*(mountain|alpine)_hiking' |
84 mtb:scale~'[2-6].' |
85 sac_scale~'.*(mountain|alpine)_hiking' |
8986 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'}
9592
9693 # 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}
9896 # 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}
10099
101100 # 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}'}
115110
116111 # Roundabouts
117112 junction=roundabout & (highway=trunk | highway=trunk_link) [0x0c road_class=4 road_speed=2 resolution 24 continue]
138133 # Ways that may or may not be useable
139134
140135 # 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]
143137
144138 # 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'}
146140 # 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'}
148142
149143 # Ways sorted roughly by descending order of class
150144 highway=motorway & mkgmap:fast_road=yes [0x01 road_class=4 road_speed=7 resolution 14]
180174 highway=bridleway [0x07 road_class=0 road_speed=0 resolution 23]
181175 highway=byway [0x16 road_class=0 road_speed=0 resolution 23]
182176
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]
187179 highway=service [0x07 road_class=0 road_speed=2 resolution 22]
188180
189181 highway=cycleway [0x07 road_class=0 road_speed=1 resolution 23]
190182
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]
192184 highway=track [0x0a road_class=0 road_speed=1 resolution 22]
193185 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]
195187
196188 # 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]
198190
199191 natural=coastline [0x15 resolution 12]
200192 power=line [0x29 resolution 21]
201193
202194 railway=abandoned [0x0a road_class=0 road_speed=1 resolution 22]
203195 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]
211202
212203 # The following boundary styles are after the highway rules because ways
213204 # 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}'}
215206 boundary=administrative & admin_level<3 [0x1e resolution 12]
216207 boundary=administrative & admin_level<5 [0x1d resolution 19]
217208 boundary=administrative & admin_level<7 [0x1c resolution 21]
220211 boundary=national [0x1e resolution 17]
221212 boundary=political [0x1c resolution 19]
222213
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]
226218
227219 (waterway=river | waterway=canal) & intermittent=yes [0x26 resolution 20]
228220 (waterway=stream | waterway=drain) & intermittent=yes [0x10A02 resolution 22]
239231
240232 include 'inc/address';
241233 # calculate the road speed based on maxspeed tag
242 include 'inc/roadspeed';
234 include 'inc/roadspeed';
243235 # calculate the access rules
244236 include 'inc/access';
245237
246238 #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}
248240
249241 # don't add house numbers to unnamed or artifical bicycle ways
250242 mkgmap:bicycle=yes & (mkgmap:foot=no & mkgmap:car=no & mkgmap:street!=* | mkgmap:synthesised=yes) {set mkgmap:numbers=false}
251243
252244 # 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}'}
88 # for more information.
99
1010 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]
4450
4551 (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})'}
4954 (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:}*'}
5457 (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:}+'}
5960 (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:}-'}
6463
6564 include 'inc/name';
6665
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]
9291
9392 #aeroway=airport [0x5900 resolution 22]
9493 aeroway=airport [0x2f04 resolution 22]
109108 amenity=car_sharing [0x2f02 resolution 24]
110109 amenity=car_wash [0x2f0e resolution 24]
111110 amenity=casino [0x2d04 resolution 24]
111 amenity=charging_station [0x2f01 resolution 24 default_name 'Car charging']
112112 amenity=cinema [0x2d03 resolution 24]
113113 amenity=college [0x2c05 resolution 24]
114114 amenity=concert_hall [0x2c09 resolution 24]
118118 amenity=community_center [0x3005 resolution 24]
119119 amenity=courthouse [0x3004 resolution 24]
120120 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]
122122 amenity=embassy & country!=* [0x3003 resolution 24 default_name 'Embassy']
123123 amenity=emergency_phone [0x2f12 resolution 24 default_name 'Emergency Phone']
124124 amenity=ferry_terminal [0x2f08 resolution 22]
125
125126 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]
127129 amenity=fast_food [0x2a07 resolution 24]
130
128131 amenity=fire_station [0x3008 resolution 24]
129132 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]
132135 amenity=fuel [0x2f01 resolution 24]
136 amenity=grave_yard | amenity=crematorium [0x6403 resolution 24]
133137 amenity=kindergarten [0x2c05 resolution 24]
134138 amenity=library [0x2c03 resolution 24]
135139 amenity=nightclub [0x2d02 resolution 24]
138142 amenity=pharmacy [0x2e05 resolution 24]
139143 amenity=place_of_worship [0x2c0b resolution 24]
140144 amenity=police [0x3001 resolution 24]
145 amenity=post_box [0x2f15 resolution 24 default_name 'Post box']
141146 amenity=post_office [0x2f05 resolution 24]
142 amenity=prison [0x3007 resolution 24]
147 amenity=prison [0x3007 resolution 24 default_name 'Prison']
143148 amenity=pub [0x2d02 resolution 24]
144149 amenity=public_building [0x3007 resolution 24]
145 amenity=recycling [0x2f15 resolution 24]
150 amenity=recycling [0x2f15 resolution 24 default_name 'Recycling']
151
146152 amenity=restaurant & cuisine=american [0x2a01 resolution 24]
147153 amenity=restaurant & cuisine=asian [0x2a02 resolution 24]
148154 amenity=restaurant & cuisine=bagel [0x2a0d resolution 24]
149155 amenity=restaurant & cuisine=barbecue [0x2a03 resolution 24]
150156 amenity=restaurant & cuisine=british [0x2a11 resolution 24]
151 amenity=restaurant & cuisine='cafe/diner' [0x2a0e resolution 24]
152157 amenity=restaurant & cuisine=chinese [0x2a04 resolution 24]
158 amenity=restaurant & cuisine=curry [0x2a02 resolution 24]
153159 amenity=restaurant & cuisine=deli [0x2a05 resolution 24]
154160 amenity=restaurant & cuisine=french [0x2a0f resolution 24]
161 amenity=restaurant & cuisine=fish_and_chips [0x2a11 resolution 24]
155162 amenity=restaurant & (cuisine=german | cuisine=bavarian) [0x2a10 resolution 24]
156163 amenity=restaurant & cuisine=grill [0x2a03 resolution 24]
164 amenity=restaurant & cuisine=indian [0x2a02 resolution 24]
157165 amenity=restaurant & cuisine=international [0x2a06 resolution 24]
158166 amenity=restaurant & cuisine=italian [0x2a08 resolution 24]
159167 amenity=restaurant & cuisine=japanese [0x2a02 resolution 24]
160168 amenity=restaurant & cuisine=korean [0x2a02 resolution 24]
161169 amenity=restaurant & cuisine=mexican [0x2a09 resolution 24]
162 amenity=restaurant & cuisine ~ '.*pizza.*' [0x2a0a resolution 24]
170 amenity=restaurant & cuisine~'.*pizza.*' [0x2a0a resolution 24]
163171 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]
164174 amenity=restaurant & cuisine=spanish [0x2a09 resolution 24]
165175 amenity=restaurant & cuisine=speciality [0x2a12 resolution 24]
166176 amenity=restaurant & cuisine=steak [0x2a0c resolution 24]
167177 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]
169179 amenity=restaurant [0x2a00 resolution 24]
180
170181 amenity=school [0x2c05 resolution 24]
171182 # amenity=shelter is ambiguous; when possible, consider using other tags:
172183 # tourism=lean_to or tourism=picnic_site
178189 amenity=telephone [0x2f12 resolution 24 default_name 'Telephone']
179190 amenity=theatre [0x2d01 resolution 24]
180191 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']
182193 amenity=townhall [0x3003 resolution 24]
183194 amenity=university [0x2c05 resolution 24]
184195 # amenity=zoo is superceded by tourism=zoo
205216 leisure=marina [0x4300 resolution 24]
206217 leisure=nature_reserve & name=* [0x6612 resolution 24]
207218 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]
214226 leisure=water_park [0x2d09 resolution 24]
215227
216 man_made=tower|man_made=mast|landmark=chimney [0x6411 resolution 24]
228 man_made=tower | man_made=mast | landmark=chimney [0x6411 resolution 24]
217229
218230 # Edge 705 displays 0x650a,0x6511,0x6512,0x6513,0x6603,0x6614 as hollow white circles, no menu
219231 natural=cave_entrance [0x6601 resolution 24]
220232 natural=cape [0x6606 resolution 24]
221233 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]
223235 natural=rock [0x6614 resolution 24]
224236 natural=volcano [0x2c0c resolution 24]
225237
226238 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]
228240 public_transport=platform | highway=bus_stop | railway=tram_stop [0x2f17 resolution 24]
229241
230242 shop=bakers [0x2e02 resolution 24]
258270 shop=supermarket [0x2e02 resolution 24]
259271 shop=tires [0x2f07 resolution 24]
260272 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]
262274
263275 sport=9pin [0x2d07 resolution 24]
264276 sport=10pin | leisure=bowling_alley [0x2d07 resolution 24]
273285 tourism=attraction [0x2c04 resolution 24]
274286 tourism=artwork [0x2c04 resolution 24]
275287 tourism=aquarium [0x2c07 resolution 24]
288 tourism=bed_and_breakfast [0x2b02 resolution 24]
276289 tourism=camp_site [0x2b05 resolution 24]
277290 tourism=caravan_site [0x2b05 resolution 24]
278291 tourism=chalet [0x2b02 resolution 24]
289302 tourism=viewpoint {name '${name} - ${description}' | '${name}'} [0x2c04 resolution 24]
290303 tourism=wine_cellar [0x2c0a resolution 24]
291304 tourism=zoo [0x2c07 resolution 24]
305 tourism=* & tourism!=yes & tourism!=no {add name='${tourism|subst:"_=> "}'}
306 tourism=* & tourism!=no [0x2c0d resolution 24]
292307
293308 barrier=bollard | barrier=bus_trap | barrier=gate [0x660f resolution 24]
294309 barrier=block | barrier=cycle_barrier | barrier=stile | barrier=kissing_gate [0x660f resolution 24]
295310
296 landuse=basin|landuse=reservoir [0x650f resolution 24]
311 landuse=basin | landuse=reservoir [0x650f resolution 24]
297312
298313 natural=beach [0x6604 resolution 24]
299314 natural=glacier [0x650a resolution 24]
303318 natural=waterfall | waterway=waterfall [0x6508 resolution 24]
304319 natural=wetland & name=* [0x6513 resolution 24]
305320
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]
308323
309324 <finalize>
310325 # 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}'}
312328 include 'inc/address';
99
1010 addr:housenumber=* {set mkgmap:execute_finalize_rules=true}
1111
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}'}
1414
1515 include 'inc/name';
1616
1717 aeroway=airport [0x07 resolution 20]
1818 aeroway=aerodrome [0x07 resolution 20]
1919 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]
2121 aeroway=heliport [0x07 resolution 20]
2222 aeroway=helipad [0x0e resolution 22]
2323
3333 amenity=university [0x0a resolution 21]
3434
3535 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]
3837
3938 leisure=common [0x17 resolution 21]
4039 leisure=garden [0x17 resolution 21]
5251
5352 place=village [0x03 resolution 19]
5453
55 shop=* [0x08 resolution 22]
54 shop=* {add name='${shop|subst:"_=> "}'} [0x08 resolution 22]
5655
5756 # squares and plazas
5857 highway=pedestrian & (area=yes | mkgmap:mp_created=true) [0x17 resolution 22]
6362 historic=archaeological_site | historic=ruins [0x1e resolution 21]
6463
6564 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]
6766
6867 natural=bay [0x3d resolution 18]
6968 natural=glacier [0x4d resolution 18]
7271 natural=wetland [0x51 resolution 20]
7372 natural=water [0x3c resolution 18]
7473 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]
7675
7776 waterway=riverbank [0x46 resolution 20]
7877
7978 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]
8180 landuse=commercial [0x0c resolution 19]
8281 landuse=construction [0x0c resolution 21]
83 landuse=farm |landuse=farmland [0x4e resolution 20]
82 landuse=farm | landuse=farmland [0x4e resolution 20]
8483 landuse=farmyard [0x10 resolution 22]
85 landuse=forest|landuse=wood [0x50 resolution 20]
84 landuse=forest | landuse=wood [0x50 resolution 20]
8685 landuse=greenfield [0x17 resolution 20]
8786 landuse=meadow | landuse=grass [0x17 resolution 19]
8887 landuse=military [0x04 resolution 19]
8988 landuse=quarry [0x0c resolution 19]
9089 landuse=recreation_ground [0x19 resolution 19]
9190 # 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]
9594 landuse=village_green [0x17 resolution 20]
9695 landuse=vineyard [0x4e resolution 20]
9796 landuse=orchard [0x4e resolution 20]
105104 natural=wood [0x50 resolution 20]
106105
107106 # 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
110111 # 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]
117116
118 man_made=* & area=yes
119 [0x13 resolution 24]
117 man_made=* & area=yes {add name='${man_made|subst:"_=> "}'} [0x13 resolution 24]
120118
121 # render small named islands
119 # render small named islands
122120 place=island & name=* & area_size() < 1000000 [0x53 resolution 19]
123121 place=islet & name=* [0x53 resolution 20]
124122
125123 <finalize>
126124 # The finalizer section is executed for each element when a rule with an element type matches
127125
128 # we need addrees info from buildings for the address search
126 # we need address info from buildings for the address search
129127 include 'inc/address';
130128
131 name=* { name '${name}' }
129 name=* {name '${name}'}
281281 // in each of the day/night sections.
282282
283283 if (numberOfColours > 4)
284 return ("Too many colours for a line or polygon");
284 return "Too many colours for a line or polygon";
285285 if (numberOfColours == 0)
286286 return "Line or polygon cannot have zero colours";
287287
293293 List<RoadDef> roads = mr.getRoads();
294294
295295 for (RoadDef road : roads) {
296 String name = road.getName();
297 if (name == null || name.isEmpty())
298 continue;
299296 List<City> cities = road.getCities();
300297 if (cities.isEmpty())
301298 mdrFile.addStreet(road, null);
184184 return false;
185185 }
186186
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
187200 public String toString(){
188201 if ((getName() == null || getName().isEmpty()) && getStreet() != null)
189202 return "id="+this.getRoadDef().getId() + ", (" + this.getStreet() + ")";
2525 import java.nio.charset.CharacterCodingException;
2626 import java.nio.charset.Charset;
2727 import java.nio.charset.CharsetEncoder;
28 import java.nio.charset.StandardCharsets;
2829 import java.nio.file.StandardOpenOption;
2930
3031 import uk.me.parabola.imgfmt.ExitException;
210211 }
211212
212213 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 }
215221 }
216222
217223 private String probeCharset(String file) {
311311 return false;
312312 if (getSign().equals(other.getSign()) == false)
313313 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 }
314320 if (getZipCode() != null && other.getZipCode() != null){
315321 if (getZipCode().equals(other.getZipCode()) == false)
316322 return false;
558558 log.info("dropped label",droppedLabel,"for",road,"in preference to correct address search. Labels are now:",Arrays.toString(labels));
559559 }
560560 }
561
561562 if (furtherNames != null){
562563 boolean changed = false;
563564 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 }
566572 }
567573 if (changed){
568574 log.info("added further labels for",road,"Labels are now:",Arrays.toString(labels));
107107 background.setPoints(mapper.getBounds().toCoords());
108108 background.setType(0x4b); // background type
109109 background.setMinResolution(0); // On all levels
110 background.setFullArea(Long.MAX_VALUE-1); // sea also SEA_SIZE in SeaGenerator
110111
111112 mapper.addShape(background);
112113 }
103103
104104 /**
105105 * 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
107107 * coastline to be shown. To hide these and have the sea show up to the high-tide
108108 * coastline, can set this to be very small instead (or use _draworder).
109109 * <p>
111111 * natural=sea { add mkgmap:skipSizeFilter=true; set mkgmap:drawLevel=2 } [0x32 resolution 10]
112112 * which is equivalent to Long.MAX_VALUE-2.
113113 */
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
115115
116116 /**
117117 * Sort out options from the command line.
669669 saver.addWay(w);
670670 }
671671 for (Way w : seaWays) {
672 w.setFullArea(seaSize);
672 w.setFullArea(SEA_SIZE);
673673 saver.addWay(w);
674674 }
675675 } else {
679679 // first add the complete bounding box as sea
680680 Way sea = new Way(FakeIdGenerator.makeFakeId(),bounds.toCoords());
681681 sea.addTag("natural", "sea");
682 sea.setFullArea(seaSize);
682 sea.setFullArea(SEA_SIZE);
683683
684684 for (Way w : landWays) {
685685 saver.addWay(w);
953953 ne.getLongitude() + 1));
954954 sea.addPoint(sea.getPoints().get(0)); // close shape
955955 sea.addTag("natural", "sea");
956 sea.setFullArea(seaSize);
956 sea.setFullArea(SEA_SIZE);
957957
958958 log.info("sea: ", sea);
959959 saver.addWay(sea);
256256 this.isViaWay = isViaWay;
257257 }
258258
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 */
259264 public void setFullArea(long fullArea) {
260265 this.fullArea = fullArea;
261266 }
368368 */
369369 protected Xpm readXpm(TokenScanner scanner, String header, boolean simple) {
370370 ColourInfo colourInfo = readColourInfo(scanner, header);
371 xpmCheck(scanner, colourInfo);
372
371373 String msg = colourInfo.analyseColours(simple);
372374 if (msg != null)
373375 throw new SyntaxException(scanner, msg);
403405 if (!hasXpm)
404406 throw new SyntaxException(scanner, "No XPM tag in section");
405407 }
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 }
406416 }
1111 */
1212 package uk.me.parabola.mkgmap.typ;
1313
14 import uk.me.parabola.imgfmt.app.typ.ColourInfo;
1415 import uk.me.parabola.imgfmt.app.typ.TypData;
1516 import uk.me.parabola.imgfmt.app.typ.TypLine;
1617 import uk.me.parabola.mkgmap.scan.SyntaxException;
6162 current.finish();
6263 data.addLine(current);
6364 }
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 }
6475 }
1111 */
1212 package uk.me.parabola.mkgmap.typ;
1313
14 import uk.me.parabola.imgfmt.app.typ.ColourInfo;
1415 import uk.me.parabola.imgfmt.app.typ.TypData;
1516 import uk.me.parabola.imgfmt.app.typ.TypPolygon;
17 import uk.me.parabola.mkgmap.scan.SyntaxException;
1618 import uk.me.parabola.mkgmap.scan.TokenScanner;
1719
1820 /**
4446 validate(scanner);
4547 data.addPolygon(current);
4648 }
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 }
4775 }