tag values of relations and tag values of its members

Hallo, is there any way to use the tag values of the members of a relation within the apply command in the relations style file? With apply {set Member_Tag_Value=${Relation_Tag_Value}} I can set the tag value of the relation to all its members. Instead of just setting the tag in the member, I would like to combine it with a tag value from the member. Something like apply {set Member_Tag_Value='${Member_Tag_Value} and ${Relation_Tag_Value}'} Can this be done somehow? And as a related question: I it possible to include tags of the member of the relation in the tag test of a relation rule? Gruss Torsten

long time ago I have done it with a temporary tag name in the relations file. and then in the line style test for existence of the temporary tag and combine with the tag values from the lines the only change you need is to test the existence of Relation_Tag_Value in the line style On 10 Sep 2010, at 7:21 , Torsten Leistikow wrote:
Hallo,
is there any way to use the tag values of the members of a relation within the apply command in the relations style file?
With
apply {set Member_Tag_Value=${Relation_Tag_Value}}
I can set the tag value of the relation to all its members.
Instead of just setting the tag in the member, I would like to combine it with a tag value from the member. Something like
apply {set Member_Tag_Value='${Member_Tag_Value} and ${Relation_Tag_Value}'}
Can this be done somehow?
And as a related question: I it possible to include tags of the member of the relation in the tag test of a relation rule?
Gruss Torsten _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Apollinaris Schoell schrieb am 10.09.2010 18:41:
long time ago I have done it with a temporary tag name in the relations file. and then in the line style test for existence of the temporary tag and combine with the tag values from the lines the only change you need is to test the existence of Relation_Tag_Value in the line style
I think this wouldn't solve my problem. What I want to achieve is, that multiple relations can add information to a single way. E.g. A way A is member of relation relation B and also member of relation C, beside their name both relations are tagged in the same way. And in the map I want to have a name for the way like "A is member of B and member of C". With a temporary tag I think I will eitehr get the result "A is member of B" or "A is member of C" But I do not see any way rigth now, how both relations can add their information to way A at the same time. Gruss Torsten

On Fri, Sep 10, 2010 at 07:01:55PM +0200, Torsten Leistikow wrote:
I think this wouldn't solve my problem. What I want to achieve is, that multiple relations can add information to a single way.
I implemented the $(variable_name) syntax some time ago, to get bus route relations translated properly. An excerpt from --style=routes: [relations file] type=route & ... { apply { set mkgmap:route='$(mkgmap:route),${ref}' | '${ref}' } } [lines file] highway=* & mkgmap:route=* { name '${mkgmap:route}' } [0x1d resolution 16] Note that in the apply rule, the $(mkgmap:route) is referring to an attribute of the relation member, and the ${ref} is referring to an attribute of the relation. What I would like to see is "apply" sorted by some criterion, and the possibility to filter out duplicates, for example, when the same way is part of opposite-direction bus route relations. (Opposing bus routes of the same line can consist of oneway segments as well as shared non-oneway segments. Now I will see "742,742" on the non-oneways and just "742" on the oneways.) I'd also like to have mkgmap generate multiple map layers in one go, so that for type=route relations, different values of route=* would go to different layers. You normally might want to see only one of route=road, route=bicycle, route=bus at a time (by selecting visible map layers on the device). Do we have a bug tracking system or a wiki page for tracking this kind of long-term, hard-to-implement feature requests? Marko

Marko Mäkelä schrieb am 10.09.2010 22:12:
I implemented the $(variable_name) syntax some time ago, to get bus route relations translated properly. An excerpt from --style=routes:
[relations file] type=route & ... { apply { set mkgmap:route='$(mkgmap:route),${ref}' | '${ref}' } } [lines file] highway=* & mkgmap:route=* { name '${mkgmap:route}' } [0x1d resolution 16]
Note that in the apply rule, the $(mkgmap:route) is referring to an attribute of the relation member, and the ${ref} is referring to an attribute of the relation.
Thank you very much, that was the information I was mainly looking for. I will add this information also on the style rules page in the Wiki.
What I would like to see is "apply" sorted by some criterion, and the possibility to filter out duplicates, for example, when the same way is part of opposite-direction bus route relations. (Opposing bus routes of the same line can consist of oneway segments as well as shared non-oneway segments. Now I will see "742,742" on the non-oneways and just "742" on the oneways.)
Is there any way to check for the role of the member inside the style rules? Gruss Torsten

