[PATCH v1] modify road speed and class from a POI

This is something that was briefly discussed not too long ago and the idea is that a road's speed or class can be modified by the presence of a POI that defines new values for either/both of them. This, hopefully, will make ways that have stuff like traffic signals and crossings, etc. less attractive to route over. The values are specified using mkgmap:road-speed and mkgmap:road-class tags added to the POI. These tags expect an integer value, optionally preceded by a + or - which make the adjustment relative to the original value. For example, mkgmap:road-speed=3 sets the speed to 3 and mkgmap:road-speed=-1 reduces the speed by 1 from whatever value it had before. Here's some possible rules for the points file: highway=traffic_signals { add mkgmap:road-speed = '-1' } highway=crossing { add mkgmap:road-speed = '-1' } highway=mini_roundabout { add mkgmap:road-speed = '1' } The region of the way that has its speed/class modified is limited to the closest points either side of the POI. Not sure if that's the right thing to do yet. Needs playing with. You need to specify the --link-pois-to-ways option to enable this functionality. All feedback welcome. Mark

Mark Burton wrote:
This is something that was briefly discussed not too long ago and the idea is that a road's speed or class can be modified by the presence of a POI that defines new values for either/both of them. This, hopefully, will make ways that have stuff like traffic signals and crossings, etc. less attractive to route over.
The values are specified using mkgmap:road-speed and mkgmap:road-class tags added to the POI.
These tags expect an integer value, optionally preceded by a + or - which make the adjustment relative to the original value.
For example, mkgmap:road-speed=3 sets the speed to 3 and mkgmap:road-speed=-1 reduces the speed by 1 from whatever value it had before.
Here's some possible rules for the points file:
highway=traffic_signals { add mkgmap:road-speed = '-1' } highway=crossing { add mkgmap:road-speed = '-1' } highway=mini_roundabout { add mkgmap:road-speed = '1' }
Wow that sounds really great! Will try it out tomorrow. Especially increasing it based on points sounds great is road-speed a typo? Should it be road_speed? Is it really the POI that introduces this change on the unit, or is mkgmap changing it based on the compile process? I would never have thought that Garmin takes POIs into account when routing (will also have to see whether this works on all units in case it is not mkgmap). This will really help to make city streets less attractive and pathes and footways that are outdoor more attractive (fewer traffic_signals, crossings, etc...).
The region of the way that has its speed/class modified is limited to the closest points either side of the POI. Not sure if that's the right thing to do yet. Needs playing with.
You need to specify the --link-pois-to-ways option to enable this functionality.
The link-pois-to-ways adds no access restrictions if not specifically given in the style-file, does it? Thanks for the last two mails, both really good things to get better routing!
All feedback welcome.
Mark
------------------------------------------------------------------------
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

@Mark: Thank you for adding this, it gives us loads of new possibilities to tweat routing behaviour! :-) I'll try it as soon as I can! 2009/10/14 Felix Hartmann <extremecarver@googlemail.com>:
The link-pois-to-ways adds no access restrictions if not specifically given in the style-file, does it?
If the given POI has its own access-restrictions, these will be taken. POIs without access restrictions will get those specified in the style file, afaik. -Martin

