logo separator

[mkgmap-dev] [PATCH v2] Move maxspeed calculations to style file

From Felix Hartmann extremecarver at gmail.com on Fri Aug 30 08:58:33 BST 2013

only downwards, is what everyone expects, but not what mkgmap did so 
far. I critisized this quite often in the past....
Now you can make rules to actually only use maxspeed to decrease the 
road-speed....

The actual importance of maxspeed only downwards was in practice better 
then in theory, as (for the old way of doing luckily) stuff like 
highway=track, or highway=unclassified usually had no maxspeed tag at 
all. So the case of roadspeed=5 or 6 being set for a 
residential/track/unclassified was very rare.


So "what you really want to avoid" is what was hapenning, now you can 
set it yourself...


So the default should rather be:
maxspeed=* &                              maxspeedkmh() > 110 & 
highway=motorway { set mkgmap:road-speed-class = 7 }
maxspeed=* & mkgmap:road-speed-class!=* maxspeedkmh() > 80 & ( 
highway=motorway | highway=trunk ) { set mkgmap:road-speed-class = 6 }
maxspeed=* & mkgmap:road-speed-class!=* maxspeedkmh() > 60 & ( 
highway=motorway | highway=trunk | highway=motorway_link | 
highway=trunk_link | highway=primary ) { set mkgmap:road-speed-class = 5 }
maxspeed=* & mkgmap:road-speed-class!=* maxspeedkmh() > 40 & ( 
highway=motorway | highway=trunk | highway=motorway_link | 
highway=trunk_link | highway=primary | highway=primary_link | 
highway=secondary ) { set mkgmap:road-speed-class = 4 }
... maybe a special rule for maxspeed()>80 and tertiary....
.... and continue including highways lower down...


... Do the same for maxspeedmph()

This way is actually much much better than the old way which was IMHO 
crap because it would also increase road-speed... (and meaning if you 
created a cyclemap, you always needed ignore-maxspeed command else 
primaries would be road-speed=5 very often, and far to high priority...).

On 30.08.2013 09:45, Toby Speight wrote:
> 0> In article <522034FF.6060405 at aighes.de>,
> 0> Henning Scholland <URL:mailto:osm at aighes.de> ("Henning") wrote:
>
> Henning> the patch shouldn't change that much. If you actually
> Henning> use --ignore-maxspeed, then you havn't to change anything. If
> Henning> you actually don't use --ignore-maxspeed, then you'll need to
> Henning> add a rule like
> Henning>  maxspeed=* { set mkgmap:maxspeed = maxspeedkmh() }
>
> No, I don't use --ignore-maxspeed.  But the above looks quite different from
> your roadspeed style, where you set mkgmap:road-speed-class rather than
> mkgmap:maxspeed - is that wrong?
>
> Henning> If mkgmap:maxspeed-tag is found, then mkgmap will override your
> Henning> given road_speed.
>
> But only downwards, right?  I never want maxspeed to increase the
> estimated actual speed.
>
>
> Henning> Maybe you could describe your situation a little bit more
> Henning> detailed.  Then it would be more easy to tell you, what you'll
> Henning> have to change.
>
> My routing rules go something like this extract:
>
> /--------
> | highway=primary & oneway=yes [0x03 road_class=3 road_speed=5 resolution 17]
> | highway=primary [0x03 road_class=3 road_speed=4 resolution 17]
> | highway=primary_link [0x0b road_class=3 road_speed=3 resolution 19]
> | highway=secondary & oneway=yes [0x04 road_class=2 road_speed=4 resolution 18]
> | highway=secondary [0x04 road_class=2 road_speed=3 resolution 18]
> | highway=secondary_link [0x04 road_class=2 road_speed=2 resolution 22]
> | highway=tertiary [0x05 road_class=1 road_speed=3 resolution 20]
> | highway=tertiary_link [0x05 road_class=1 road_speed=1 resolution 20]
> \--------
>
> My region of interest is Scotland; speed limits are mapped over most of
> the west Highlands:
>
> <URL: http://www.itoworld.com/map/5?lon=-4.95077&lat=57.10531 >
>
> I don't want my 60mph-limit secondary roads to have their speeds
> increased to road_speed=6.  But I do want 30mph-limit secondary
> roads to have their speeds reduced to road_speed=3.  So I want you
> to confirm that the new maxspeed code will act only as a limit, not
> a target (as driving instructors love to say).
>
> I really want to avoid routing along minor roads in preference to
> slightly longer roads where the speed limit is the same:
>
> <URL: http://osrm.at/4Rl >
>
> A final thought: some ways have a maxspeed:practical=* tag; if
> maxspeedkmh() didn't hard-code which tag to read, we'd be able to use
> that in our style files, too.
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

-- 
keep on biking and discovering new trails

Felix
openmtbmap.org & www.velomap.org



More information about the mkgmap-dev mailing list