logo separator

[mkgmap-dev] Strange long distance routes on Nüvi

From Andrzej Popowski popej at poczta.onet.pl on Thu Jul 27 17:14:34 BST 2017

Hi,

here is attached my proposition for improving long distance routing. 
Please test and check if it helps.

-- 
Best regards,
Andrzej
-------------- next part --------------
Index: resources/styles/default/lines
===================================================================
--- resources/styles/default/lines	(revision 3975)
+++ resources/styles/default/lines	(working copy)
@@ -94,6 +94,11 @@
 
 highway=* & mkgmap:unpaved!=1 & smoothness ~ '.*(bad|horrible|impassable)'  { add mkgmap:road-speed = '-2' } 
 
+# Good ways without relation
+highway=* & mkgmap:good_road!=* & (int_ref=* | network=e-road | network=AH | network=TAH | network=US:I | network=US:US) {add mkgmap:good_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:good_road}
+
 # Convert generic path to most specific
 highway=footway & snowplowing!=no
 & (bicycle=yes|bicycle=designated|bicycle=permissive|bicycle=official)
@@ -113,9 +118,15 @@
 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]
 
+junction=roundabout & (highway=primary | highway=primary_link) & mkgmap:good_road=yes [0x0c road_class=4 road_speed=2 resolution 24 continue]
+junction=roundabout & (highway=primary | highway=primary_link) & mkgmap:good_road=yes [0x10802 resolution 19]
+
 junction=roundabout & (highway=primary | highway=primary_link) [0x0c road_class=3 road_speed=2 resolution 24 continue]
 junction=roundabout & (highway=primary | highway=primary_link) [0x10802 resolution 19]
 
+junction=roundabout & (highway=secondary | highway=secondary_link) & mkgmap:good_road=yes [0x0c road_class=3 road_speed=2 resolution 24 continue]
+junction=roundabout & (highway=secondary | highway=secondary_link) & mkgmap:good_road=yes [0x10803 resolution 20]
+
 junction=roundabout & (highway=secondary | highway=secondary_link) [0x0c road_class=2 road_speed=2 resolution 24 continue]
 junction=roundabout & (highway=secondary | highway=secondary_link) [0x10803 resolution 20]
 
@@ -125,6 +136,7 @@
 junction=roundabout & (highway=unclassified | highway=minor ) [0x0c road_class=1 road_speed=1 resolution 21]
 junction=roundabout & highway=* [0x0c road_class=0 road_speed=1 resolution 22]
 
+highway=mini_roundabout [0x0c road_class=0 road_speed=1 resolution 23]
 
 # Ways that may or may not be useable
 
@@ -138,22 +150,25 @@
 highway=* & disused=yes & maxspeed!=* { add mkgmap:road-speed = '-2' }
 
 # Ways sorted roughly by descending order of class
-highway=motorway & network=e-road [0x01 resolution 14-14 continue]
-highway=motorway  [0x01 road_class=4 road_speed=7 resolution 15]
-highway=motorway_link & (mkgmap:exit_hint=true | mkgmap:dest_hint=*) [0x06 road_class=3 road_speed=2 resolution 20]
-highway=motorway_link [0x09 road_class=3 road_speed=2 resolution 20]
+highway=motorway & mkgmap:good_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=*) [0x06 road_class=4 road_speed=2 resolution 20]
+highway=motorway_link [0x09 road_class=4 road_speed=2 resolution 20]
 
-highway=trunk & ( network=e-road | int_ref=* ) [0x02 resolution 15-17 continue]
+highway=trunk & mkgmap:good_road=yes [0x02 road_class=4 road_speed=5 resolution 15]
 highway=trunk [0x02 road_class=4 road_speed=5 resolution 18]
-highway=trunk_link & (mkgmap:exit_hint=true | mkgmap:dest_hint=*) [0x06 road_class=3 road_speed=2 resolution 20]
-highway=trunk_link [0x09 road_class=3 road_speed=2 resolution 20]
+highway=trunk_link & (mkgmap:exit_hint=true | mkgmap:dest_hint=*) [0x06 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 & ( network=e-road | int_ref=* ) [0x03 resolution 17-18 continue]
+highway=primary & mkgmap:good_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=*)[0x06 road_class=3 road_speed=1 resolution 21]
+highway=primary_link & (mkgmap:exit_hint=true | mkgmap:dest_hint=*) & mkgmap:good_road=yes [0x06 road_class=4 road_speed=1 resolution 21]
+highway=primary_link & (mkgmap:exit_hint=true | mkgmap:dest_hint=*) [0x06 road_class=3 road_speed=1 resolution 21]
+highway=primary_link & mkgmap:good_road=yes [0x08 road_class=4 road_speed=1 resolution 21]
 highway=primary_link [0x08 road_class=3 road_speed=1 resolution 21]
