
Hi all, I've just modified a routine that translates the vehicle types used in OSM to the ones used in Garmin restrictions: if(vehicle.equals("motorcar") || vehicle.equals("motorcycle") || vehicle.equals("motor_vehicle")) flag = RouteRestriction.EXCEPT_CAR; else if(vehicle.equals("psv") || vehicle.equals("bus")) flag = RouteRestriction.EXCEPT_BUS; else if(vehicle.equals("taxi")) flag = RouteRestriction.EXCEPT_TAXI; else if(vehicle.equals("delivery") || vehicle.equals("goods")) flag = RouteRestriction.EXCEPT_DELIVERY; else if(vehicle.equals("bicycle")) flag = RouteRestriction.EXCEPT_BICYCLE; else if(vehicle.equals("hgv") || vehicle.equals("truck")) flag = RouteRestriction.EXCEPT_TRUCK; if (flag == 0){ log.warn(messagePrefix, "ignoring unsupported vehicle class '" + vehicle + "' in turn restriction"); return false; } else { ...} I think that this should better be done in the style? I also wonder why the wiki lists different kinds of vehicles for restriction:<vehicle>=<turn> , type=restriction:<vehicle> , and except=* I hope it is okay to use the same code for all of them? Gerd -- View this message in context: http://gis.19327.n5.nabble.com/vehicles-in-restriction-relations-tp5801618.h... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi Gerd, do you have an idea how to set that in the style? I think "goods" should not be mapped to delivery. This might also be changed in the default style access rules. The wiki tells about goods: light commercial vehicles; e.g., goods vehicles with a maximum allowed mass of up to 3.5 tonnes So it should better be mapped to truck? WanMil
Hi all,
I've just modified a routine that translates the vehicle types used in OSM to the ones used in Garmin restrictions: if(vehicle.equals("motorcar") || vehicle.equals("motorcycle") || vehicle.equals("motor_vehicle")) flag = RouteRestriction.EXCEPT_CAR; else if(vehicle.equals("psv") || vehicle.equals("bus")) flag = RouteRestriction.EXCEPT_BUS; else if(vehicle.equals("taxi")) flag = RouteRestriction.EXCEPT_TAXI; else if(vehicle.equals("delivery") || vehicle.equals("goods")) flag = RouteRestriction.EXCEPT_DELIVERY; else if(vehicle.equals("bicycle")) flag = RouteRestriction.EXCEPT_BICYCLE; else if(vehicle.equals("hgv") || vehicle.equals("truck")) flag = RouteRestriction.EXCEPT_TRUCK; if (flag == 0){ log.warn(messagePrefix, "ignoring unsupported vehicle class '" + vehicle + "' in turn restriction"); return false; } else { ...}
I think that this should better be done in the style?
I also wonder why the wiki lists different kinds of vehicles for restriction:<vehicle>=<turn> , type=restriction:<vehicle> , and except=* I hope it is okay to use the same code for all of them?
Gerd
-- View this message in context: http://gis.19327.n5.nabble.com/vehicles-in-restriction-relations-tp5801618.h... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi WanMil,
do you have an idea how to set that in the style? I have no idea about syntax, I just think it should not be hard coded. Maybe a new kind of configuration file ? The content would be something like # translation table for restriction vehicles # vehicle used in OSM tags -> access in mkgmap motorcar->mkgmap:car motorcycle->mkgmap:car bicycle->mkgmap:bicycle ...
we have a similar table in inc\access mkgmap would use this table and ignore vehicles which are not translated.
I think "goods" should not be mapped to delivery. This might also be changed in the default style access rules. The wiki tells about goods: light commercial vehicles; e.g., goods vehicles with a maximum allowed mass of up to 3.5 tonnes So it should better be mapped to truck?
That's exactly the reason why I think it should not be hard coded. Gerd

Hi Gerd, I think it should not be hardcoded but handled in the style files, because mapmakers like me are "misusing" mkgmap:car for other purposes (I use car for racing bike routing in my bike maps). If mkgmap hardcode the access for car to no, I can't change this anymore in my style.

Hi Minko, how does trunk work for you in that case? I see no option ignore_turn_restrictions in your osm_bnl.args. Gerd ligfietser wrote
Hi Gerd, I think it should not be hardcoded but handled in the style files, because mapmakers like me are "misusing" mkgmap:car for other purposes (I use car for racing bike routing in my bike maps). If mkgmap hardcode the access for car to no, I can't change this anymore in my style. _______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/vehicles-in-restriction-relations-tp5801618p5... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Good question Gerd, I never realized that actually ;-) Route restrictions for cycling are hardly tagged I suppose, and if they apply for cars they are on places where you don't cycle anyway. I have tested this one: https://www.openstreetmap.org/relation/3478910 But this one isnt working, even cars are going through but they are not allowed to enter Ekris from the N226. type=restriction restriction:motorcar=no_entry Is this type of restriction in the trunk?
Hi Minko,
how does trunk work for you in that case? I see no option ignore_turn_restrictions in your osm_bnl.args.
Gerd