On Fri, Sep 10, 2010 at 10:35:14PM +0200, Torsten Leistikow wrote:
What I would like to see is "apply" sorted by some criterion, and the possibility to filter out duplicates, for example, when the same way is part of opposite-direction bus route relations. (Opposing bus routes of the same line can consist of oneway segments as well as shared non-oneway segments. Now I will see "742,742" on the non-oneways and just "742" on the oneways.)
Is there any way to check for the role of the member inside the style rules?
Yes, apply role=value (role ~ 'regexp' would be nicer, but not implemented). It would also be nice to check for the type of the member (node, way, relation), but there is no syntax for that. See src/uk/me/parabola/mkgmap/osmstyle/actions/ActionReader.java, the role=value parsing is in readAllCmd. Marko

Marko Mäkelä schrieb am 10.09.2010 22:55:
Yes, apply role=value (role ~ 'regexp' would be nicer, but not implemented). It would also be nice to check for the type of the member (node, way, relation), but there is no syntax for that.
See src/uk/me/parabola/mkgmap/osmstyle/actions/ActionReader.java, the role=value parsing is in readAllCmd.
In ActionReader there is also an apply_once command included. Can this be used to prevent the forward/backward-doubling? Or what is the intended use of apply_once vs. apply? Gruss Torsten

On Sat, Sep 11, 2010 at 08:53:48AM +0200, Torsten Leistikow wrote:
In ActionReader there is also an apply_once command included. Can this be used to prevent the forward/backward-doubling? Or what is the intended use of apply_once vs. apply?
I implemented it when I started playing with relations: ------------------------------------------------------------------------ r1464 | marko | 2010-01-04 17:11:48 +0200 (Mon, 04 Jan 2010) | 2 lines Implement apply_once for applying commands once on relation members, even if the relation contains the members multiple times in a matching role. ------------------------------------------------------------------------ This would only help in case a bus route relation was defined in a single relation comprising both ways. If we have one relation per direction, every member would be included only once per relation anyway. Marko

Marko Mäkelä (marko.makela@iki.fi) wrote:
On Fri, Sep 10, 2010 at 07:01:55PM +0200, Torsten Leistikow wrote:
I think this wouldn't solve my problem. What I want to achieve is, that multiple relations can add information to a single way.
[snip]
Do we have a bug tracking system or a wiki page for tracking this kind of long-term, hard-to-implement feature requests?
There's this: http://wiki.openstreetmap.org/wiki/Mkgmap#Known_issues -- Charlie

On Sat, Sep 11, 2010 at 06:41:48AM +0100, charlie@cferrero.net wrote:
Do we have a bug tracking system or a wiki page for tracking this kind of long-term, hard-to-implement feature requests?
There's this: http://wiki.openstreetmap.org/wiki/Mkgmap#Known_issues
Charlie, thank you for the hint. Now there is http://wiki.openstreetmap.org/wiki/Mkgmap#Relations discussing the limitations related to relations that I have thought of. It also links to the page http://wiki.openstreetmap.org/wiki/Mkgmap/help/style_rules#apply where the substitution $(variable_name) has been documented. Now that I wrote http://wiki.openstreetmap.org/wiki/Mkgmap/help/style_rules#apply_once, all of this thread should be summarized on the mkgmap wiki pages. Marko
participants (4)
-
Apollinaris Schoell
-
charlie@cferrero.net
-
Marko Mäkelä
-
Torsten Leistikow