
Hi, I try to understand the implementation of the code that creates the road net work. In 2009 Mark Burton implemented a feature using tags like mkgmap:road-speed in the points file. See http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2009q4/004777.html Before that Mark also added a feature to handle points with an access tags like "access", "barrier", or "highway". I think the code for these features is not correct, it sometimes splits roads into short arcs. Questions: 1) If a road with road_speed=4 has e.g. 10 points (= OSM nodes) , and the 3rd point has tag mkgmap:road-speed=-1 and the 8th point has tag mkgmap:road-speed=+1, what is the expected result? I would assume that the road is split into 3 parts, one containining points 1-3, one the points 3-8, and the last one the points 8-10. The 1st part would use the unchanged road_speed value 4, the 2nd part the the value 3 and the last part the value 5. (if this doesn't introduce any short arcs, else splitting makes no sense for these tags) Correct? 2) If a road with 10 points and access=foot has a 3rd point with barrier=bollard, should this cause a split of the road so that points 3-10 have access=bicycle? I think no. 3) If a road with 10 points and access=bicycle has a 3rd point with barrier=cycle_barrier, should this cause a split of the road (which just seems to increase the img size) ? I think no. Gerd -- View this message in context: http://gis.19327.n5.nabble.com/Questions-regarding-routing-tp5764520.html Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi Gerd,
Hi,
I try to understand the implementation of the code that creates the road net work. In 2009 Mark Burton implemented a feature using tags like mkgmap:road-speed in the points file. See http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2009q4/004777.html
Before that Mark also added a feature to handle points with an access tags like "access", "barrier", or "highway".
I think the code for these features is not correct, it sometimes splits roads into short arcs.
What the hell are short arcs? Everybodys talking about but I haven't understood so far... :-)
Questions: 1) If a road with road_speed=4 has e.g. 10 points (= OSM nodes) , and the 3rd point has tag mkgmap:road-speed=-1 and the 8th point has tag mkgmap:road-speed=+1, what is the expected result? I would assume that the road is split into 3 parts, one containining points 1-3, one the points 3-8, and the last one the points 8-10. The 1st part would use the unchanged road_speed value 4, the 2nd part the the value 3 and the last part the value 5. (if this doesn't introduce any short arcs, else splitting makes no sense for these tags) Correct?
Having a look at the code I would expect part uses points 1-4, part two uses points 4-9 and part 3 9-10. The code splits at i+1: Way tail = splitWayAt(way, i + 1); What do I expect? Hhhm, not easy to say. The current splitting does not make much sense to me. Having a mkgmap:road-speed=-1 at point 3 of 10 lowers the speed until the 4th point. Reversing the way lowers the speed of the last 7 point (4-10). So the effect of mkgmap:road-speed on a point is quite random. So I would expect that mkgmap:road-speed=1 cuts out point 2-4 with lowered speed or it cuts out +-20m to have a cleary defined effect.
2) If a road with 10 points and access=foot has a 3rd point with barrier=bollard, should this cause a split of the road so that points 3-10 have access=bicycle? I think no.
Me too. See my comment to 1. I expect that a small area (+-1 point or +- x meter) around barrier=bollard uses access=bicycle.
3) If a road with 10 points and access=bicycle has a 3rd point with barrier=cycle_barrier, should this cause a split of the road (which just seems to increase the img size) ? I think no
This leads to the question: is barrier=cycle_barrier passable for cyclists? The wiki does not state this clearly. I guess the barrier handling should be updated because its implementation is quite old and the tagging maybe has changed or diversified since then. WanMil

WanMil wrote
What the hell are short arcs? Everybodys talking about but I haven't understood so far... :-)
I think an arc is created for each part of a road that is connected to other roads, the connections are CoordNodes. Search for arcLength in RoadNetWork.java. In some comments, a short arc is one with length 0 m, in other places we say a short arc is shorter than the value passed with the --remove-short-arc option. I think the latter is better. Roads with short arcs sometimes lead to routing problems. Gerd -- View this message in context: http://gis.19327.n5.nabble.com/Questions-regarding-routing-tp5764520p5764537... Sent from the Mkgmap Development mailing list archive at Nabble.com.