On Sun, Mar 30, Minko wrote:
Good question Gerd, I never realized that actually ;-) Route restrictions for cycling are hardly tagged I suppose, and if they apply for cars they are on places where you don't cycle anyway.
I have tested this one: https://www.openstreetmap.org/relation/3478910 But this one isnt working, even cars are going through but they are not allowed to enter Ekris from the N226.
type=restriction restriction:motorcar=no_entry
Is this type of restriction in the trunk?
no_entry restrictions are not supported in trunk, you should get a warning for this. Thorsten -- Thorsten Kukuk, Senior Architect SLES & Common Code Base SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)

Hi Minko, trunk supports only restrictions with via nodes (not via ways) and type=restriction and (restriction=no_* | restriction=only_*). The except tag is evaluated. Gerd
Date: Sun, 30 Mar 2014 22:16:42 +0200 From: ligfietser@online.nl To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] vehicles in restriction relations
Good question Gerd, I never realized that actually ;-) Route restrictions for cycling are hardly tagged I suppose, and if they apply for cars they are on places where you don't cycle anyway.
I have tested this one: https://www.openstreetmap.org/relation/3478910 But this one isnt working, even cars are going through but they are not allowed to enter Ekris from the N226.
type=restriction restriction:motorcar=no_entry
Is this type of restriction in the trunk?
Hi Minko,
how does trunk work for you in that case? I see no option ignore_turn_restrictions in your osm_bnl.args.
Gerd
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd I'm not very familiar with turn restrictions but this relation has a via node, not a via way https://www.openstreetmap.org/node/2644156384 Is no_entry not supported?
trunk supports only restrictions with via nodes (not via ways) and type=restriction and (restriction=no_* | restriction=only_*). The except tag is evaluated.
Gerd

