Names and relations (multipolygons)

Dear all, is there a possibility, that the polygons (ways) of a relation (multipolygon) "inherit" the name tag of the relation? Background: Sometimes lakes with islands are mapped in OSM as multipolygon relation and the name tag of the lake is attached to the relation only, e.g. <relation id="28547"> <member type="way" ref="26419086" role="outer"/> <member type="way" ref="26419094" role="inner"/> <tag k="name" v="Bagnosee (r)"/> <tag k="type" v="multipolygon"/> </relation> Unfortunately none of the following code lines in my style/relation file worked with mkgmap revision 848 (the lake never had a name): type=multipolygon { apply { add name='${name}' } } type=multipolygon { apply { set name='${name}' } } type=multipolygon { apply { name '${name}' } } Any hints wellcome, thanks! Best regards, Volker. ****---*------*------*------*------*------*------*------*------*------* *\Viele -- Volker Bosch, Humboldtstr.21, 70771 Leinf.-Echterdingen **\ Gruesse -- Tel:(0711)713967, E-Mail: volker.bosch@t-online.de ***\ -- http://www.s-line.de/homepages/bosch

On Sun, Jan 25, 2009 at 05:07:38PM +0100, Volker Bosch wrote:
is there a possibility, that the polygons (ways) of a relation (multipolygon) "inherit" the name tag of the relation?
Unfortunately there was a bug where only one relation was actually being processed. This is now fixed and so I believe the rule you tried out:
type=multipolygon { apply { set name='${name}' } }
looks like it would work with the fixed code, or with 'add' instead of 'set' if you want names on the polygons to override the name on the relation. The problem reported by Felix a while back is also caused by this problem. You need r849 or newer. ..Steve

Hello Steve, thank you for the reply and the bug fix! You wrote:
This is now fixed and so I believe the rule you tried out:
type=multipolygon { apply { set name='${name}' } }
looks like it would work with the fixed code, or with 'add' instead of 'set' if you want names on the polygons to override the name on the relation.
I've updated to 851 (svn) but it still does not work (neither the 'set' or the 'add' command). I still don't see a name tag on that lake. When I manually append a name tag to the 'natural=water' polygon in the osm code, I see the name tag in my viewer (qlandkartegt). So I'm quite sure that the failure reason is not my viewer. Might this be a problem of my java installation? Unfortunately I'm not familiar with java. As I'm running slackware on my pc I just installed the following slackware packages: jdk-6u11-i586-1.tgz re-6u11-i586-1.tgz apache-ant-1.7.0-i586-1bj.tgz Thank you very much & best regards, Volker. ****---*------*------*------*------*------*------*------*------*------* *\Viele -- Volker Bosch, Humboldtstr.21, 70771 Leinf.-Echterdingen **\ Gruesse -- Tel:(0711)713967, E-Mail: volker.bosch@t-online.de ***\ -- http://www.s-line.de/homepages/bosch

Hello Volker
I've updated to 851 (svn) but it still does not work (neither the 'set' or
I must admit that I was not testing for the case of 'name', or indeed multipolygon relations. Both name and multipolygons are special cases in the code. So I will dig deeper.
jdk-6u11-i586-1.tgz re-6u11-i586-1.tgz apache-ant-1.7.0-i586-1bj.tgz
They are all fine and up to date. ..Steve

Hello Steve, thanks for your feedback! You wrote:
I must admit that I was not testing for the case of 'name', or indeed multipolygon relations. Both name and multipolygons are special cases in the code.
Okay, understood. I tried to set another tag in the style/relation file: type=multipolygon { apply { set mapthisto=ocean; } } and wrote the following code into the style/polygon file: natural=water & mapthisto=ocean {name '${name} (See)' | 'See' } [0x28 resolution 14] but mkgmap did not use polygon 0x28 for that lake. So the problem might lay in the multipolygon code. Thank you very much & cheerio, Volker P.S.: I like mkgmap very much! It's great fun to adjust the osm data to my special purpose, a garmin map for cycling. Especially new style feature gives me lots of new options. Great work, thanks a lot! ****---*------*------*------*------*------*------*------*------*------* *\Viele -- Volker Bosch, Humboldtstr.21, 70771 Leinf.-Echterdingen **\ Gruesse -- Tel:(0711)713967, E-Mail: volker.bosch@t-online.de ***\ -- http://www.s-line.de/homepages/bosch

Hi Volker
but mkgmap did not use polygon 0x28 for that lake. So the problem might lay in the multipolygon code.
Yes there was a big problem there. No tags were being set or way references copied when it was being converted from a GeneralRelation to a MultiPolygonRelation. I probably introduced recently. Try now. Maybe not perfect yet, but a lot better. I managed to get the relation name onto the polygon with something like this: type=multipolygon { apply { set blob=xy; set name='FROM ROLE ${name}'; } } I included the string 'FROM ROLE' just so I could easily see when the rule was being applied. ..Steve

Hi Steve, now it works fine, thank you very much! I'm curious what usefull information I'll be able to add to my cycle map with this nice feature! Regards, Volker. ****---*------*------*------*------*------*------*------*------*------* *\Viele -- Volker Bosch, Humboldtstr.21, 70771 Leinf.-Echterdingen **\ Gruesse -- Tel:(0711)713967, E-Mail: volker.bosch@t-online.de ***\ -- http://www.s-line.de/homepages/bosch
participants (2)
-
Steve Ratcliffe
-
volker.bosch@t-online.de