Skip to content
Commits on Source (4)
mkgmap (0.0.0+svn4257-1) unstable; urgency=medium
* New upstream SVN snapshot.
-- Bas Couwenberg <sebastic@debian.org> Sun, 02 Dec 2018 19:13:31 +0100
mkgmap (0.0.0+svn4245-1) unstable; urgency=medium
* New upstream SVN snapshot.
......
svn.version: 4245
build.timestamp: 2018-10-19T06:22:23+0100
svn.version: 4257
build.timestamp: 2018-11-26T14:51:21+0000
......@@ -23,26 +23,25 @@ highway=* & (toll=yes|toll=true) { set mkgmap:toll=yes }
highway=* & mkgmap:mp_created=true {add area=yes}
# Hide proposed ways
(highway=proposed | highway=proposal | highway=planned | highway ~ '.*proposed.*') {delete highway;delete junction}
highway=proposed | highway=proposal | highway=planned | highway~'.*proposed.*' {delete highway; delete junction}
# Hide removed ways
(highway=razed | highway=dismantled) {deletealltags}
highway=razed | highway=dismantled {deletealltags}
# Hide abandoned ways. Abandoned highways have some evidence of their former existence but are no longer used. These
# abandoned highways could be useful in topographical maps.
# https://wiki.openstreetmap.org/wiki/Key:abandoned:
((abandoned:highway=* & highway!=*) | highway=abandoned) {deletealltags}
(abandoned:highway=* & highway!=*) | highway=abandoned {deletealltags}
# Hide other non-existent ways
(highway=unbuilt | highway=neverbuilt | highway=rejected | highway ~ 'x-.*') {delete highway;delete junction}
highway=unbuilt | highway=neverbuilt | highway=rejected | highway~'x-.*' {delete highway; delete junction}
# Remove highway tag from ways which are not suitable for routing
highway=traffic_signals | highway=junction | highway=island | highway=centre_line | highway=traffic_island | highway=stopline {delete highway}
highway=traffic_signals | highway=junction | highway=island | highway=centre_line | highway=traffic_island | highway=stopline
{delete highway}
highway=piste | highway=ski {delete highway}
highway=no | highway=none {delete highway}
# Hide unaccessible tunnels
highway=* & tunnel=yes & (access=private|access=no)
& foot!=* & bicycle!=* {delete highway;delete junction}
highway=* & tunnel=yes & (access=private | access=no) & foot!=* & bicycle!=* {delete highway; delete junction}
# Disable dead-end-checks for unaccessible oneways
highway=* & oneway=yes & (access=private|access=no)
{add mkgmap:dead-end-check=false}
highway=* & oneway=yes & (access=private | access=no) {add mkgmap:dead-end-check=false}
# Validation-like checks (uncomment to enable)
#highway=motorway_link & oneway!=yes & oneway!=no {echo "motorway_link lacks oneway"}
highway=motorway | highway=motorway_link {add oneway=yes; add mkgmap:numbers=false}
......@@ -51,23 +50,21 @@ highway=motorway|highway=motorway_link { add oneway=yes; add mkgmap:numbers=fals
# which may add info to a part of these highway=*_link roads:
# motorway_link, trunk_link, primary_link, secondary_link, tertiary_link
# build destination hint
mkgmap:dest_hint=*
{ set dest_hint = '${destination:ref|subst: =>} ${mkgmap:dest_hint|subst:;=> |subst:/=> }' |
mkgmap:dest_hint=* {
set tmp:dest_hint='${destination:ref|subst: =>} ${mkgmap:dest_hint|subst:;=> |subst:/=> }' |
'${ref|subst: =>} ${mkgmap:dest_hint|subst:;=> |subst:/=> }' |
'${mkgmap:dest_hint|subst:;=> |subst:/=> }';
}
# build exit hint
mkgmap:exit_hint=true
{ set exit_hint = 'Exit ${mkgmap:exit_hint_ref} ${mkgmap:exit_hint_name}' |
mkgmap:exit_hint=true {
set tmp:exit_hint='Exit ${mkgmap:exit_hint_ref} ${mkgmap:exit_hint_name}' |
'Exit ${mkgmap:exit_hint_ref} ${mkgmap:exit_hint_exit_to}' |
'Exit ${mkgmap:exit_hint_exit_to}' |
'Exit ${mkgmap:exit_hint_name}' |
'Exit ${mkgmap:exit_hint_ref}';
}
# use destination hint and/or exit hint to build name
(mkgmap:exit_hint=true | mkgmap:dest_hint=*)
{ name '${exit_hint} ${dest_hint}' | '${dest_hint}' | '${exit_hint}' }
mkgmap:exit_hint=true | mkgmap:dest_hint=* {name '${tmp:exit_hint} ${tmp:dest_hint}' | '${tmp:dest_hint}' | '${tmp:exit_hint}'}
# end of rules for process-exits and process-destination options
# Flag paved roads
......@@ -95,24 +92,22 @@ highway=* & (
highway=* & mkgmap:unpaved!=1 & smoothness~'.*(bad|horrible|impassable)' {add mkgmap:road-speed='-2'}
# Good ways without relation
highway=* & mkgmap:fast_road!=* & (int_ref=* | network=e-road | network=AH | network=TAH | network=US:I | network=US:US) {add mkgmap:fast_road=yes}
highway=* & mkgmap:fast_road!=* & (int_ref=* | network=e-road | network=AH | network=TAH | network=US:I | network=US:US)
{add mkgmap:fast_road=yes}
# Not best for car routing
highway=* & (access=hov | hov=designated | oneway=reversible) {set mkgmap:road-class=-2; set mkgmap:road-speed=-2; delete mkgmap:fast_road}
highway=* & (access=hov | hov=designated | oneway=reversible)
{set mkgmap:road-class=-2; set mkgmap:road-speed=-2; delete mkgmap:fast_road}
# Convert generic path to most specific
highway=footway & snowplowing!=no
& (bicycle=yes|bicycle=designated|bicycle=permissive|bicycle=official)
highway=footway & snowplowing!=no & (bicycle=yes | bicycle=designated | bicycle=permissive | bicycle=official)
{set highway=cycleway; set bicycle=yes; set foot=yes}
highway=path & snowplowing!=no
& (bicycle=designated|bicycle=permissive|bicycle=official)
highway=path & snowplowing!=no & (bicycle=designated | bicycle=permissive | bicycle=official)
{set highway=cycleway; set bicycle=yes}
highway=path & (horse=designated | horse=permissive | horse=official)
{set highway=bridleway; set horse=yes}
leisure=track & area!=yes
{add highway=footway; name '${name} (${sport})' | '${name}'}
(man_made=pier | man_made=piste:halfpipe) & area!=yes
{add highway=footway; name '${ref} ${name}' | '${ref}' | '${name}' }
leisure=track & area!=yes {add highway=footway; name '${name} (${sport})' | '${name}'}
(man_made=pier | man_made=piste:halfpipe) & area!=yes {add highway=footway; name '${ref} ${name}' | '${ref}' | '${name}'}
# Roundabouts
junction=roundabout & (highway=trunk | highway=trunk_link) [0x0c road_class=4 road_speed=2 resolution 24 continue]
......@@ -139,8 +134,7 @@ junction=roundabout & highway=* [0x0c road_class=0 road_speed=1 resolution 22]
# Ways that may or may not be useable
# Treat ways under construction almost as highway=path, see also extra rule in inc/access
highway=construction { add mkgmap:dead-end-check = false; }
[0x16 road_class=0 road_speed=0 resolution 23]
highway=construction {add mkgmap:dead-end-check=false} [0x16 road_class=0 road_speed=0 resolution 23]
# Lower the road speed of ways under some construction.
highway=* & construction=* & maxspeed!=* {add mkgmap:road-speed='-1'}
......@@ -181,10 +175,8 @@ highway=residential [0x06 road_class=0 road_speed=2 resolution 22]
highway=bridleway [0x07 road_class=0 road_speed=0 resolution 23]
highway=byway [0x16 road_class=0 road_speed=0 resolution 23]
highway=service & service=parking_aisle
[0x07 road_class=0 road_speed=1 resolution 24]
highway=service & (service=alley|service=driveway)
[0x07 road_class=0 road_speed=0 resolution 23]
highway=service & service=parking_aisle [0x07 road_class=0 road_speed=1 resolution 24]
highway=service & (service=alley|service=driveway) [0x07 road_class=0 road_speed=0 resolution 23]
highway=service [0x07 road_class=0 road_speed=2 resolution 22]
highway=cycleway [0x07 road_class=0 road_speed=1 resolution 23]
......@@ -203,12 +195,11 @@ power=line [0x29 resolution 21]
railway=abandoned [0x0a road_class=0 road_speed=1 resolution 22]
railway=platform [0x16 road_class=0 road_speed=0 resolution 23]
# Railway lines, note that many devices display type 0x14 only at resolution 24
(railway=rail | railway=tram | railway=disused | railway=subway | railway=narrow_gauge | railway=light_rail | railway=preserved) & !(tunnel=yes) [0x14 resolution 22]
(railway=rail | railway=tram | railway=disused | railway=subway | railway=narrow_gauge | railway=light_rail | railway=preserved) & !(tunnel=yes)
[0x14 resolution 22]
(man_made=cable|(man_made=* & man_made ~ '.*pipe.*')) & area!=yes &
tunnel!=yes & location != underground
{name '${name} (${operator})' | '${name}' | '${operator}' }
[0x28 resolution 23]
(man_made=cable | (man_made=* & man_made~'.*pipe.*')) & area!=yes & tunnel!=yes & location!=underground
{name '${name} (${operator})' | '${name}' | '${operator}'} [0x28 resolution 23]
# The following boundary styles are after the highway rules because ways
# are frequently tagged with both and we want the highway to take priority.
......@@ -221,9 +212,10 @@ boundary=administrative [0x1c resolution 22]
boundary=national [0x1e resolution 17]
boundary=political [0x1c resolution 19]
route=ferry {set mkgmap:numbers = false }
route=ferry & (motorcar=no | motor_vehicle=no) {add mkgmap:ferry=1} [0x1b road_class=0 road_speed=0 resolution 23]
route=ferry {add mkgmap:ferry=1} [0x1b road_class=3 road_speed=0 resolution 19]
route=ferry & (toll=no | toll=false) {set mkgmap:toll=no}
route=ferry {set mkgmap:numbers=false; set mkgmap:ferry=1; add mkgmap:toll=yes}
route=ferry & (motorcar=no | motor_vehicle=no) [0x1b road_class=0 road_speed=0 resolution 23]
route=ferry [0x1b road_class=3 road_speed=0 resolution 19]
(waterway=river | waterway=canal) & intermittent=yes [0x26 resolution 20]
(waterway=stream | waterway=drain) & intermittent=yes [0x10A02 resolution 22]
......@@ -256,7 +248,8 @@ highway=primary & ref=* { name '${ref|highway-symbol:box}'; addlabel '${name}'
(highway=secondary | highway=tertiary) & ref=* {name '${ref|highway-symbol:oval}'; addlabel '${name}'}
name=* {name '${name}'}
highway=* & ref=* & highway!=motorway & highway!=trunk & highway!=primary & highway!=secondary & highway!=tertiary { addlabel '${ref}' }
highway=* & ref=* & highway!=motorway & highway!=trunk & highway!=primary & highway!=secondary & highway!=tertiary
{addlabel '${ref}'}
highway=* & int_ref=* {addlabel '${int_ref}'}
highway=* & nat_ref=* {addlabel '${nat_ref}'}
......
......@@ -9,6 +9,7 @@
# for more information.
addr:housenumber=* {set mkgmap:execute_finalize_rules=true}
barrier=* & bicycle=* {set mkgmap:bicycle = '${bicycle|subst:private=>no}'}
barrier=* & foot=* {set mkgmap:foot = '${foot|subst:private=>no}'}
barrier=* & hgv=* {set mkgmap:truck = '${hgv|subst:private=>no}'}
......@@ -19,77 +20,75 @@ barrier=* & emergency=* { set mkgmap:emergency='${emergency|subst:private=>no}'
barrier=* & delivery=* {set mkgmap:delivery = '${delivery|subst:private=>no}'}
barrier=* & access=* {addaccess '${access|subst:private=>no}'}
barrier=bollard | barrier=cycle_barrier
{ add mkgmap:bicycle=yes;
barrier=bollard | barrier=cycle_barrier {
add mkgmap:bicycle=yes;
add mkgmap:foot=yes;
addaccess no;
set mkgmap:road-speed=1; }
barrier=bus_trap
{ add mkgmap:bus=yes;
set mkgmap:road-speed=1;
}
barrier=bus_trap {
add mkgmap:bus=yes;
add mkgmap:foot=yes;
add mkgmap:bicycle=yes;
addaccess no;
set mkgmap:road-speed=1; }
barrier=gate
{ add mkgmap:bicycle=yes;
set mkgmap:road-speed=1;
}
barrier=gate {
add mkgmap:bicycle=yes;
add mkgmap:foot=yes;
addaccess no;
set mkgmap:road-speed=0; }
barrier=kissing_gate | barrier=stile | barrier=block
{ add mkgmap:foot=yes;
set mkgmap:road-speed=0;
}
barrier=kissing_gate | barrier=stile | barrier=block {
add mkgmap:foot=yes;
addaccess no;
set mkgmap:road-speed=0; }
set mkgmap:road-speed=0;
}
internet_access=yes {name 'Internet ${name}' | 'Internet'} [0x2f12 resolution 24 continue]
internet_access=* & internet_access!=no & internet_access!=yes { name 'Internet(${internet_access}) ${name|def:}' } [0x2f12 resolution 24 continue]
internet_access=* & internet_access!=no & internet_access!=yes
{name 'Internet(${internet_access}) ${name}' | 'Internet(${internet_access})'} [0x2f12 resolution 24 continue]
(public_transport=platform | highway=bus_stop | railway=tram_stop | railway=halt | railway=station)
& (ref=* | route_ref=*) {
set ref='${ref|def:}(${route_ref})';
}
& (ref=* | route_ref=*)
{set ref='${ref|def:}(${route_ref})'}
(public_transport=platform | highway=bus_stop | railway=tram_stop | railway=halt | railway=station)
& lit=yes & (shelter=yes | covered=yes)
{
set ref='${ref|def:}*';
}
{set ref='${ref|def:}*'}
(public_transport=platform | highway=bus_stop | railway=tram_stop | railway=halt | railway=station)
& lit!=yes & (shelter=yes | covered=yes)
{
set ref='${ref|def:}+';
}
{set ref='${ref|def:}+'}
(public_transport=platform | highway=bus_stop | railway=tram_stop | railway=halt | railway=station)
& (shelter=no | covered=no)
{
set ref='${ref|def:}-';
}
{set ref='${ref|def:}-'}
include 'inc/name';
place=city & population > 999999 & name=* {set cityxx=yes} [0x0100 resolution 12 continue with_actions]
place=city & population > 799999 & cityxx!=yes & name=* {set cityxx=yes} [0x0200 resolution 14 continue with_actions]
place=city & population > 399999 & cityxx!=yes & name=* {set cityxx=yes} [0x0300 resolution 15 continue with_actions]
place=city & population > 299999 & cityxx!=yes & name=* {set cityxx=yes} [0x0400 resolution 16 continue with_actions]
place=city & population > 199999 & cityxx!=yes & name=* {set cityxx=yes} [0x0500 resolution 16 continue with_actions]
place=city & population > 99999 & cityxx!=yes & name=* {set cityxx=yes} [0x0600 resolution 17 continue with_actions]
place=city & population > 49999 & cityxx!=yes & name=* {set cityxx=yes} [0x0700 resolution 17 continue with_actions]
place=city & population > 9999 & cityxx!=yes & name=* {set cityxx=yes} [0x0800 resolution 18 continue with_actions]
place=city & population > 0 & cityxx!=yes & name=* {set cityxx=yes} [0x0800 resolution 18 continue with_actions]
place=city & cityxx!=yes & name=* {set cityxx=yes} [0x0700 resolution 18 continue with_actions]
place=town & population > 69999 & cityxx!=yes & name=* {set cityxx=yes} [0x0600 resolution 17 continue with_actions]
place=town & population > 19999 & cityxx!=yes & name=* {set cityxx=yes} [0x0700 resolution 18 continue with_actions]
place=town & population > 9999 & cityxx!=yes & name=* {set cityxx=yes} [0x0800 resolution 19 continue with_actions]
place=town & population > 4999 & cityxx!=yes & name=* {set cityxx=yes} [0x0900 resolution 19 continue with_actions]
place=town & population > 999 & cityxx!=yes & name=* {set cityxx=yes} [0x0a00 resolution 19 continue with_actions]
place=town & population > 0 & cityxx!=yes & name=* {set cityxx=yes} [0x0b00 resolution 20 continue with_actions]
place=town & cityxx!=yes & name=* {set cityxx=yes} [0x0800 resolution 19 continue with_actions]
place=island & cityxx!=yes {set cityxx=yes} [0x650c resolution 20 continue with_actions]
place=islet & cityxx!=yes {set cityxx=yes} [0x650c resolution 22 continue with_actions]
place=village & cityxx!=yes {set cityxx=yes} [0x0900 resolution 22 continue with_actions]
place=suburb & cityxx!=yes {set cityxx=yes} [0x0a00 resolution 22 continue with_actions]
place=hamlet & cityxx!=yes {set cityxx=yes} [0x0b00 resolution 24 continue with_actions]
place=city & population > 999999 & name=* {set tmp:city=yes} [0x0100 resolution 12 continue with_actions]
place=city & population > 799999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0200 resolution 14 continue with_actions]
place=city & population > 399999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0300 resolution 15 continue with_actions]
place=city & population > 299999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0400 resolution 16 continue with_actions]
place=city & population > 199999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0500 resolution 16 continue with_actions]
place=city & population > 99999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0600 resolution 17 continue with_actions]
place=city & population > 49999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0700 resolution 17 continue with_actions]
place=city & population > 9999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0800 resolution 18 continue with_actions]
place=city & population > 0 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0800 resolution 18 continue with_actions]
place=city & tmp:city!=yes & name=* {set tmp:city=yes} [0x0700 resolution 18 continue with_actions]
place=town & population > 69999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0600 resolution 17 continue with_actions]
place=town & population > 19999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0700 resolution 18 continue with_actions]
place=town & population > 9999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0800 resolution 19 continue with_actions]
place=town & population > 4999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0900 resolution 19 continue with_actions]
place=town & population > 999 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0a00 resolution 19 continue with_actions]
place=town & population > 0 & tmp:city!=yes & name=* {set tmp:city=yes} [0x0b00 resolution 20 continue with_actions]
place=town & tmp:city!=yes & name=* {set tmp:city=yes} [0x0800 resolution 19 continue with_actions]
place=island & tmp:city!=yes {set tmp:city=yes} [0x650c resolution 20 continue with_actions]
place=islet & tmp:city!=yes {set tmp:city=yes} [0x650c resolution 22 continue with_actions]
place=village & tmp:city!=yes {set tmp:city=yes} [0x0900 resolution 22 continue with_actions]
place=suburb & tmp:city!=yes {set tmp:city=yes} [0x0a00 resolution 22 continue with_actions]
place=hamlet & tmp:city!=yes {set tmp:city=yes} [0x0b00 resolution 24 continue with_actions]
#aeroway=airport [0x5900 resolution 22]
aeroway=airport [0x2f04 resolution 22]
......@@ -110,6 +109,7 @@ amenity=car_rental [0x2f02 resolution 24]
amenity=car_sharing [0x2f02 resolution 24]
amenity=car_wash [0x2f0e resolution 24]
amenity=casino [0x2d04 resolution 24]
amenity=charging_station [0x2f01 resolution 24 default_name 'Car charging']
amenity=cinema [0x2d03 resolution 24]
amenity=college [0x2c05 resolution 24]
amenity=concert_hall [0x2c09 resolution 24]
......@@ -119,18 +119,22 @@ amenity=community_centre [0x3005 resolution 24]
amenity=community_center [0x3005 resolution 24]
amenity=courthouse [0x3004 resolution 24]
amenity=drinking_water [0x5000 resolution 24 default_name 'Water']
amenity=embassy & country=* { set name='${country} ${name|def:}' } [0x3003 resolution 24]
amenity=embassy & country=* {set name='${country} ${name|def:Embassy}'} [0x3003 resolution 24]
amenity=embassy & country!=* [0x3003 resolution 24 default_name 'Embassy']
amenity=emergency_phone [0x2f12 resolution 24 default_name 'Emergency Phone']
amenity=ferry_terminal [0x2f08 resolution 22]
amenity=fast_food & cuisine=grill [0x2a03 resolution 24]
amenity=fast_food & cuisine~'.*pizza.*' [0x2a0a resolution 24]
amenity=fast_food & cuisine=* {add name='${cuisine|subst:"_=> "}'} [0x2a07 resolution 24]
amenity=fast_food [0x2a07 resolution 24]
amenity=fire_station [0x3008 resolution 24]
amenity=food_court [0x2a13 resolution 24]
amenity=fuel & fuel:HGV_diesel=yes [0x2f16 resolution 23]
amenity=fuel & shop=convenience [0x2e06 resolution 24]
amenity=fuel [0x2f01 resolution 24]
amenity=grave_yard | amenity=crematorium [0x6403 resolution 24]
amenity=kindergarten [0x2c05 resolution 24]
amenity=library [0x2c03 resolution 24]
amenity=nightclub [0x2d02 resolution 24]
......@@ -139,22 +143,26 @@ amenity=parking [0x2f0b resolution 24 default_name 'Parking']
amenity=pharmacy [0x2e05 resolution 24]
amenity=place_of_worship [0x2c0b resolution 24]
amenity=police [0x3001 resolution 24]
amenity=post_box [0x2f15 resolution 24 default_name 'Post box']
amenity=post_office [0x2f05 resolution 24]
amenity=prison [0x3007 resolution 24]
amenity=prison [0x3007 resolution 24 default_name 'Prison']
amenity=pub [0x2d02 resolution 24]
amenity=public_building [0x3007 resolution 24]
amenity=recycling [0x2f15 resolution 24]
amenity=recycling [0x2f15 resolution 24 default_name 'Recycling']
amenity=restaurant & cuisine=american [0x2a01 resolution 24]
amenity=restaurant & cuisine=asian [0x2a02 resolution 24]
amenity=restaurant & cuisine=bagel [0x2a0d resolution 24]
amenity=restaurant & cuisine=barbecue [0x2a03 resolution 24]
amenity=restaurant & cuisine=british [0x2a11 resolution 24]
amenity=restaurant & cuisine='cafe/diner' [0x2a0e resolution 24]
amenity=restaurant & cuisine=chinese [0x2a04 resolution 24]
amenity=restaurant & cuisine=curry [0x2a02 resolution 24]
amenity=restaurant & cuisine=deli [0x2a05 resolution 24]
amenity=restaurant & cuisine=french [0x2a0f resolution 24]
amenity=restaurant & cuisine=fish_and_chips [0x2a11 resolution 24]
amenity=restaurant & (cuisine=german | cuisine=bavarian) [0x2a10 resolution 24]
amenity=restaurant & cuisine=grill [0x2a03 resolution 24]
amenity=restaurant & cuisine=indian [0x2a02 resolution 24]
amenity=restaurant & cuisine=international [0x2a06 resolution 24]
amenity=restaurant & cuisine=italian [0x2a08 resolution 24]
amenity=restaurant & cuisine=japanese [0x2a02 resolution 24]
......@@ -162,12 +170,15 @@ amenity=restaurant & cuisine=korean [0x2a02 resolution 24]
amenity=restaurant & cuisine=mexican [0x2a09 resolution 24]
amenity=restaurant & cuisine~'.*pizza.*' [0x2a0a resolution 24]
amenity=restaurant & cuisine=sea_food [0x2a0b resolution 24]
# often "seafood" is used instead of official tag "sea_food"
amenity=restaurant & cuisine=seafood [0x2a0b resolution 24]
amenity=restaurant & cuisine=spanish [0x2a09 resolution 24]
amenity=restaurant & cuisine=speciality [0x2a12 resolution 24]
amenity=restaurant & cuisine=steak [0x2a0c resolution 24]
amenity=restaurant & cuisine=thai [0x2a02 resolution 24]
amenity=restaurant & cuisine=* [0x2a13 resolution 24]
amenity=restaurant & cuisine=* {add name='${cuisine|subst:"_=> "}'} [0x2a13 resolution 24]
amenity=restaurant [0x2a00 resolution 24]
amenity=school [0x2c05 resolution 24]
# amenity=shelter is ambiguous; when possible, consider using other tags:
# tourism=lean_to or tourism=picnic_site
......@@ -207,10 +218,11 @@ leisure=marina [0x4300 resolution 24]
leisure=nature_reserve & name=* [0x6612 resolution 24]
leisure=park [0x2c06 resolution 24]
leisure=pitch {name '${name} (${sport})' | '${name}'} [0x2c08 resolution 24]
leisure=playground [0x2c06 resolution 24]
leisure=recreation_ground [0x2c08 resolution 24]
leisure=playground [0x2c06 resolution 24 default_name 'Playground']
leisure=recreation_ground [0x2c08 resolution 24 default_name 'Rec.']
leisure=sports_center | leisure=sports_centre {name '${name} (${sport})' | '${name}'} [0x2d0a resolution 24]
leisure=stadium {name '${name} (${sport})' | '${name}'} [0x2c08 resolution 24]
leisure=swimming_pool [0x2d09 resolution 24]
leisure=track {name '${name} (${sport})' | '${name}'} [0x2c08 resolution 24]
leisure=water_park [0x2d09 resolution 24]
......@@ -259,7 +271,7 @@ shop=shoes [0x2e07 resolution 24]
shop=supermarket [0x2e02 resolution 24]
shop=tires [0x2f07 resolution 24]
shop=tyres [0x2f07 resolution 24]
shop=* & shop!=no & shop!=none [0x2e0c resolution 24]
shop=* & shop!=no & shop!=none {add name='${shop|subst:"_=> "}'} [0x2e0c resolution 24]
sport=9pin [0x2d07 resolution 24]
sport=10pin | leisure=bowling_alley [0x2d07 resolution 24]
......@@ -274,6 +286,7 @@ tourism=attraction & historic=* [0x2c02 resolution 24]
tourism=attraction [0x2c04 resolution 24]
tourism=artwork [0x2c04 resolution 24]
tourism=aquarium [0x2c07 resolution 24]
tourism=bed_and_breakfast [0x2b02 resolution 24]
tourism=camp_site [0x2b05 resolution 24]
tourism=caravan_site [0x2b05 resolution 24]
tourism=chalet [0x2b02 resolution 24]
......@@ -290,6 +303,8 @@ tourism=theme_park [0x2c01 resolution 24]
tourism=viewpoint {name '${name} - ${description}' | '${name}'} [0x2c04 resolution 24]
tourism=wine_cellar [0x2c0a resolution 24]
tourism=zoo [0x2c07 resolution 24]
tourism=* & tourism!=yes & tourism!=no {add name='${tourism|subst:"_=> "}'}
tourism=* & tourism!=no [0x2c0d resolution 24]
barrier=bollard | barrier=bus_trap | barrier=gate [0x660f resolution 24]
barrier=block | barrier=cycle_barrier | barrier=stile | barrier=kissing_gate [0x660f resolution 24]
......@@ -309,5 +324,6 @@ landuse=cemetery|landuse=cemetary|amenity=grave_yard [0x6403 resolution 24]
<finalize>
# The finalizer section is executed for each element when a rule with an element type matches
name=* {name '${name}'}
include 'inc/address';
......@@ -18,7 +18,7 @@ include 'inc/name';
aeroway=airport [0x07 resolution 20]
aeroway=aerodrome [0x07 resolution 20]
aeroway=runway {name '${ref}'} [0x0e resolution 20]
(aeroway=taxiway | aeroway=taxilane) {name '${ref}'} [0x0e resolution 24]
aeroway=taxiway | aeroway=taxilane {name '${ref}'} [0x0e resolution 24]
aeroway=heliport [0x07 resolution 20]
aeroway=helipad [0x0e resolution 22]
......@@ -34,8 +34,7 @@ amenity=supermarket [0x08 resolution 22]
amenity=university [0x0a resolution 21]
healthcare=hospital | amenity=hospital | amenity=clinic [0x0b resolution 22]
healthcare=* | amenity=dentist | amenity=doctors | amenity=nursing_home
[0x0b resolution 23]
healthcare=* | amenity=dentist | amenity=doctors | amenity=nursing_home [0x0b resolution 23]
leisure=common [0x17 resolution 21]
leisure=garden [0x17 resolution 21]
......@@ -53,7 +52,7 @@ leisure=water_park [0x09 resolution 21]
place=village [0x03 resolution 19]
shop=* [0x08 resolution 22]
shop=* {add name='${shop|subst:"_=> "}'} [0x08 resolution 22]
# squares and plazas
highway=pedestrian & (area=yes | mkgmap:mp_created=true) [0x17 resolution 22]
......@@ -64,7 +63,7 @@ historic=museum | historic=memorial [0x1e resolution 21]
historic=archaeological_site | historic=ruins [0x1e resolution 21]
landuse=basin [0x3f resolution 20]
(landuse=reservoir | (natural=water & water=reservoir)) [0x3f resolution 20]
landuse=reservoir | (natural=water & water=reservoir) [0x3f resolution 20]
natural=bay [0x3d resolution 18]
natural=glacier [0x4d resolution 18]
......@@ -90,9 +89,9 @@ landuse=military [0x04 resolution 19]
landuse=quarry [0x0c resolution 19]
landuse=recreation_ground [0x19 resolution 19]
# dedicate resolution 24 for building=* instead of related landuse=*
landuse=industrial [0x0c resolution 23-19]
landuse=residential [0x10 resolution 23-19]
landuse=retail [0x08 resolution 23-20]
landuse=industrial [0x0c resolution 19-23]
landuse=residential [0x10 resolution 19-23]
landuse=retail [0x08 resolution 20-23]
landuse=village_green [0x17 resolution 20]
landuse=vineyard [0x4e resolution 20]
landuse=orchard [0x4e resolution 20]
......@@ -106,18 +105,17 @@ natural=scrub [0x4f resolution 20]
natural=wood [0x50 resolution 20]
# building tag should be last
(building=* | amenity=*) & area!=no & amenity!=grave_yard [0x13 resolution 24]
tourism=* & area!=no & waterway!=* [0x1f resolution 24]
amenity=* & area!=no & amenity!=grave_yard {add name='${amenity|subst:"_=> "}'} [0x13 resolution 24]
building=* & building!=no [0x13 resolution 24]
tourism=* & area!=no & waterway!=* {add name='${tourism|subst:"_=> "}'} [0x1f resolution 24]
# man_made can be used on areas or lines
man_made=* & area!=no
& (man_made!=door & man_made!=embankment & man_made!=breakwater
& man_made!=cable_line & man_made!=cutline & man_made!=cutting
& man_made!=levee & man_made!=trench
& man_made!=groyne & man_made!=reinforced_slope)
[0x13 resolution 24]
man_made=* & area!=no & (
man_made!=door & man_made!=embankment & man_made!=breakwater & man_made!=cable_line & man_made!=cutline &
man_made!=cutting & man_made!=levee & man_made!=trench & man_made!=groyne & man_made!=reinforced_slope)
{add name='${man_made|subst:"_=> "}'} [0x13 resolution 24]
man_made=* & area=yes
[0x13 resolution 24]
man_made=* & area=yes {add name='${man_made|subst:"_=> "}'} [0x13 resolution 24]
# render small named islands
place=island & name=* & area_size() < 1000000 [0x53 resolution 19]
......@@ -126,7 +124,7 @@ place=islet & name=* [0x53 resolution 20]
<finalize>
# The finalizer section is executed for each element when a rule with an element type matches
# we need addrees info from buildings for the address search
# we need address info from buildings for the address search
include 'inc/address';
name=* {name '${name}'}
......@@ -282,7 +282,7 @@ public class ColourInfo implements Writeable, AlphaAdder {
// in each of the day/night sections.
if (numberOfColours > 4)
return ("Too many colours for a line or polygon");
return "Too many colours for a line or polygon";
if (numberOfColours == 0)
return "Line or polygon cannot have zero colours";
......
......@@ -294,9 +294,6 @@ public class MdrBuilder implements Combiner {
List<RoadDef> roads = mr.getRoads();
for (RoadDef road : roads) {
String name = road.getName();
if (name == null || name.isEmpty())
continue;
List<City> cities = road.getCities();
if (cities.isEmpty())
mdrFile.addStreet(road, null);
......
......@@ -185,6 +185,19 @@ public class MapRoad extends MapLine {
return false;
}
public int getLabelPos(String label){
if (label == null)
return -1;
for (int i = 0; i < labels.length; i++){
if (labels[i] == null){
return -1;
}
if (labels[i].equals(label))
return i;
}
return -1;
}
public String toString(){
if ((getName() == null || getName().isEmpty()) && getStreet() != null)
return "id="+this.getRoadDef().getId() + ", (" + this.getStreet() + ")";
......
......@@ -26,6 +26,7 @@ import java.nio.channels.FileChannel;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.StandardCharsets;
import java.nio.file.StandardOpenOption;
import uk.me.parabola.imgfmt.ExitException;
......@@ -211,9 +212,14 @@ public class TypCompiler implements MapProcessor {
}
private void setCodePage(String codePage) {
if ("cp65001".equalsIgnoreCase(codePage)) {
this.codePage = "utf-8";
this.encoder = StandardCharsets.UTF_8.newEncoder();
} else {
this.codePage = codePage;
this.encoder = Charset.forName(codePage).newEncoder();
}
}
private String probeCharset(String file) {
String readingCharset = "utf-8";
......
......@@ -312,6 +312,12 @@ public class HousenumberMatch extends HousenumberElem {
return false;
if (getSign().equals(other.getSign()) == false)
return false;
if (getPlace() != other.getPlace()) {
if (getPlace() == null)
return false;
if (getPlace().equals(other.getPlace()) == false)
return false;
}
if (getZipCode() != null && other.getZipCode() != null){
if (getZipCode().equals(other.getZipCode()) == false)
return false;
......
......@@ -559,11 +559,17 @@ public class HousenumberRoad {
log.info("dropped label",droppedLabel,"for",road,"in preference to correct address search. Labels are now:",Arrays.toString(labels));
}
}
if (furtherNames != null){
boolean changed = false;
for (String furtherName : furtherNames){
if (road.getLabelPos(furtherName) == -1) {
if (road.addLabel(furtherName))
changed = true;
else {
log.warn("could not add further label",furtherName, "for",road);
}
}
}
if (changed){
log.info("added further labels for",road,"Labels are now:",Arrays.toString(labels));
......
......@@ -108,6 +108,7 @@ public abstract class MapperBasedMapDataSource implements MapDataSource, Configu
background.setPoints(mapper.getBounds().toCoords());
background.setType(0x4b); // background type
background.setMinResolution(0); // On all levels
background.setFullArea(Long.MAX_VALUE-1); // sea also SEA_SIZE in SeaGenerator
mapper.addShape(background);
}
......
......@@ -104,7 +104,7 @@ public class SeaGenerator extends OsmReadingHooksAdaptor {
/**
* When order-by-decreasing-area we need all bit of sea to be output consistently.
* Unless _draworder changes things, having seaSize as BIG causes polygons beyond the
* Unless _draworder changes things, having SEA_SIZE as BIG causes polygons beyond the
* coastline to be shown. To hide these and have the sea show up to the high-tide
* coastline, can set this to be very small instead (or use _draworder).
* <p>
......@@ -112,7 +112,7 @@ public class SeaGenerator extends OsmReadingHooksAdaptor {
* natural=sea { add mkgmap:skipSizeFilter=true; set mkgmap:drawLevel=2 } [0x32 resolution 10]
* which is equivalent to Long.MAX_VALUE-2.
*/
private static final long seaSize = Long.MAX_VALUE-2; // sea is BIG
private static final long SEA_SIZE = Long.MAX_VALUE-2; // sea is BIG
/**
* Sort out options from the command line.
......@@ -670,7 +670,7 @@ public class SeaGenerator extends OsmReadingHooksAdaptor {
saver.addWay(w);
}
for (Way w : seaWays) {
w.setFullArea(seaSize);
w.setFullArea(SEA_SIZE);
saver.addWay(w);
}
} else {
......@@ -680,7 +680,7 @@ public class SeaGenerator extends OsmReadingHooksAdaptor {
// first add the complete bounding box as sea
Way sea = new Way(FakeIdGenerator.makeFakeId(),bounds.toCoords());
sea.addTag("natural", "sea");
sea.setFullArea(seaSize);
sea.setFullArea(SEA_SIZE);
for (Way w : landWays) {
saver.addWay(w);
......@@ -954,7 +954,7 @@ public class SeaGenerator extends OsmReadingHooksAdaptor {
ne.getLongitude() + 1));
sea.addPoint(sea.getPoints().get(0)); // close shape
sea.addTag("natural", "sea");
sea.setFullArea(seaSize);
sea.setFullArea(SEA_SIZE);
log.info("sea: ", sea);
saver.addWay(sea);
......
......@@ -257,6 +257,11 @@ public class Way extends Element {
this.isViaWay = isViaWay;
}
/**
* Allows to manipulate the area size which might be used to sort shapes when
* option --order-by-decreasing-area is active.
* @param fullArea
*/
public void setFullArea(long fullArea) {
this.fullArea = fullArea;
}
......
......@@ -369,6 +369,8 @@ public class CommonSection {
*/
protected Xpm readXpm(TokenScanner scanner, String header, boolean simple) {
ColourInfo colourInfo = readColourInfo(scanner, header);
xpmCheck(scanner, colourInfo);
String msg = colourInfo.analyseColours(simple);
if (msg != null)
throw new SyntaxException(scanner, msg);
......@@ -404,4 +406,12 @@ public class CommonSection {
if (!hasXpm)
throw new SyntaxException(scanner, "No XPM tag in section");
}
/**
* Check the colourInfo against any restrictions that apply to the element type.
*
* Subtypes make checks as appropriate, there are no common restrictions.
*/
protected void xpmCheck(TokenScanner scanner, ColourInfo colourInfo) {
}
}
......@@ -12,6 +12,7 @@
*/
package uk.me.parabola.mkgmap.typ;
import uk.me.parabola.imgfmt.app.typ.ColourInfo;
import uk.me.parabola.imgfmt.app.typ.TypData;
import uk.me.parabola.imgfmt.app.typ.TypLine;
import uk.me.parabola.mkgmap.scan.SyntaxException;
......@@ -62,4 +63,14 @@ class LineSection extends CommonSection implements ProcessSection {
current.finish();
data.addLine(current);
}
protected void xpmCheck(TokenScanner scanner, ColourInfo colourInfo) {
int width = colourInfo.getWidth();
if (width == 0)
return;
if (width != 32)
throw new SyntaxException(scanner, "Line bitmaps must be 32 bits wide");
}
}
......@@ -12,8 +12,10 @@
*/
package uk.me.parabola.mkgmap.typ;
import uk.me.parabola.imgfmt.app.typ.ColourInfo;
import uk.me.parabola.imgfmt.app.typ.TypData;
import uk.me.parabola.imgfmt.app.typ.TypPolygon;
import uk.me.parabola.mkgmap.scan.SyntaxException;
import uk.me.parabola.mkgmap.scan.TokenScanner;
/**
......@@ -45,4 +47,30 @@ class PolygonSection extends CommonSection implements ProcessSection {
validate(scanner);
data.addPolygon(current);
}
/**
* Check xmp restrictions for polygons.
*
* The main one is that bitmaps must be 32x32. Only certain numbers of colours are
* allowed as well.
*/
protected void xpmCheck(TokenScanner scanner, ColourInfo colourInfo) {
int width = colourInfo.getWidth();
int height = colourInfo.getHeight();
switch (colourInfo.getNumberOfColours()) {
case 1:
case 2:
case 4:
break;
default:
throw new SyntaxException(scanner, "Polygons must have 1, 2 or 4 colours");
}
if (width == 0 && height == 0)
return;
if (height != 32 || width != 32)
throw new SyntaxException(scanner, "Polygon bitmaps must be 32x32");
}
}