Hi Minko, sorry, Thorsten already said that no_entry is not supported (and it doesn't appear in the wiki) See also http://wiki.openstreetmap.org/wiki/Relation:restriction Gerd
Date: Mon, 31 Mar 2014 09:18:15 +0200 From: ligfietser@online.nl To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] vehicles in restriction relations
Hi Gerd I'm not very familiar with turn restrictions but this relation has a via node, not a via way https://www.openstreetmap.org/node/2644156384 Is no_entry not supported?
trunk supports only restrictions with via nodes (not via ways) and type=restriction and (restriction=no_* | restriction=only_*). The except tag is evaluated.
Gerd
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Gerd, It is mentioned in the wiki, see table under road signs, #8 Used for not one-way roads, where entering across some point (member node with role via) is prohibited. Relation can have several from members[2] and one to member. We have used this relation because it is not a oneway street so oneway does not apply. You are only not allowed to drive in this street from this side. In the NL's there are a lot of situations like this, mainly residential streets with a no car traffic sign only on one entry side of the street. On a lot of maps and osm it is falsely mapped as one way (+ cycleway=opposite). But on the other hand I understand this will ever be mapped with turn restrictions, that is way too complicated. A workaround is to map only a small beginning as oneway:motorcar=yes or -1 depending on the street direction.
sorry, Thorsten already said that no_entry is not supported (and it doesn't appear in the wiki) See also http://wiki.openstreetmap.org/wiki/Relation:restriction
Gerd

Hi Minko, thanks for the hint, I will add this in the branch. Up to now I only looked at the tags table at the top of the wiki page. The trunk doesn't like multiple from or to members. Gerd
Date: Mon, 31 Mar 2014 09:54:59 +0200 From: ligfietser@online.nl To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] vehicles in restriction relations
Gerd, It is mentioned in the wiki, see table under road signs, #8 Used for not one-way roads, where entering across some point (member node with role via) is prohibited. Relation can have several from members[2] and one to member.
We have used this relation because it is not a oneway street so oneway does not apply. You are only not allowed to drive in this street from this side. In the NL's there are a lot of situations like this, mainly residential streets with a no car traffic sign only on one entry side of the street. On a lot of maps and osm it is falsely mapped as one way (+ cycleway=opposite). But on the other hand I understand this will ever be mapped with turn restrictions, that is way too complicated. A workaround is to map only a small beginning as oneway:motorcar=yes or -1 depending on the street direction.
sorry, Thorsten already said that no_entry is not supported (and it doesn't appear in the wiki) See also http://wiki.openstreetmap.org/wiki/Relation:restriction
Gerd
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Minko, Hi Gerd, Selon Minko <ligfietser@online.nl>:
Good question Gerd, I never realized that actually ;-) Route restrictions for cycling are hardly tagged I suppose, and if they apply for cars they are on places where you don't cycle anyway.
You're reminding me of a question I've got for mkgmap developers. I'd like to know if the right turn on red (https://en.wikipedia.org/wiki/Right_turn_on_red) is taken into account by Garmin in their map format and routing algorithm. I guess yes because Garmin is US-based, where this kind of traffic light is widespread and that it allows for faster right turns. Has anyone ever succeeded in reverse-engineering it in the map file format ? It'd be great because we recently got a new sign in France allowing cyclists to turn right on red after yielding to crossing pedestrians. (https://en.wikipedia.org/wiki/File:Turn_right_on_red.JPG). In OSM, it's tagged with : type=restriction restriction:bicycle=give_way Thanks, Paco

Hi Paco,
You're reminding me of a question I've got for mkgmap developers.
I'd like to know if the right turn on red (https://en.wikipedia.org/wiki/Right_turn_on_red) is taken into account by Garmin in their map format and routing algorithm. I guess yes because Garmin is US-based, where this kind of traffic light is widespread and that it allows for faster right turns.
Has anyone ever succeeded in reverse-engineering it in the map file format ? AFAIK the img format doesn't contain any kind of traffic light. I think this is not needed, as it only influences the avg. speed.
BTW: In Germany we have a green arrow which allows right turn after stopping and giving way. It is often misunderstood to be something like a "ignore red light" sign. Gerd

Hi Gerd, Selon Gerd Petermann <gpetermann_muenchen@hotmail.com>:
AFAIK the img format doesn't contain any kind of traffic light. Too bad. It's a pity because traffic lights can have a big impact on the total average speed. When you've got a traffic light every 150 m on average (i.e. inner Paris), it's worth taking a detour to avoid them. Longer but quicker.
I think this is not needed, as it only influences the avg. speed.
Well, if it influences the moving speed, it's meaningful when routing with "fastest route" setting, isn't it ? On average, a right turn would take a fraction of time compared to a straight or left turn.
BTW: In Germany we have a green arrow which allows right turn after stopping and giving way.
Same here.
It is often misunderstood to be something like a "ignore red light" sign.
Gerd

Hi Paco, I see no problem here. It is up to you to set the speed class of a road, or you can use the link-pois-to-ways option to lower the speed at every traffic light or other traffic signs which have an influence on the avg. speed. I don't know if the Garmin algo calculates extra time for each crossing or left turn (or right turn in drive-on-left countries). Gerd paco.tyson wrote
Hi Gerd,
Selon Gerd Petermann <
gpetermann_muenchen@
>:
AFAIK the img format doesn't contain any kind of traffic light. Too bad. It's a pity because traffic lights can have a big impact on the total average speed. When you've got a traffic light every 150 m on average (i.e. inner Paris), it's worth taking a detour to avoid them. Longer but quicker.
I think this is not needed, as it only influences the avg. speed.
Well, if it influences the moving speed, it's meaningful when routing with "fastest route" setting, isn't it ? On average, a right turn would take a fraction of time compared to a straight or left turn.
BTW: In Germany we have a green arrow which allows right turn after stopping and giving way.
Same here.
It is often misunderstood to be something like a "ignore red light" sign.
Gerd
_______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/vehicles-in-restriction-relations-tp5801618p5... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Selon GerdP <gpetermann_muenchen@hotmail.com>:
Hi Paco,
I see no problem here. It is up to you to set the speed class of a road, or you can use the link-pois-to-ways option to lower the speed at every traffic light or other traffic signs which have an influence on the avg. speed.
Nice idea, that's seems a good workaround. If I understand correctly, you suggest lowering the speed on a node only ? Is this possible with mkgmap/garmin format ? Or should we cut the road right before and after the node so the smaller speed applies to a way ? Cheers, Paco

Hi Paco, I didn't try it, but it should be enough to use --link-pois-to-ways and add a line like this to the points file: highway=traffic_signals {set mkgmap:road-speed=-1 } (note the negative value) For details, please search for mkgmap:road-speed in the style manual and read the description of the link-pois-to-ways option http://www.mkgmap.org.uk/doc/pdf/style-manual.pdf http://www.mkgmap.org.uk/doc/options Ciao, Gerd
Date: Tue, 1 Apr 2014 22:25:46 +0200 From: paco.tyson@free.fr To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] vehicles in restriction relations
Selon GerdP <gpetermann_muenchen@hotmail.com>:
Hi Paco,
I see no problem here. It is up to you to set the speed class of a road, or you can use the link-pois-to-ways option to lower the speed at every traffic light or other traffic signs which have an influence on the avg. speed.
Nice idea, that's seems a good workaround. If I understand correctly, you suggest lowering the speed on a node only ? Is this possible with mkgmap/garmin format ? Or should we cut the road right before and after the node so the smaller speed applies to a way ?
Cheers, Paco _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi all, I thought about this again and found this solution: With r3172 you can add rules to the relations file to manipulate restriction relations, e.g. like this : type=restriction & except ~ '.*bicycle' {set except='${except};motorcar'} The meaning of the restriction relation is now evaluated after style processing, so you can change or add or remove tags. If the restriction is not valid after that, it will be ignored. You probably have to add a few more rules to handle the cases like type=restriction:motorcar or restriction:motorcar=no_u_turn I hope that works for all cases? Gerd
Date: Sun, 30 Mar 2014 18:43:25 +0200 From: ligfietser@online.nl To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] vehicles in restriction relations
Hi Gerd, I think it should not be hardcoded but handled in the style files, because mapmakers like me are "misusing" mkgmap:car for other purposes (I use car for racing bike routing in my bike maps). If mkgmap hardcode the access for car to no, I can't change this anymore in my style. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Thanks Gerd, seems working fine. I have set the following rules in my relation file (cycling map) Because it's a bicycle routing only, I dont use motorcar tags from OSM and have to apply all bicycle restrictions for "motorcar" activity: # remove restrictions for motorcar type=restriction:motorcar {delete type} type=restriction & restriction:motorcar=* {delete restriction:motorcar} #apply bicycle restrictions also for "motorcar" type=restriction & restriction:bicycle=* {set restriction:motorcar='${restriction:bicycle}'} type=restriction:bicycle {set type=restriction} type=restriction & except ~ '.*bicycle' {set except='${except};motorcar'} Not sure if mkgmap recognize all these rules, I can hardly find any restrictions for bicycles. The last rule with 'except bicycle' is working in "car mode" as intended.
I thought about this again and found this solution: With r3172 you can add rules to the relations file to manipulate restriction relations, e.g. like this : type=restriction & except ~ '.*bicycle' {set except='${except};motorcar'}
The meaning of the restriction relation is now evaluated after style processing, so you can change or add or remove tags. If the restriction is not valid after that, it will be ignored. You probably have to add a few more rules to handle the cases like type=restriction:motorcar or restriction:motorcar=no_u_turn
I hope that works for all cases?

