
Hi, short question: when I have these lines with action rules : highway=secondary { name 'bla' } highway=* { name 'blupp' } are *both* lines executed for a secondary or only the first one ? Chris

On 29/08/12 18:54, Chris66 wrote:
highway=secondary { name 'bla' } highway=* { name 'blupp' }
are*both* lines executed for a secondary or only the first one ?
Both are executed, but 'name' has no effect if the name has already been set. So the result would be 'bla'. ..Steve

You stated out that name isn't processed twice. My question: Is it possible to implement that ? Here's a real life example: Data: amenity: restaurant building: yes cuisine: regional name: Gasthof Stern stars: 3 tourism: hotel Point style: tourism = hotel & name = * { name '${stars}* ${name} (Hotel)' | '${name} (Hotel)' } [0x2b01 resolution 24 continue with_actions] ... amenity = restaurant & cuisine = regional & name = * {name '${name} (${cuisine}, Restaurant)'} [0x2a10 resolution 24] Result: Hotel name: "3* Gasthof Stern (Hotel)" Restaurant name: "3* Gasthof Stern (Hotel)" Expected result: Hotel name: "3* Gasthof Stern (Hotel)" Restaurant name: "3* Gasthof Stern (Hotel) (regional, Restaurant)" Regards Klaus -- View this message in context: http://gis.19327.n5.nabble.com/understanding-style-files-tp5722659p5722665.h... Sent from the Mkgmap Development mailing list archive at Nabble.com.

On Wed, Aug 29, 2012 at 11:57:29AM -0700, toc-rox wrote:
You stated out that name isn't processed twice. My question: Is it possible to implement that ?
IIRC, 'name' behaves roughly like 'add name='. You want 'set name='. Add is a no-op if the tag already exists. Set will overwrite an existing value. Can you try replacing 'name' with 'set name='? Marko

@Marko: Thanks for the hint - this variant works as expected: tourism = hotel & name = * { set name = '${stars}* ${name} (Hotel)' | '${name} (Hotel)' } [0x2b01 resolution 24 continue with_actions] ... amenity = restaurant & cuisine = regional & name = * {set name = '${name} (${cuisine}, Restaurant)'} [0x2a10 resolution 24] [IMG]http://i.imgur.com/2vwnZ.png[/IMG] Regards Klaus -- View this message in context: http://gis.19327.n5.nabble.com/understanding-style-files-tp5722659p5722827.h... Sent from the Mkgmap Development mailing list archive at Nabble.com.

am Mittwoch, 29. August 2012 um 20:28 schrieb Steve Ratcliffe:
On 29/08/12 18:54, Chris66 wrote:
highway=secondary { name 'bla' } highway=* { name 'blupp' }
are*both* lines executed for a secondary or only the first one ?
Both are executed, but 'name' has no effect if the name has already been set. So the result would be 'bla'.
But then [1] is not correct. There it says that after the first rule matches no other rules are tested. Christian [1] http://wiki.openstreetmap.org/wiki/Mkgmap/help/style_rules#continue

Am 31.08.2012 21:48, schrieb Christian H. Bruhn:
highway=secondary { name 'bla' } highway=* { name 'blupp' }
are*both* lines executed for a secondary or only the first one ?
Both are executed, but 'name' has no effect if the name has already been set. So the result would be 'bla'.
But then [1] is not correct. There it says that after the first rule matches no other rules are tested.
[1] http://wiki.openstreetmap.org/wiki/Mkgmap/help/style_rules#continue
Yes this is a little bit confusing. The parser stops on the first *non action* rule (first rule with a [...] section). Chris

am Freitag, 31. August 2012 um 22:12 schrieb Chris66:
Yes this is a little bit confusing. The parser stops on the first *non action* rule (first rule with a [...] section).
highway=secondary { set name 'bla' } highway=secondary { set name 'bla' } [0x04 road_class=2 road_speed=3 resolution 20] highway=secondary [0x04 road_class=2 road_speed=3 resolution 20] So if the first rule matches, the parser will continue. If a rule like the second or third matches, he will stop after this rule. Is that correct? Christian

On Mon, Sep 03, 2012 at 09:59:16PM +0200, Christian H. Bruhn wrote:
am Freitag, 31. August 2012 um 22:12 schrieb Chris66:
Yes this is a little bit confusing. The parser stops on the first *non action* rule (first rule with a [...] section).
highway=secondary { set name 'bla' }
highway=secondary { set name 'bla' } [0x04 road_class=2 road_speed=3 resolution 20]
highway=secondary [0x04 road_class=2 road_speed=3 resolution 20]
So if the first rule matches, the parser will continue. If a rule like the second or third matches, he will stop after this rule.
Is that correct?
Correct. Note that there exist the special actions 'continue' and 'continue_with_actions' whose exact semantics I do not remember. Marko
participants (6)
-
aighes
-
Chris66
-
Christian H. Bruhn
-
Marko Mäkelä
-
Steve Ratcliffe
-
toc-rox