version 2718 and construction {name '${name} text'|'text'} not work

I have in point file rules: shop=kiosk {name '${name}, киоск'|'киоск'} [0x2e02 resolution 20] On old version mkgmap point set name as "Name, киоск" if poi have name=Name or name as "киоск" if poi without name tag. Now in 2718 poi have only name as "Name" or name as "киоск". It's a bug or new mkgmap used new syntax for text manipulation?

Hi
shop=kiosk {name '${name}, киоск'|'киоск'} [0x2e02 resolution 20]
On old version mkgmap point set name as "Name, киоск" if poi have name=Name or name as "киоск" if poi without name tag.
Now in 2718 poi have only name as "Name" or name as "киоск".
It's a bug or new mkgmap used new syntax for text manipulation?
There has been no change to the syntax, so it would be a bug. However it doesn't happen when I just tried it. Do you have any more details? Best wishes, ..Steve

I create clean style and step by step check {...} construction. It's work ok. it's not a mkgmap bug, sorry, it's a problem in my style, but i can't find where. 26.09.2013 23:12 пользователь "Steve Ratcliffe" <steve@parabola.me.uk> написал:
Hi
shop=kiosk {name '${name}, киоск'|'киоск'} [0x2e02 resolution 20]
On old version mkgmap point set name as "Name, киоск" if poi have name=Name or name as "киоск" if poi without name tag.
Now in 2718 poi have only name as "Name" or name as "киоск".
It's a bug or new mkgmap used new syntax for text manipulation?
There has been no change to the syntax, so it would be a bug. However it doesn't happen when I just tried it. Do you have any more details?
Best wishes, ..Steve _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

I found trouble position in style. I have some lines in start of style with global substitution like as: name=* {name '${name|subst:text1=> txt1|subst:text2=> txt2}' } After this line any action with name not work. I can't insert [continue with_actions] without garmin code of object type. What way to global manipulation with tag keys and normal actions in after? Wbr, Maks.

Hi! I created small test on https://github.com/MaksVasilev/test/tree/master/garmin/multyaction Here test data and style "test". In style files points and lines first lines (marked as #1) have action block {...} for name field. If line #1 enabled, then action block {...} in.other line not work. How to use action block {...} for one field two times and more? Any solution like [... continue] for block {...}? Wbr, Maks. 27.09.2013 15:53 пользователь "Maks Vasilev" <max@stranger-team.ru> написал:
I found trouble position in style. I have some lines in start of style with global substitution like as:
name=* {name '${name|subst:text1=> txt1|subst:text2=> txt2}' }
After this line any action with name not work. I can't insert [continue with_actions] without garmin code of object type.
What way to global manipulation with tag keys and normal actions in after?
Wbr, Maks.

Hi On 27/09/13 12:53, Maks Vasilev wrote:
name=* {name '${name|subst:text1=> txt1|subst:text2=> txt2}' }
After this line any action with name not work. I can't insert [continue with_actions] without garmin code of object type.
Yes that is the way it works - the first call to 'name' sets the name of the object and it can not be set again. It is not always necessary to use the name action, but if you are using it then the rules must be arranged so that the name action is only called when you definitely want to set the name. Alternatively you could set the name tag {set name '${name|subst:text1=> txt1|subst:text2=> txt2}' } or set a temporary tag first to be used in a later name action. { set a_name '...' So in your github example you could try: #1 - try to enable/disable this line highway=* & name ~ '.*(street).*' {set name '${name|subst:street=>} str.'} #2 highway=* {name '${name} ${ref|highway-symbol:box}' | '${ref|highway-symbol:box}' | '${name}'} [0x03 resolution 19] #3 Not needed ## highway=* [0x03 resolution 19] Best wishes ..Steve

Hi Steve! That sample only little part of big problem with actions in rules. If i try write a global rename for all object like a name=* {any action}, now it work only in tag-of-object=* {actions }. But if i need 2 global rules with name, now i need to increse*2 all action block for all affected object. If i need to 50 global actions? Very long and hard action block in any string. Bad way. Second trable with block to more that one time operate to tag in selector in action: i need to rename all address tags to normalized state. If i have global rules "addr:street=* {normalized action }" then address search rules after that rules. Solution: add to style file "preprocessor". This file work first, before any other, and have only tag selector and action block without block [...]. And any action in this file don't block action in other style files. Preprocessor make mkgmap more configurable and like to production tools and it's possible to simplify manypulation in action rules. Wbr, Maks 29.09.2013 2:47 пользователь "Steve Ratcliffe" <steve@parabola.me.uk> написал:
Hi
On 27/09/13 12:53, Maks Vasilev wrote:
name=* {name '${name|subst:text1=> txt1|subst:text2=> txt2}' }
After this line any action with name not work. I can't insert [continue with_actions] without garmin code of object type.
Yes that is the way it works - the first call to 'name' sets the name of the object and it can not be set again.
It is not always necessary to use the name action, but if you are using it then the rules must be arranged so that the name action is only called when you definitely want to set the name.
Alternatively you could set the name tag {set name '${name|subst:text1=> txt1|subst:text2=> txt2}' }
or set a temporary tag first to be used in a later name action. { set a_name '...'
So in your github example you could try:
#1 - try to enable/disable this line highway=* & name ~ '.*(street).*' {set name '${name|subst:street=>} str.'}
#2 highway=* {name '${name} ${ref|highway-symbol:box}' | '${ref|highway-symbol:box}' | '${name}'} [0x03 resolution 19]
#3 Not needed ## highway=* [0x03 resolution 19]
Best wishes
..Steve _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Sorry, little correction: … Second trable with block to more that one time operate to tag in selector in action: i need to rename all address tags to normalized state. If i have global rules "addr:street=* {normalized action }" then address search rules after that rules not work. Address search rules work only if address tag used as is, but it's not good to OSM data.

On 12/10/13 07:56, Maks Vasilev wrote:
That sample only little part of big problem with actions in rules.
If i try write a global rename for all object like a name=* {any action}, now it work only in tag-of-object=* {actions }. But if i need 2 global rules with name, now i need to increse*2 all action block for all affected object. If i need to 50 global actions? Very long and hard action block in any string. Bad way.
I need to see a full example of what you are trying to do to fully understand the problem as you see it.
Solution: add to style file "preprocessor". This file work first, before any other, and have only tag selector and action block without block […]. And any action in this file don't block action in other style files.
You can have as many rule selectors and action blocks with [..] in your style and they will all be run before other rules that are placed after them in the file. But the name command is like the add command, the first time you call it with an argument that exists will set the name. If you don't want that to happen then don't use it and use the set command instead. ..Steve
participants (2)
-
Maks Vasilev
-
Steve Ratcliffe