Hi all

I've re-made this set of changes, along with a few improvements that
I've gathered over the last 6 months. Following list numbering is the
same as original patch, but include some [extra] notes + new items at
the end.

Relevant threads:
http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2020q3/031375.html
http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2020q3/031424.html

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.

[extra] In all cases where unconnected/semi-connected changes are
mentioned, this only applies to lines not derived from an original/OSM
standard highway.

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.
[extra] A few more tweaked.

13/ Use 0x09 (high-speed ramp) for road class 4 links

14/ Add footway around car parks if 'connecting'.
[extra] This change is disabled.

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).
[extra] This change is disabled

20/ Speed up car ferries.

21/ A few other layout/space fixes.

Additional changes:

22/ motorroad=yes just sets mkgmap:fast_road, which generally increases
the speed/class of the highway and decreases the resolution

23/ natural=landslide like other barriers (eg cliff)

24/ Don't generate (routable) line for highway=unclassified & area=yes;
there are many instances in OSM where this is used to draw a polygon
around a complex junction.

25/ Change the bridleway from 0x07 (Alley) to 0x16 (Trail)

26/ For ferry/platform/aerialway, blank out address fields to prevent
it getting into the Address index

27/ Add comment about colour pallet to mapnik.txt

Patch attached

Ticker

On Tue, 2021-02-09 at 11:30 +0100, Carlos Dávila wrote:
> On [1] Ticker proposed a set of changes to default style lines file. 
> There was a long discussion about point #14, which ended without a 
> consensus. Other changes didn't get any objection, but they didn't
> get 
> into trunk. I agree with numbers 1, 6, 8, 10, 15, 17, 18. Also with 7
> and 16, but for unconnected ways only, see #3.
> 
> 2: more codes could be added for wider highways and their
> corresponding 
> entries in mapnik.txt
> 
> 3: not sure about this one, specially about semi-connected ways,
> which I 
> think should remain as routable (also applies for 7, 16).
> 
> [1] http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2020q3/031375.html
> 
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev@lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Index: resources/styles/default/lines
===================================================================
--- resources/styles/default/lines	(revision 4600)
+++ 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 {
@@ -94,6 +102,8 @@
 # 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}
+motorroad=yes {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}
@@ -115,12 +125,25 @@
 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']
+natural=landslide [0x2b resolution 22 default_name 'Landslide']
 
 # 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,29 +168,32 @@
 # 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]
-highway=* & motorroad=yes [0x02 road_class=4 road_speed=4 resolution 18]
 highway=primary & mkgmap:fast_road=yes [0x03 road_class=4 road_speed=4 resolution 17]
 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=*) & mkgmap:fast_road=yes [0x0b road_class=4 road_speed=2 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=2 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,22 +202,26 @@
 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 & area!=yes [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]
-highway=bridleway [0x07 road_class=0 road_speed=0 resolution 23]
+highway=bridleway [0x16 road_class=0 road_speed=0 resolution 23]
 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 +228,17 @@
 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
+# This is disabled by default; uncomment the following rule if required
+#(parking=surface | (amenity=parking & parking!=*)) & access!=private & access!=no {
+#    set foot=yes;
+#    set vehicle=no;
+#    set mkgmap:set_unconnected_type=none;
+#    set mkgmap:set_semi_connected_type=none;
+#    set mkgmap:numbers=false;
+#    } [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 +256,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 +268,24 @@
 # 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:set_unconnected_type=none;
+    set mkgmap:set_semi_connected_type=none;
+    set mkgmap:numbers=false;
+    # Stop this being indexed as address
+    set mkgmap:street='';
+    set mkgmap:city='';
+    set mkgmap:region='';
+    set mkgmap:postal_code='';
+    set mkgmap:country='';
+    } [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 +302,42 @@
 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:ferry=yes;
+    set mkgmap:numbers=false;
+    # Stop this being indexed as address
+    set mkgmap:street='';
+    set mkgmap:city='';
+    set mkgmap:region='';
+    set mkgmap:postal_code='';
+    set mkgmap:country='';
+    } [0x2f road_class=0 road_speed=1 resolution 22]
+
+# Show old railways where the way hasn't been re-purposed as a highway
+# This is disabled by default; uncomment the next 2 lines if required
+#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:ferry=yes;
+    set mkgmap:toll='${toll}' | '${fee}' | yes;
+    set mkgmap:numbers=false;
+    # Stop this being indexed as address
+    set mkgmap:street='';
+    set mkgmap:city='';
+    set mkgmap:region='';
+    set mkgmap:postal_code='';
+    set mkgmap:country='';
+    }
 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 +344,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 +368,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 4600)
+++ resources/typ-files/mapnik.txt	(working copy)
@@ -13,7 +13,16 @@
 
 Author: jori...@hotmail.com and others
 
-Based on mkgmap default style version: r4293
+Based on mkgmap default style version: r460x
+
+Older Garmin devices (eg. gpsmap 60s, eTrex HCx) operate with a 256 colour pallet;
+actually 254 as B/W duplicated, but includes transparent. Use these if possible. Values are:
+ Colours - any combination of:
+  R 00        39          7B           BD        FF
+  G 00      30         65       95       CA      FF
+  B 00    20    41      6A    8B     B4    D5    FF
+ Greys - RGB same val:
+    00 10 20 31 41 52 62 73 83 94 A4 B4 C5 D5 E6 FF
 [End]
 
 
@@ -1529,7 +1538,7 @@
 CustomColor=No
 [end]
 [_line]
-type=0x17
+type=0x2b
 ;GRMN_TYPE: //
 UseOrientation=N
 LineWidth=1
@@ -1561,6 +1570,20 @@
 DaycustomColor:#4D80B3
 [end]
 [_line]
+Type=0x19
+String=Course of old Railway
+UseOrientation=N
+Xpm="32 5 2 1"
+    "+ c #949494"
+    "  c none"
+    "    +       +       +       +   "
+    "    +       +       +       +   "
+    "  ++++++  ++++++  ++++++  ++++++"
+    "    +       +       +       +   "
+    "    +       +       +       +   "
+;   "12345678901234567890123456789012"
+[end]
+[_line]
 type=0x1a
 ;GRMN_TYPE: Roads/INTERNATIONAL_FERRY/Major water or rail ferry/Non NT, NT
 UseOrientation=N
@@ -1857,7 +1880,7 @@
 CustomColor=No
 [end]
 [_line]
-type=0x30
+type=0x2a
 ;GRMN_TYPE: //
 UseOrientation=Y
 LineWidth=7
@@ -1875,6 +1898,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

Reply via email to