I changed some stuff to make routing a bit better. Anyone tried it out?


On 01.12.2009 12:42, Felix Hartmann wrote:


On 01.12.2009 12:38, Clinton Gladstone wrote:
2009/12/1 Felix Hartmann<[email protected]>:
As announced yesterday - here is a patch against the default-style-file to
heavily improve Autorouting for cars/motorcycles.
So this patch, if I understand it correctly, creates duplicate ways at
a higher resolution, but with a lower speed. Do you have any idea why
this improves routing?
Yes because of the fuc**d up Turn time Restrictions AND Garmin GPS/Mapsource trying far too hard to avoid sharp turns at higher speeds (which is a good idea, but not well implemented). The resolution does not matter - I put it at 24 because there is no need for them to be visible, and routing only depends on resolution=24.

This is a dirty hack, but the easiest to do, see below alternative solutions (wrote that in another thread here):

"Actually I have found a method to increase routing distance in Mapsource by 30-100% -due to the functionality introduced yesterday, however it blows up the map size by at least 10%. Will test it a bit more, and then add a patch for mkgmap default style. Based on my findings, I think we would really have to use the dp filter already BEFORE doing anything to get smoother/straighter roads AND work on junctions. I'ld guesstimate the following increases in routing distance (each thing on it`s own):

a) optimal - as discussed
Junction Angle and creating additional (invisble via typfile) "turn roads" ~ 500%
- Mapsize increase <5%

b) "Modest" patch:
Make a last 10m from each junction into any direction duplicate - decrease road_speed patch. >200% - Mapsize increase <5%, could even be used together with a) but will probably show no further improvements then.

c)"dirty style-file patch"
Add slower duplicate roads for primary/trunks/motorways/motorway_links. ~30-100%. - Drawback mapsize increase ~10%. The more duplicates, the better, but the mapsize increase will be even bigger.
If either a) or b) is implemented this dirty hack will not be needed.

However even in comparison with c) - all previous attempts to increase routing quality seem to be pretty basic and unnoticable.2
Cheers.
Index: resources/styles/default/lines
===================================================================
--- styles/default/lines	(revision 1413)
+++ styles/default/lines	(working copy)
@@ -19,8 +19,28 @@
 highway=trunk {name '${ref|highway-symbol:hbox} ${name}' | '${ref|highway-symbol:hbox}' | '${name}' }
 highway=primary {name '${ref|highway-symbol:box} ${name}' | '${ref|highway-symbol:box}' | '${name}' }
 highway=secondary {name '${ref|highway-symbol:oval} ${name}' | '${ref|highway-symbol:oval}' | '${name}' }
-highway=* {name '${ref} ${name}' | '${ref}' | '${name}' }
+highway=* & highway!=path {name '${ref} ${name}' | '${ref}' | '${name}' }
 
+# Convert generic path to most specific
+highway=path & bicycle=designated {set highway=cycleway }
+highway=path & horse=designated {set highway=bridleway }
+highway=path & foot=designated {set highway=footway }
+
+# Allow for curvy roads and tight turns
+junction=roundabout & highway=trunk [0x0c road_class=3 road_speed=2 resolution 24 continue]
+junction=roundabout & highway=primary [0x0c road_class=3 road_speed=1 resolution 24 continue]
+junction=roundabout & highway=secondary [0x0c road_class=2 road_speed=1 resolution 24 continue]
+junction=roundabout & highway=tertiary [0x0c road_class=1 road_speed=1 resolution 24 continue]
+highway=motorway {add oneway = yes; add bicycle = no; add foot = no } [0x01 road_class=4 road_speed=3 resolution 24 continue]
+highway=motorway_link {add oneway = yes; add bicycle = no; add foot = no } [0x09 road_class=3 road_speed=1 resolution 24 continue]
+highway=trunk  {add bicycle = no; add foot = no} [0x02 road_class=4 road_speed=2 resolution 24 continue]
+highway=trunk_link {add bicycle = no; add foot = no} [0x09 road_class=3 road_speed=1 resolution 24 continue]
+highway=* & motorroad=yes {add bicycle = no; add foot = no} [0x02 road_class=4 road_speed=2 resolution 16 continue]
+highway=primary [0x03 road_class=4 road_speed=2 resolution 24 continue]
+highway=primary_link [0x08 road_class=3 road_speed=1 resolution 24 continue]
+highway=secondary [0x04 road_class=2 road_speed=1 resolution 24 continue]
+
+# Normal road Section
 junction=roundabout & highway=trunk [0x0c road_class=3 road_speed=5 resolution 16]
 junction=roundabout & highway=primary [0x0c road_class=3 road_speed=4 resolution 19]
 junction=roundabout & highway=secondary [0x0c road_class=2 road_speed=3 resolution 20]
