Hi all style gurus Patch attached of enhancements to default style "lines" which I've been accumulating for a while. Also includes the parallel changes needed to mapnik.txt
I'm happy to explain any of these change in more detail and, if anyone considers a particular change incorrect, provide a revised patch. Summary of changes, roughly in order of diffs in the patch. 1/ Sometimes charges for using a pedestrian highway are expressed as a fee rather than a toll, so pick this up in mkgmap:toll. 2/ Show bridges using type 0x10107. With the mapnik addition, these look good for narrow highways, but might not show for wide representations like motorways. 3/ Where it is likely that bits of highway might not be connected to the road/path system, use mkgmap:set_unconnected_type and mkgmap:set_semi_connected_type to stop the NET/NOD rather than relying on NETnoNOD (now disabled) and --check-routing-island-len=+ve, which is being suspected of causing problems on some devices and BaseCamp. 4/ Quote some filter subst strings that contain spaces - no actual effect but clearer and safer. 5/ Have line for leisure=track even if area. 6/ Change the type for tracks/raceways etc from 0x30, which doesn't show on BaseCamp or MapSource, to 0x2a. 7/ For piers, if 'unconnecting', use marine type 0x1040c (Obstruction: Pier or Jetty) instead of footway. 8/ Change type for the various barriers from 0x17, which doesn't show on BaseCamp to 0x2b, see: http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2020q1/030348.html 9/ Consider natural=cliff a barrier. 10/ Add motorway[_link] roundabouts (yes, some do exist). 11/ Unquote some numbers - no actual effect. 12/ Tweak some road speeds 13/ Use 0x09 (high-speed ramp) for road class 4 links 14/ Add footway around car parks if 'connecting'. 15/ Disable coastline. For a long time the tag was suppressed by the Sea processing and it adds little to the map. 16/ Improve railway platform names and suppress footway if not 'connecting'. 17/ Show disused:railway in the same way as railway=disused. 18/ Have cable_car, gondola, funicular as routable, by default with a toll and pedestrian only. 19/ Show "Course of old Railway", unless a highway has taken over the way (for you Eric, but I like it as well). 20/ Speed up car ferries. 21/ A few other layout/space fixes. Ticker
Index: resources/styles/default/lines =================================================================== --- resources/styles/default/lines (revision 4564) +++ resources/styles/default/lines (working copy) @@ -19,8 +19,8 @@ # Assign the street name for house number search highway=* & name=* {set mkgmap:street='${name}'} -# Mark highways with the toll flag -highway=* & (toll=yes | toll=true) {set mkgmap:toll=yes} +# Mark highways with the toll flag (fee is sometimes used on pedestrian type routes) +highway=* & (toll=* | fee=*) {set mkgmap:toll='${toll}' | '${fee}'} # Hide proposed ways highway=proposed | highway=proposal | highway=planned | highway~'.*proposed.*' {delete highway; delete junction} @@ -40,6 +40,14 @@ highway=piste | highway=ski {delete highway} highway=no | highway=none {delete highway} +# Show bridges. Often these also have unconnected highway=track/... If so, we would like to cause these to +# be deleted, but setting the highway replacement type to 'none' also deletes the duplicate 'bridge' way +# so replace by 'bridge' instead. This currently generates an exact duplicate way. +bridge=* & bridge!=no { + set mkgmap:set_unconnected_type =0x10107; + set mkgmap:set_semi_connected_type=0x10107; + } [0x10107 resolution 22 continue with_actions] + # Disable dead-end-checks for unaccessible oneways highway=* & oneway=yes & (access=private | access=no) {add mkgmap:dead-end-check=false} # Validation-like checks (uncomment to enable) @@ -51,9 +59,9 @@ # motorway_link, trunk_link, primary_link, secondary_link, tertiary_link # build destination hint 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:/=> }'; + 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 { @@ -115,12 +123,24 @@ highway=path & foot=designated {set highway=footway} -leisure=track & area!=yes {name '${name} (${sport})' | '${sport}'} [0x30 resolution 22] -man_made=pier | man_made=piste:halfpipe {add highway=footway; name '${ref} ${name}' | '${ref}' | '${name}'} +leisure=track {name '${name} (${sport})' | '${sport}'} [0x2a resolution 22] +man_made=piste:halfpipe {add highway=footway; name '${ref} ${name}' | '${ref}' | '${name}'} +# Add walkway along/around the pier if connects other highways. +# If it doesn't connect use 0x1040c which is "Obstruction Line: Pier/Jetty" +man_made=pier { + add highway=footway; + name '${ref} ${name}' | '${ref}' | '${name}'; + set mkgmap:set_unconnected_type =0x1040c; + set mkgmap:set_semi_connected_type=0x1040c; + } -man_made=breakwater & is_closed()=false & mkgmap:mp_created!=true [0x17 resolution 22 default_name 'Breakwater'] +man_made=breakwater & is_closed()=false & mkgmap:mp_created!=true [0x2b resolution 22 default_name 'Breakwater'] +natural=cliff [0x2b resolution 22 default_name 'Cliff'] # Roundabouts +junction=roundabout & (highway=motorway | highway=motorway_link) [0x0c road_class=4 road_speed=4 resolution 24 continue] +junction=roundabout & (highway=motorway | highway=motorway_link) [0x10801 resolution 18] + junction=roundabout & (highway=trunk | highway=trunk_link) [0x0c road_class=4 road_speed=2 resolution 24 continue] junction=roundabout & (highway=trunk | highway=trunk_link) [0x10801 resolution 18] @@ -145,20 +165,24 @@ # 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; + set mkgmap:set_unconnected_type=none; + set mkgmap:set_semi_connected_type=none; + } [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'} +highway=* & construction=* & maxspeed!=* {add mkgmap:road-speed=-1} # Lower the road speed of disused ways. -highway=* & disused=yes & maxspeed!=* {add mkgmap:road-speed='-2'} +highway=* & disused=yes & maxspeed!=* {add mkgmap:road-speed=-2} # Ways sorted roughly by descending order of class highway=motorway & mkgmap:fast_road=yes [0x01 road_class=4 road_speed=7 resolution 14] highway=motorway [0x01 road_class=4 road_speed=7 resolution 15] -highway=motorway_link & (mkgmap:exit_hint=true | mkgmap:dest_hint=*) [0x0b road_class=4 road_speed=2 resolution 20] -highway=motorway_link [0x09 road_class=4 road_speed=2 resolution 20] +highway=motorway_link & (mkgmap:exit_hint=true | mkgmap:dest_hint=*) [0x0b road_class=4 road_speed=4 resolution 20] +highway=motorway_link [0x09 road_class=4 road_speed=4 resolution 20] -highway=trunk & mkgmap:fast_road=yes [0x02 road_class=4 road_speed=5 resolution 15] +highway=trunk & mkgmap:fast_road=yes [0x02 road_class=4 road_speed=6 resolution 15] highway=trunk [0x02 road_class=4 road_speed=5 resolution 18] highway=trunk_link & (mkgmap:exit_hint=true | mkgmap:dest_hint=*) [0x0b road_class=4 road_speed=2 resolution 20] highway=trunk_link [0x09 road_class=4 road_speed=2 resolution 20] @@ -167,7 +191,7 @@ highway=primary [0x03 road_class=3 road_speed=4 resolution 19] highway=primary_link & (mkgmap:exit_hint=true | mkgmap:dest_hint=*) & mkgmap:fast_road=yes [0x0b road_class=4 road_speed=1 resolution 21] highway=primary_link & (mkgmap:exit_hint=true | mkgmap:dest_hint=*) [0x0b road_class=3 road_speed=1 resolution 21] -highway=primary_link & mkgmap:fast_road=yes [0x08 road_class=4 road_speed=1 resolution 21] +highway=primary_link & mkgmap:fast_road=yes [0x09 road_class=4 road_speed=1 resolution 21] highway=primary_link [0x08 road_class=3 road_speed=1 resolution 21] highway=secondary & mkgmap:fast_road=yes [0x04 road_class=3 road_speed=3 resolution 18] highway=secondary [0x04 road_class=2 road_speed=3 resolution 20] @@ -176,14 +200,18 @@ highway=tertiary [0x05 road_class=1 road_speed=3 resolution 20] highway=tertiary_link [0x08 road_class=1 road_speed=1 resolution 22] highway=minor [0x06 road_class=1 road_speed=3 resolution 21] -highway=unclassified [0x06 road_class=0 road_speed=3 resolution 21] +highway=unclassified [0x06 road_class=1 road_speed=2 resolution 21] highway=yes {set highway=footway} # fix common bad tagging - little bits of path to join other routable ways # Some countries allow, others disallow bicycling on pedestrian streets. See inc/access_country -# highway=pedestrian could be closed polygon to represent a 'square', add route regardless and continue for polygon processing -highway=pedestrian {set tmp:stopMopUp=yes} [0x16 road_class=0 road_speed=0 resolution 22 continue with_actions] +# highway=pedestrian could be closed polygon to represent a 'square', add routable if connecting and continue for polygon processing +highway=pedestrian { + set tmp:stopMopUp=yes; + set mkgmap:set_unconnected_type=none; + set mkgmap:set_semi_connected_type=none; + } [0x16 road_class=0 road_speed=0 resolution 22 continue with_actions] highway=living_street [0x06 road_class=0 road_speed=1 resolution 22] highway=residential [0x06 road_class=0 road_speed=2 resolution 22] @@ -191,7 +219,7 @@ highway=byway [0x16 road_class=0 road_speed=0 resolution 23] highway=driveway {set highway=service; add service=driveway} # fix common bad tagging -highway=access {set highway=service} # fix common bad tagging +highway=access {set highway=service} # fix common bad tagging highway=access_ramp {set highway=footway} # proposed highway=service & service=parking_aisle [0x07 road_class=0 road_speed=1 resolution 24] @@ -198,6 +226,16 @@ 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] +# Car parks often have multiple footway access; frequently these don't join up but are necessary to make +# a continuous trail, so add a routable way that will be removed again if it doesn't join anything +(parking=surface | (amenity=parking & parking!=*)) & access!=private & access!=no { + set foot=yes; + set vehicle=no; + set mkgmap:numbers=false; + set mkgmap:set_unconnected_type=none; + set mkgmap:set_semi_connected_type=none; + } [0x16 road_class=0 road_speed=0 resolution 23 continue] + highway=cycleway [0x11 road_class=0 road_speed=1 resolution 23] # highway=footway is often an area as well, continue for polygon processing @@ -215,7 +253,7 @@ [0x07 road_class=0 road_speed=0 resolution 24] # These are too specialized to have routing, so shouldn't drop into the mop-up, but, maybe needing TYP, can be shown on the map -highway=raceway | highway=gallop {add name='${highway}'} [0x30 resolution 23] +highway=raceway | highway=gallop {name '${name} (${sport})' | '${name}' | '${sport}' | '${highway}'} [0x2a resolution 22] # Don't have routable for either of these: # most 'rest_area' don't connect to the main road @@ -227,12 +265,18 @@ # It is considered best not to process unrecognised highway types #highway=* & area!=yes & tmp:stopMopUp!=yes [0x07 road_class=0 road_speed=0 resolution 23] -natural=coastline [0x15 resolution 12] +# Showing the coastline adds almost nothing visuals of the map, so disable: +#natural=coastline [0x15 resolution 12] power=line [0x29 resolution 21] -railway=platform [0x16 road_class=0 road_speed=0 resolution 23] +railway=platform { + add name='Platform ${local_ref}' | 'Platform ${ref}' | 'Platform'; + set mkgmap:numbers=false; + set mkgmap:set_unconnected_type=none; + set mkgmap:set_semi_connected_type=none; + } [0x16 road_class=0 road_speed=0 resolution 24] # 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) +(railway=rail | railway=tram | railway=disused | disused:railway=* | 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 @@ -249,12 +293,24 @@ boundary=national [0x1e resolution 17] boundary=political [0x1c resolution 19] -barrier=wall | barrier=fence | barrier=hedge | barrier=ditch {add name='${barrier|subst:"_=> "}'} [0x17 resolution 24] +barrier=wall | barrier=fence | barrier=hedge | barrier=ditch {add name='${barrier|subst:"_=> "}'} [0x2b resolution 24] -route=ferry & (toll=no | toll=false) {set mkgmap:toll=no} -route=ferry {set mkgmap:numbers=false; set mkgmap:ferry=1; add mkgmap:toll=yes} +# Do some aerialways as pedestrian routes. Include funicular railways as similar point-to-point +aerialway=cable_car | aerialway=gondola | railway=funicular { + add aerialway=funicular; # for following + add name='${aerialway|subst:"_=> "}'; + add vehicle=no; + set mkgmap:toll='${toll}' | '${fee}' | yes; + set mkgmap:numbers=false; + } [0x2f road_class=0 road_speed=1 resolution 22] + +# Show old railways where the way hasn't been re-purposed as a highway +abandoned:railway=* | demolished:railway=* | removed:railway=* | razed:railway=* | was:railway=* | historic:railway=* {add railway=lifecyclePrefix} +railway=* & railway!=miniature & railway!=proposed & tunnel!=yes & highway!=* & is_closed()=false [0x19 resolution 22] + +route=ferry {set mkgmap:numbers=false; set mkgmap:ferry=1; set mkgmap:toll='${toll}' | '${fee}' | yes} route=ferry & (motorcar=no | motor_vehicle=no) [0x1b road_class=0 road_speed=0 resolution 23] -route=ferry [0x1a road_class=3 road_speed=0 resolution 19] +route=ferry [0x1a road_class=3 road_speed=1 resolution 19] (waterway=river | waterway=canal) & intermittent=yes [0x26 resolution 20] (waterway=stream | waterway=drain) & intermittent=yes [0x26 resolution 22] @@ -261,7 +317,7 @@ waterway=canal [0x1f resolution 21] waterway=river [0x1f resolution 18] -waterway=rapids|waterway=waterfall [0x1f resolution 22] +waterway=rapids | waterway=waterfall [0x1f resolution 22] waterway=stream | waterway=drain [0x18 resolution 22] # mop up any remaining water lines @@ -285,7 +341,7 @@ # don't add house numbers to unnamed or artifical bicycle ways mkgmap:bicycle=yes & (mkgmap:foot=no & mkgmap:car=no & mkgmap:street!=* | mkgmap:synthesised=yes) {set mkgmap:numbers=false} -# Display highway shield for mayor roads if they have a ref and make them searchable by their name +# Display highway shield for major roads if they have a ref and make them searchable by their name (highway=motorway | highway=trunk) & ref=* {name '${ref|highway-symbol:hbox}'; addlabel '${name}'} highway=primary & ref=* {name '${ref|highway-symbol:box}' ; addlabel '${name}'} (highway=secondary | highway=tertiary) & ref=* {name '${ref|highway-symbol:oval}'; addlabel '${name}'} Index: resources/typ-files/mapnik.txt =================================================================== --- resources/typ-files/mapnik.txt (revision 4564) +++ resources/typ-files/mapnik.txt (working copy) @@ -13,7 +13,7 @@ Author: jori...@hotmail.com and others -Based on mkgmap default style version: r4293 +Based on mkgmap default style version: r456x [End] @@ -1529,7 +1529,7 @@ CustomColor=No [end] [_line] -type=0x17 +type=0x2b ;GRMN_TYPE: // UseOrientation=N LineWidth=1 @@ -1561,6 +1561,20 @@ DaycustomColor:#4D80B3 [end] [_line] +Type=0x19 +String=Course of old Railway +UseOrientation=N +Xpm="32 5 2 1" + "+ c #999999" + " c none" + " + + + + " + " + + + + " + " ++++++ ++++++ ++++++ ++++++" + " + + + + " + " + + + + " +; "12345678901234567890123456789012" +[end] +[_line] type=0x1a ;GRMN_TYPE: Roads/INTERNATIONAL_FERRY/Major water or rail ferry/Non NT, NT UseOrientation=N @@ -1857,7 +1871,7 @@ CustomColor=No [end] [_line] -type=0x30 +type=0x2a ;GRMN_TYPE: // UseOrientation=Y LineWidth=7 @@ -1875,6 +1889,38 @@ CustomColor=No [end] [_line] +Type=0x2f +String=Cable Car +UseOrientation=Y +Xpm="32 6 2 1" + "x c #000000" + " c none" + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + " x " + " xxxxxxxxxxxxx " + " x x " + " x x " + " xxxxxxxxxxxxx " +; "12345678901234567890123456789012" +[end] +[_line] +Type=0x10107 +String=Bridge +; lines either side of transparent +UseOrientation=N +Xpm="32 7 2 1" + "- c #000000" + " c none" + "--------------------------------" + " " + " " + " " + " " + " " + "--------------------------------" +; "12345678901234567890123456789012" +[end] +[_line] type=0x10801 ;GRMN_TYPE: // UseOrientation=N
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev