Add link-to-tags features that behaves like the link-pois-to-ways Command for the lines style-file

I am coming to a point when maintaining my lines file, that adding a single key on top, means 200-300 lines more. This is becoming unmaintainable. It would be great to have the option to have rules just like the ones we have for POI that one can run on certain keys. e.g. lanes=2 & oneway=yes { add mkgmap:road-speed = '-1'; add mkgmap:road-class = '-1'; } This should then be matched to all lines that are generated after this command. As this is already possible for POI, I hope someone could without much effort implement this for rules based on tags too. This would be very useful as it saves many many lines of code. Currently if you would like to do something like this, it means that you have to add the rule to every line (with autorouting) in your lines file. This is okay for one or to tags (like some people do for maxspeed), but it becomes impossible to keep track once you have 10 tags you like to be enacted. If there are several rules matching, they should simply add up. (or equalise themselves if +1 meets -1...) It would be really great if someone could implement this feature. As it exists already for POI when using link-pois-to-ways I have the great hope that it is easy to implement and program and someone finds some spare time to do it. This could really help to avoid creating a ton of rules and open up many new possibilities to much better finetune road_class and road_speed. It would be a plus, if one could only "apply" this rule until a stop rule is given. Quick example lanes=2 & oneway=yes { add mkgmap:road-speed = '+1'; add mkgmap:road-class = '+1'; set rule=1 } highway=primary & maxspeed=100 {road_class=3 road_speed=4 0x02] highway=primary .... highway=secondary... .... rule=1 {stop execution}

On 09.05.2010 23:51, Felix Hartmann wrote:
I am coming to a point when maintaining my lines file, that adding a single key on top, means 200-300 lines more. This is becoming unmaintainable. It would be great to have the option to have rules just like the ones we have for POI that one can run on certain keys.
e.g. lanes=2 & oneway=yes { add mkgmap:road-speed = '-1'; add mkgmap:road-class = '-1'; } This should then be matched to all lines that are generated after this command. As this is already possible for POI, I hope someone could without much effort implement this for rules based on tags too. This would be very useful as it saves many many lines of code. Currently if you would like to do something like this, it means that you have to add the rule to every line (with autorouting) in your lines file. This is okay for one or to tags (like some people do for maxspeed), but it becomes impossible to keep track once you have 10 tags you like to be enacted.
If there are several rules matching, they should simply add up. (or equalise themselves if +1 meets -1...)
It would be really great if someone could implement this feature. As it exists already for POI when using link-pois-to-ways I have the great hope that it is easy to implement and program and someone finds some spare time to do it. This could really help to avoid creating a ton of rules and open up many new possibilities to much better finetune road_class and road_speed.
It would be a plus, if one could only "apply" this rule until a stop rule is given. Quick example lanes=2 & oneway=yes { add mkgmap:road-speed = '+1'; add mkgmap:road-class = '+1'; set rule=1 } highway=primary & maxspeed=100 {road_class=3 road_speed=4 0x02] highway=primary .... highway=secondary... .... rule=1 {stop execution}
Just to give some really useful example why we need this.... / incline>20 | incline<-20 { add mkgmap:road-speed = '+1'; add mkgmap:road-class = '+1'; set rule=1 }/ could be used to give much more realistic time estimates and prefer streets through the valley instead of driving "over the mountain".

Hi So do you mean:
rule is given. Quick example lanes=2& oneway=yes { add mkgmap:road-speed = '+1'; add mkgmap:road-class = '+1'; set rule=1 } highway=primary& maxspeed=100 {road_class=3 road_speed=4 0x02]
If the tags are: highway=primary, maxspeed=100 then you get road_class=3 and with the tags highway=primary, maxspeed=100, lanes=2, oneway=yes you get road_class=4? If so I have an idea of how that could be done. ..Steve

On 11.05.2010 00:49, Steve Ratcliffe wrote:
Hi
So do you mean:
rule is given. Quick example lanes=2& oneway=yes { add mkgmap:road-speed = '+1'; add mkgmap:road-class = '+1'; set rule=1 } highway=primary& maxspeed=100 {road_class=3 road_speed=4 0x02]
If the tags are: highway=primary, maxspeed=100 then you get road_class=3
and with the tags highway=primary, maxspeed=100, lanes=2, oneway=yes you get road_class=4?
If so I have an idea of how that could be done.
Yes. But this was a bad example. My second example of incline is much more useful for "everyone" (except hikers and mountainbikers or cyclists who like to go uphill). It should work just like the link pois to ways is working, but based on tags. Plus the possibility for stopping the execution (because then you can have seperate actions for big streets vs small streets vs tracks/pathes). Oh and also introduce a max setting (besides the obvious limits of 0-4 for roadclass and 0-7 for roadspeed) as for many kind of streets high roadspeed is actually devastating. The max however should be the last action when several rules are enacted on the same street. So if roadspeed=1 and then three times +1 roadspeed and once -1 roadspeed and max_roadspeed=3, max_roadspeed is set to three and not two.... This would really be a great addition because it makes the style-file less abstact and more focussed on how one would assess the routing from human perspective (it's going up heavily, I have to drive slower....).
..Steve _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

On 11.05.2010 00:49, Steve Ratcliffe wrote:
Hi
So do you mean:
rule is given. Quick example lanes=2& oneway=yes { add mkgmap:road-speed = '+1'; add mkgmap:road-class = '+1'; set rule=1 } highway=primary& maxspeed=100 {road_class=3 road_speed=4 0x02]
If the tags are: highway=primary, maxspeed=100 then you get road_class=3
and with the tags highway=primary, maxspeed=100, lanes=2, oneway=yes you get road_class=4?
If so I have an idea of how that could be done.
..Steve
Any work on this?... push...

On 11.05.2010 00:49, Steve Ratcliffe wrote:
Hi
So do you mean:
rule is given. Quick example lanes=2& oneway=yes { add mkgmap:road-speed = '+1'; add mkgmap:road-class = '+1'; set rule=1 } highway=primary& maxspeed=100 {road_class=3 road_speed=4 0x02]
If the tags are: highway=primary, maxspeed=100 then you get road_class=3
and with the tags highway=primary, maxspeed=100, lanes=2, oneway=yes you get road_class=4?
If so I have an idea of how that could be done.
..Steve
Hi Steve, Did you not succeed here, or didn't you find any time for implementing it? It would be really classy to have as feature! Cheers Felix...
participants (2)
-
Felix Hartmann
-
Steve Ratcliffe