El 07/06/13 21:45, GerdP escribió:
Questions: 1) If a road with road_speed=4 has e.g. 10 points (= OSM nodes) , and the 3rd point has tag mkgmap:road-speed=-1 and the 8th point has tag mkgmap:road-speed=+1, what is the expected result? I would assume that the road is split into 3 parts, one containining points 1-3, one the points 3-8, and the last one the points 8-10. The 1st part would use the unchanged road_speed value 4, the 2nd part the the value 3 and the last part the value 5. (if this doesn't introduce any short arcs, else splitting makes no sense for these tags) Correct?
If I recall correctly, if a node is tagged with mkgmap:road-speed it affects the portion of the way from the node before to the tagged one to the node after it, so the above example will result in section 1-2: road-speed=4, section 2-4 r-s=3, section 4-7 r-s=4, section 7-9 r-s=5 and section 9-10 r-s=4

Hi Carlos, Carlos Dávila-2 wrote
El 07/06/13 21:45, GerdP escribió:
Questions: 1) If a road with road_speed=4 has e.g. 10 points (= OSM nodes) , and the 3rd point has tag mkgmap:road-speed=-1 and the 8th point has tag mkgmap:road-speed=+1, what is the expected result? I would assume that the road is split into 3 parts, one containining points 1-3, one the points 3-8, and the last one the points 8-10. The 1st part would use the unchanged road_speed value 4, the 2nd part the the value 3 and the last part the value 5. (if this doesn't introduce any short arcs, else splitting makes no sense for these tags) Correct?
If I recall correctly, if a node is tagged with mkgmap:road-speed it affects the portion of the way from the node before to the tagged one to the node after it, so the above example will result in section 1-2: road-speed=4, section 2-4 r-s=3, section 4-7 r-s=4, section 7-9 r-s=5 and section 9-10 r-s=4
yes, I think that is what happens. I just don't understand why it is coded like that. The default style doesn't use this feature, so I don't know how it is used. My thought was that a OSM node has some kind of speed limit tag and that is translated into a mkgmap:road-speed tag. If that is correct, I would assume that the speed limit is true as long as no new node with another one is found. Of course this assumes that all different speed limit signs are points with the corresponding tags. Gerd Gerd -- View this message in context: http://gis.19327.n5.nabble.com/Questions-regarding-routing-tp5764520p5764532... Sent from the Mkgmap Development mailing list archive at Nabble.com.

El 07/06/13 22:59, GerdP escribió:
Hi Carlos,
Carlos Dávila-2 wrote
El 07/06/13 21:45, GerdP escribió:
Questions: 1) If a road with road_speed=4 has e.g. 10 points (= OSM nodes) , and the 3rd point has tag mkgmap:road-speed=-1 and the 8th point has tag mkgmap:road-speed=+1, what is the expected result? I would assume that the road is split into 3 parts, one containining points 1-3, one the points 3-8, and the last one the points 8-10. The 1st part would use the unchanged road_speed value 4, the 2nd part the the value 3 and the last part the value 5. (if this doesn't introduce any short arcs, else splitting makes no sense for these tags) Correct? If I recall correctly, if a node is tagged with mkgmap:road-speed it affects the portion of the way from the node before to the tagged one to the node after it, so the above example will result in section 1-2: road-speed=4, section 2-4 r-s=3, section 4-7 r-s=4, section 7-9 r-s=5 and section 9-10 r-s=4 yes, I think that is what happens. I just don't understand why it is coded like that. The default style doesn't use this feature, so I don't know how it is used. My thought was that a OSM node has some kind of speed limit tag and that is translated into a mkgmap:road-speed tag. If that is correct, I would assume that the speed limit is true as long as no new node with another one is found. Of course this assumes that all different speed limit signs are points with the corresponding tags. mkgmap:road-speed is not used for speed tags in the OSM data but for elements (nodes) that may affect the surrounding section of a way. For example, if a residential way has a node tagged traffic_calming=* you may drive at say 50 km/h most of the way, but you'll have to slow down at that point. It can be implemented in the points style file as: traffic_calming=table { add mkgmap:road-speed = '-2'; add mkgmap:road-speed-min = '1' } traffic_calming=* { add mkgmap:road-speed = '-1'; add mkgmap:road-speed-min = '1' }

Hi Carlos, thanks for the explanation and the example, I think I understand the idea now. Gerd Carlos Dávila-2 wrote
El 07/06/13 22:59, GerdP escribió:
Hi Carlos,
Carlos Dávila-2 wrote
El 07/06/13 21:45, GerdP escribió:
Questions: 1) If a road with road_speed=4 has e.g. 10 points (= OSM nodes) , and the 3rd point has tag mkgmap:road-speed=-1 and the 8th point has tag mkgmap:road-speed=+1, what is the expected result? I would assume that the road is split into 3 parts, one containining points 1-3, one the points 3-8, and the last one the points 8-10. The 1st part would use the unchanged road_speed value 4, the 2nd part the the value 3 and the last part the value 5. (if this doesn't introduce any short arcs, else splitting makes no sense for these tags) Correct? If I recall correctly, if a node is tagged with mkgmap:road-speed it affects the portion of the way from the node before to the tagged one to the node after it, so the above example will result in section 1-2: road-speed=4, section 2-4 r-s=3, section 4-7 r-s=4, section 7-9 r-s=5 and section 9-10 r-s=4 yes, I think that is what happens. I just don't understand why it is coded like that. The default style doesn't use this feature, so I don't know how it is used. My thought was that a OSM node has some kind of speed limit tag and that is translated into a mkgmap:road-speed tag. If that is correct, I would assume that the speed limit is true as long as no new node with another one is found. Of course this assumes that all different speed limit signs are points with the corresponding tags. mkgmap:road-speed is not used for speed tags in the OSM data but for elements (nodes) that may affect the surrounding section of a way. For example, if a residential way has a node tagged traffic_calming=* you may drive at say 50 km/h most of the way, but you'll have to slow down at that point. It can be implemented in the points style file as: traffic_calming=table { add mkgmap:road-speed = '-2'; add mkgmap:road-speed-min = '1' } traffic_calming=* { add mkgmap:road-speed = '-1'; add mkgmap:road-speed-min = '1' }
mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/Questions-regarding-routing-tp5764520p5764556... Sent from the Mkgmap Development mailing list archive at Nabble.com.

The idea behind it was that one could priotize or depriotize roads close to Point X. However it is seriously flawed in so far, that mkgmap:road-min-speed / max-speed doesn't work. If you tag road-min-speed=1, the road previously was road-speed=0 and the command is road-speed=-1, it will actually increase the speed to the min-speed. However the intention is only that road-speed>0 are not decreased to 0 if that command is given. It should never increase... Else the problem is, that the distance it works, is very short anyhow, now that roads are split up into very short distances everywhere. To improve routing, a much better approach would be to check the finished routing graph for heavy road-class changes on intersections. Garmin doesn't like to route from a road-class=4 onto a 0-1. Only 2 or 3 are liked. The max difference should be 2. However that will be difficult to achieve. Also high angles on intersections could have an automatic road-speed decrease by 1 or 2 (depending on the current state) - or even more smoothing out - that is still something going crazy. A turn of 160° is like minimum 1 minute time penalty... On 07.06.2013 22:59, GerdP wrote:
Hi Carlos,
Carlos Dávila-2 wrote
El 07/06/13 21:45, GerdP escribió:
Questions: 1) If a road with road_speed=4 has e.g. 10 points (= OSM nodes) , and the 3rd point has tag mkgmap:road-speed=-1 and the 8th point has tag mkgmap:road-speed=+1, what is the expected result? I would assume that the road is split into 3 parts, one containining points 1-3, one the points 3-8, and the last one the points 8-10. The 1st part would use the unchanged road_speed value 4, the 2nd part the the value 3 and the last part the value 5. (if this doesn't introduce any short arcs, else splitting makes no sense for these tags) Correct? If I recall correctly, if a node is tagged with mkgmap:road-speed it affects the portion of the way from the node before to the tagged one to the node after it, so the above example will result in section 1-2: road-speed=4, section 2-4 r-s=3, section 4-7 r-s=4, section 7-9 r-s=5 and section 9-10 r-s=4 yes, I think that is what happens. I just don't understand why it is coded like that. The default style doesn't use this feature, so I don't know how it is used. My thought was that a OSM node has some kind of speed limit tag and that is translated into a mkgmap:road-speed tag. If that is correct, I would assume that the speed limit is true as long as no new node with another one is found. Of course this assumes that all different speed limit signs are points with the corresponding tags.
Gerd Gerd
-- View this message in context: http://gis.19327.n5.nabble.com/Questions-regarding-routing-tp5764520p5764532... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@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

Hi Felix,
The idea behind it was that one could priotize or depriotize roads close to Point X.
okay, understood.
However it is seriously flawed in so far, that mkgmap:road-min-speed / max-speed doesn't work.
I see no code that handles strings like mkgmap:road-min-speed or mkgmap:road-max-speed. I guess you mean mkgmap:road-speed-min ?
If you tag road-min-speed=1, the road previously was road-speed=0 and the command is road-speed=-1, it will actually increase the speed to the min-speed. However the intention is only that road-speed>0 are not decreased to 0 if that command is given. It should never increase...
I don't fully agree. The default value for mkgmap:road-speed-min is 0, and my understanding of the current code in r2643 is that the final road speed value will never by negative as long as you don't set mkgmap:road-speed-max or mkgmap:road-speed-max to a negative value (which is not quite logical,but probably ok) So if one sets a mkgmap:road-speed-min value of 1, what else could that mean ?
Else the problem is, that the distance it works, is very short anyhow, now that roads are split up into very short distances everywhere.
what is very short? I plan to change the code so that it doesn't produce short arcs (using the --remove-short-arcs value ). Do you think the value should be higher?
To improve routing, a much better approach would be to check the finished routing graph for heavy road-class changes on intersections. Garmin doesn't like to route from a road-class=4 onto a 0-1. Only 2 or 3 are liked. The max difference should be 2. However that will be difficult to achieve. Also high angles on intersections could have an automatic road-speed decrease by 1 or 2 (depending on the current state) - or even more smoothing out - that is still something going crazy. A turn of 160° is like minimum 1 minute time penalty...
Well, it should be easy to implement warnings, but I don't see how mkgmap could change the values. Gerd

Hi Felix, Felix Hartmann-2 wrote
To improve routing, a much better approach would be to check the finished routing graph for heavy road-class changes on intersections. Garmin doesn't like to route from a road-class=4 onto a 0-1. Only 2 or 3 are liked. The max difference should be 2. However that will be difficult to achieve.
I tried to implement such a test, but I fear the result is not very useful. My idea: List all routing nodes where exactly two road segments meet AND the two segments have a large difference in the road-class AND both road segments have further connections on the other end. With the default style, the produced list is not very long, and those nodes that I checked are probable not causing trouble. Anyway, attached is the patch (prints to stdout), maybe it helps you: print_road-class-changes_v1.patch <http://gis.19327.n5.nabble.com/file/n5766294/print_road-class-changes_v1.patch> I think what you want is a list of those routing nodes that are probably avoided although a route through them would be much shorter/faster, but I have no idea how to find those in a reasonable time. Gerd -- View this message in context: http://gis.19327.n5.nabble.com/Questions-regarding-routing-tp5764520p5766294... Sent from the Mkgmap Development mailing list archive at Nabble.com.
participants (5)
-
Carlos Dávila
-
Felix Hartmann
-
Gerd Petermann
-
GerdP
-
WanMil