Hi Minko, ligfietser wrote
Not sure if mkgmap recognize all these rules, I can hardly find any restrictions for bicycles. The last rule with 'except bicycle' is working in "car mode" as intended.
the typical restriction only has these two tags: type=restriction restriction=* They apply to bicycles, so you should find most restrictions in your map as well when all is correct. Gerd -- View this message in context: http://gis.19327.n5.nabble.com/vehicles-in-restriction-relations-tp5801618p5... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi Minko, I've just noticed that this solution does not yet work in combination with option --process-destination. Gerd
Date: Mon, 7 Apr 2014 17:56:34 +0200 From: ligfietser@online.nl To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] vehicles in restriction relations
Thanks Gerd, seems working fine.
I have set the following rules in my relation file (cycling map) Because it's a bicycle routing only, I dont use motorcar tags from OSM and have to apply all bicycle restrictions for "motorcar" activity:
# remove restrictions for motorcar type=restriction:motorcar {delete type} type=restriction & restriction:motorcar=* {delete restriction:motorcar}
#apply bicycle restrictions also for "motorcar" type=restriction & restriction:bicycle=* {set restriction:motorcar='${restriction:bicycle}'} type=restriction:bicycle {set type=restriction} type=restriction & except ~ '.*bicycle' {set except='${except};motorcar'}
Not sure if mkgmap recognize all these rules, I can hardly find any restrictions for bicycles. The last rule with 'except bicycle' is working in "car mode" as intended.
I thought about this again and found this solution: With r3172 you can add rules to the relations file to manipulate restriction relations, e.g. like this : type=restriction & except ~ '.*bicycle' {set except='${except};motorcar'}
The meaning of the restriction relation is now evaluated after style processing, so you can change or add or remove tags. If the restriction is not valid after that, it will be ignored. You probably have to add a few more rules to handle the cases like type=restriction:motorcar or restriction:motorcar=no_u_turn
I hope that works for all cases?
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
participants (6)
-
Gerd Petermann
-
GerdP
-
Minko
-
paco.tyson@free.fr
-
Thorsten Kukuk
-
WanMil