-highway=secondary & ( network=e-road | int_ref=* ) [0x04 resolution 18-19 continue]
+highway=secondary & mkgmap:good_road=yes [0x04 road_class=3 road_speed=3 resolution 18]
 highway=secondary [0x04 road_class=2 road_speed=3 resolution 20]
+highway=secondary_link & mkgmap:good_road=yes [0x08 road_class=3 road_speed=1 resolution 22]
 highway=secondary_link [0x08 road_class=2 road_speed=1 resolution 22]
 highway=tertiary [0x05 road_class=1 road_speed=3 resolution 20]
 highway=tertiary_link [0x08 road_class=1 road_speed=1 resolution 22]
Index: resources/styles/default/relations
===================================================================
--- resources/styles/default/relations	(revision 3975)
+++ resources/styles/default/relations	(working copy)
@@ -16,6 +16,7 @@
 # and alphabetically by name first.
 # Currently, the matching relations will be processed and the names
 # appended to the boundary lines in an arbitrary order.
+
 (type=boundary | type=multipolygon) & boundary=administrative & name=*
 { apply
   {
@@ -23,9 +24,6 @@
   }
 }
 
-# European E-Road network
-route=road & network=e-road { apply { add ref='${ref}'; add int_ref='${int_ref}'; add network='e-road' } }
-
 # Public transportation routes.
 # We could want to sort the matching relations by ref first.
 type=route
@@ -53,3 +51,80 @@
   # We could want to copy the route relation name to unnamed route=ferry ways.
   # apply way { add name='${name}' }
 }
+
+# European E-Road network
+route=road & network=e-road {
+	apply {
+		add ref='${ref}';
+		add int_ref='${int_ref}';
+		add network='e-road'
+        add mkgmap:good_road=yes;
+	}
+}
+
+#USA road network
+type=route & route=road & historic!=yes & network=US:I
+{
+    apply {
+        set mkgmap:us_interstate='$(mkgmap:us_interstate);${ref|not-contained:;:mkgmap:us_interstate}' | '$(mkgmap:us_interstate)' | '${ref}';
+        add network='US:I';
+        add mkgmap:good_road=yes;
+    }
+}
+type=route & route=road & historic!=yes & network~'US:I:.*'
+{
+    apply {
+        add network='US:I';
+        add mkgmap:good_road=yes;
+    }
+}
+type=route & route=road & historic!=yes & network=US:US
+{
+    apply {
+        set mkgmap:us_usroute='$(mkgmap:us_usroute);${ref|not-contained:;:mkgmap:us_usroute}' | '$(mkgmap:us_usroute)' | '${ref}';
+        add network='US:US';
+        add mkgmap:good_road=yes;
+    }
+}
+type=route & route=road & historic!=yes & network~'US:US:.*'
+{
+    apply {
+        add network='US:US';
+        add mkgmap:good_road=yes;
+    }
+}
+type=route & route=road & historic!=yes & network~'US:.*' & !(network=US:I | network=US:US | network~'US:.*:.*')
+{
+    apply {
+        add mkgmap:us_state='$(mkgmap:us_state);${ref|not-contained:;:mkgmap:us_state}' | '$(mkgmap:us_state)' | '${ref}';
+        add network='${network}';
+    }
+}
+
+#Trans African Highway
+type=route & route=road & historic!=yes & (network~'TAH.*' | ref~'TAH.*' | network~'Trans.African Highway')
+{
+    apply {
+        add network='TAH';
+        add int_ref='${ref}';
+        add mkgmap:good_road=yes;
+    }
+}
+
+#Asian Highway
+type=route & route=road & historic!=yes & (network=AsianHighway | network=AH)
+{
+    apply {
+        add network='AsianHighway';
+        add int_ref='${ref}';
+        add mkgmap:good_road=yes;
+    }
+}
+
+#any higway
+type=route & route=road & historic!=yes & ref=*
+{
+    apply {
+        add ref='${ref}';
+    }
+}


More information about the mkgmap-dev mailing list