Hi Felix,
Mark Burton wrote:
This is something that was briefly discussed not too long ago and the idea is that a road's speed or class can be modified by the presence of a POI that defines new values for either/both of them. This, hopefully, will make ways that have stuff like traffic signals and crossings, etc. less attractive to route over.
The values are specified using mkgmap:road-speed and mkgmap:road-class tags added to the POI.
These tags expect an integer value, optionally preceded by a + or - which make the adjustment relative to the original value.
For example, mkgmap:road-speed=3 sets the speed to 3 and mkgmap:road-speed=-1 reduces the speed by 1 from whatever value it had before.
Here's some possible rules for the points file:
highway=traffic_signals { add mkgmap:road-speed = '-1' } highway=crossing { add mkgmap:road-speed = '-1' } highway=mini_roundabout { add mkgmap:road-speed = '1' }
Wow that sounds really great! Will try it out tomorrow. Especially increasing it based on points sounds great
is road-speed a typo? Should it be road_speed?
No, it's not a typo.
Is it really the POI that introduces this change on the unit, or is mkgmap changing it based on the compile process?
It's mkgmap, taking the info in the POI and applying it to a region of the way around the POI.
I would never have thought that Garmin takes POIs into account when routing (will also have to see whether this works on all units in case it is not mkgmap).
I believe the same as you that the GPS ignores POIs as far as routing is concerned.
This will really help to make city streets less attractive and pathes and footways that are outdoor more attractive (fewer traffic_signals, crossings, etc...).
The region of the way that has its speed/class modified is limited to the closest points either side of the POI. Not sure if that's the right thing to do yet. Needs playing with.
You need to specify the --link-pois-to-ways option to enable this functionality.
The link-pois-to-ways adds no access restrictions if not specifically given in the style-file, does it?
That option adds nothing itself, all of the info it works on has to be added by the style file (or be in the original OSM data). So if a POI has an access restriction, that could be transferred to the way (which is what we want in the case of barrier POIs.
Thanks for the last two mails, both really good things to get better routing!
That's the motto of the month - improve routing! Cheers, Mark

Mark Burton wrote:
This is something that was briefly discussed not too long ago and the idea is that a road's speed or class can be modified by the presence of a POI that defines new values for either/both of them. This, hopefully, will make ways that have stuff like traffic signals and crossings, etc. less attractive to route over.
The values are specified using mkgmap:road-speed and mkgmap:road-class tags added to the POI.
These tags expect an integer value, optionally preceded by a + or - which make the adjustment relative to the original value.
For example, mkgmap:road-speed=3 sets the speed to 3 and mkgmap:road-speed=-1 reduces the speed by 1 from whatever value it had before.
Here's some possible rules for the points file:
highway=traffic_signals { add mkgmap:road-speed = '-1' } highway=crossing { add mkgmap:road-speed = '-1' } highway=mini_roundabout { add mkgmap:road-speed = '1' }
Seems to work quite well. This way you can slightly increase the priority of secondary/tertiary streets on the countryside while avoiding them inside big cities (only if they are very well mapped). I do suppose other people will find other uses for this patch.
Only problem that I did not manage to apply it to the mdr branch (neither the tweeze-arc patch). It would be great if one could define minimum settings as mentioned elsewhere, because if road_speed decreases from 1 to 0 the change is really drastic. Great would be to be able to do things like the following { if road_speed >1 add mkgmap:road_speed = '-1'; if road_speed=1 add mkgmap:road_class = '-1' }. P.S. all the branches and patches outside of the trunk really make it difficult for me applying patches without breaking stuff. IMHO the mdr branch should be committed to trunk soon (because it is an essential feature and does not break anything), and also the "continue" patch should be merged to trunk, because many people are using it and it is very prone to break ....

On 10/14/2009 01:14 AM, Mark Burton wrote:
These tags expect an integer value, optionally preceded by a + or - which make the adjustment relative to the original value.
This is a good idea. But I think it would be better to allow for non-integer values of adjustment. E.g. if I have a long street through a city with 10 traffic lights I don't want it to end up with a road_speed of -8. This might route me through small narrow side streets. A correction value of "-0.1" for every traffic light might be better. The value can be rounded to the nearest integer after all corrections are applied. Another suggestion: Add the possibility to mark a road with a minimum and maximum road_speed it can ever get when being corrected in the above way. E.g.: highway=primary [road_speed=4 min_road_speed=2 max_road_speed=5]

On Wed, 14 Oct 2009 08:45:52 +0200 Ralf Kleineisel <ralf@kleineisel.de> wrote:
On 10/14/2009 01:14 AM, Mark Burton wrote:
These tags expect an integer value, optionally preceded by a + or - which make the adjustment relative to the original value.
This is a good idea.
But I think it would be better to allow for non-integer values of adjustment. E.g. if I have a long street through a city with 10 traffic lights I don't want it to end up with a road_speed of -8. This might route me through small narrow side streets. A correction value of "-0.1" for every traffic light might be better. The value can be rounded to the nearest integer after all corrections are applied.
Yes, avoiding multiple adjustments is required, well spotted. I will add that in. I am not keen on the decimal adjustment. Remember, the region that has the change applied to it is limited in length so if you had multiple lights/crossings along a particular road, it would be segmented into regions that alternated normal/slow/normal/slow..
Another suggestion: Add the possibility to mark a road with a minimum and maximum road_speed it can ever get when being corrected in the above way. E.g.:
highway=primary [road_speed=4 min_road_speed=2 max_road_speed=5]
It's getting complicated, let's see how we get on with what we have (+ the extra needed to avoid multiple changes as discussed above). Cheers, Mark

Just realised, as the patch is now, it will only apply one delta to the way's speed/class. If a way has multiple POIs that can change the speed/class, only the last one processed (the order is, essentially, random) will have an effect. Cheers, Mark

Mark Burton schrieb:
This is something that was briefly discussed not too long ago and the idea is that a road's speed or class can be modified by the presence of a POI that defines new values for either/both of them. This, hopefully, will make ways that have stuff like traffic signals and crossings, etc. less attractive to route over.
The values are specified using mkgmap:road-speed and mkgmap:road-class tags added to the POI.
Sounds great. Does it work with and without the --ignore-maxspeeds option? By the why: Is the --ignore-maxspeeds option documented somewhere? All I understand is that it turns off the default mkgmap handling of maxspeed tags, so that only the roadclass and speed from the style file are respected. Chris

Hi Chris,
Does it work with and without the --ignore-maxspeeds option?
It occurs after the maxspeed processing.
By the why: Is the --ignore-maxspeeds option documented somewhere? All I understand is that it turns off the default mkgmap handling of maxspeed tags, so that only the roadclass and speed from the style file are respected.
Personally, I use --ignore-maxspeeds because, otherwise, the maxspeed tags completely wrecks my car routing because those speeds are often more than the speeds specified in the style file. Cheers, Mark
participants (5)
-
Chris-Hein Lunkhusen
-
Felix Hartmann
-
Mark Burton
-
Martin Simon
-
Ralf Kleineisel