@@ -28,34 +48,33 @@
 junction=roundabout & highway=unclassified [0x0c road_class=1 road_speed=2 resolution 21]
 junction=roundabout [0x0c road_class=0 road_speed=1 resolution 21]
 
-# Convert generic path to most specific
-highway=path & bicycle=designated {set highway=cycleway }
-highway=path & horse=designated {set highway=bridleway }
-highway=path & foot=designated {set highway=footway }
+highway=motorway {add oneway = yes; add bicycle = no; add foot = no } [0x01 road_class=4 road_speed=7 resolution 12]
+highway=motorway_link {add oneway = yes; add bicycle = no; add foot = no } [0x09 road_class=3 road_speed=3 resolution 16]
+highway=trunk  {add bicycle = no; add foot = no} [0x02 road_class=4 road_speed=5 resolution 16]
+highway=trunk_link {add bicycle = no; add foot = no} [0x09 road_class=3 road_speed=3 resolution 16]
+highway=* & motorroad=yes {add bicycle = no; add foot = no} [0x02 road_class=4 road_speed=4 resolution 16]
+highway=primary [0x03 road_class=3 road_speed=4 resolution 19]
+highway=primary_link [0x08 road_class=3 road_speed=3 resolution 19]
+highway=secondary [0x04 road_class=2 road_speed=3 resolution 20]
+highway=secondary_link [0x08 road_class=2 road_speed=1 resolution 20]
+highway=tertiary [0x05 road_class=1 road_speed=3 resolution 20]
+highway=tertiary_link [0x08 road_class=1 road_speed=1 resolution 20]
+highway=minor [0x06 road_class=1 road_speed=3 resolution 21]
+highway=unclassified [0x06 road_class=0 road_speed=3 resolution 21]
 
+highway=pedestrian & area!=yes {add access = no; add foot = yes} [0x06 road_class=0 road_speed=0 resolution 22]
+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 {add access = no; add bicycle = yes; add foot = yes} [0x16 road_class=0 road_speed=0 resolution 23]
 highway=byway [0x16 road_class=0 road_speed=0 resolution 23]
+highway=service [0x07 road_class=0 road_speed=2 resolution 22]
 highway=cycleway {add access = no; add bicycle = yes; add foot = yes} [0x16 road_class=0 road_speed=1 resolution 23]
 highway=footway {add access = no; add foot = yes} [0x16 road_class=0 road_speed=0 resolution 23]
-highway=minor [0x06 road_class=1 road_speed=2 resolution 21]
-highway=motorway {add oneway = yes; add bicycle = no; add foot = no } [0x01 road_class=4 road_speed=6 resolution 12]
-highway=motorway_link {add oneway = yes; add bicycle = no; add foot = no } [0x09 road_class=4 road_speed=3 resolution 16]
-highway=pedestrian & area!=yes {add access = no; add foot = yes} [0x06 road_class=0 road_speed=0 resolution 22]
-highway=primary [0x03 road_class=3 road_speed=4 resolution 19]
-highway=primary_link [0x08 road_class=3 road_speed=3 resolution 19]
-highway=residential | highway=living_street [0x06 road_class=0 road_speed=2 resolution 21]
-highway=secondary [0x04 road_class=2 road_speed=3 resolution 20]
-highway=secondary_link [0x08 road_class=2 road_speed=2 resolution 20]
-highway=path {add access = no; add bicycle = yes; add foot = yes} [0x16 road_class=0 road_speed=0 resolution 23]
-highway=service [0x07 road_class=0 road_speed=1 resolution 22]
+highway=path {add access = no; add bicycle = yes; add foot = yes} [0x16 road_class=0 road_speed=1 resolution 23]
 highway=steps {add access = no; add foot = yes} [0x16 road_class=0 road_speed=0 resolution 23]
-highway=tertiary [0x05 road_class=1 road_speed=3 resolution 20]
-highway=tertiary_link [0x08 road_class=1 road_speed=2 resolution 20]
 highway=track [0x0a road_class=0 road_speed=1 resolution 21]
-highway=trunk  [0x02 road_class=3 road_speed=5 resolution 16]
-highway=trunk_link [0x09 road_class=3 road_speed=3 resolution 16]
-highway=unclassified | highway=road [0x06 road_class=1 road_speed=2 resolution 21]
 highway=unsurfaced [0x0a road_class=0 road_speed=1 resolution 21]
+highway=road [0x06 road_class=0 road_speed=1 resolution 21]
 
 # Mop up any unrecognised highway types
 highway=* & area!=yes [0x07 ]
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to