add info-letters for

hi ! i want to write a value (5.0) with a info-letter (h=) into a box like h=5.0 and when i use the following code in the style highway=* & maxheight>0 {name 'h= ${maxheight|subst: |highway-symbol:hbox}'} [0x01 resolution 12] in the new map not show the correct sign [h=5.0] the show sign is h=[0x07] - can anybody tell me right code??? regards Jan :-)

On Nov 11, 2009, at 19:26, Jan Tappenbeck wrote:
highway=* & maxheight>0 {name 'h= ${maxheight|subst: |highway-symbol:hbox}'} [0x01 resolution 12]
I think the subst: filter is replacing maxheight with an empty string. I'm not sure you want that statement there. Cheers.

Clinton Gladstone wrote:
On Nov 11, 2009, at 19:26, Jan Tappenbeck wrote:
highway=* & maxheight>0 {name 'h= ${maxheight|subst: |highway-symbol:hbox}'} [0x01 resolution 12]
I think the subst: filter is replacing maxheight with an empty string. I'm not sure you want that statement there.
Cheers. _______________________________________________
Do you think it is only the subst: code? The latter example that I tried does not work either: In case that there is not ref for a street and it is part of a mtb/cycle route I would like to display a custom text inside the highway symbol - but can't get it to work. My command looks like this: ....... | '${name} ${extremecarver${mtb:scale}${mtb:scale:uphill}|highway-symbol:box:6:5}' | ..... ${extremecarver} is set via the relations file, mtb:scale and mtb:scale:uphill are from osm data. ${extremecarver} is a three letter code and mtb:scale / mtb:scale/uphill single digits (0-5). However the above will not work but instead the whole line is dropped and even the naming will be incorrect - while it does work if I don't try to put it into a highway symbol. | '${name} ${extremecarver}${mtb:scale}${mtb:scale:uphill}' | This is in effect the same code as used by default ( ${ref|highway-symbol:oval:6:4} ) Just with some more other input instead of "ref"

On Nov 11, 2009, at 23:56, Felix Hartmann wrote:
My command looks like this: ....... | '${name} ${extremecarver${mtb:scale}${mtb:scale:uphill}|highway-symbol:box:6:5}' | .....
${extremecarver} is set via the relations file, mtb:scale and mtb:scale:uphill are from osm data. ${extremecarver} is a three letter code and mtb:scale / mtb:scale/uphill single digits (0-5). However the above will not work but instead the whole line is dropped and even the naming will be incorrect - while it does work if I don't try to put it into a highway symbol. | '${name} ${extremecarver}${mtb:scale}${mtb:scale:uphill}' |
I think the parser cannot deal with the nesting of other variables in ${extremecarver...}. That is why the second example works, with all three examples separate. Now, if I recall correctly, the highway symbol code always needs to be the first character in a label. If this is true, the following should work: '${extremecarver|highway-symbol:box:6:5}${mtb:scale}${mtb:scale:uphill}' This will work provided the mtb:... tags do not contain any spaces, and extremecarver fulfills the 6:5 criterium. (Note that I also removed the name at the beginning, because that would prevent the shield from being displayed. Put that in the display_name or something.) Does this help? Cheers.

Hi ! you use tags in the argument like extremecarver - but i only want to use strings like "H=" !!! regards Jan :-) Clinton Gladstone schrieb:
On Nov 11, 2009, at 23:56, Felix Hartmann wrote:
My command looks like this: ....... | '${name} ${extremecarver${mtb:scale}${mtb:scale:uphill}|highway-symbol:box:6:5}' | .....
${extremecarver} is set via the relations file, mtb:scale and mtb:scale:uphill are from osm data. ${extremecarver} is a three letter code and mtb:scale / mtb:scale/uphill single digits (0-5). However the above will not work but instead the whole line is dropped and even the naming will be incorrect - while it does work if I don't try to put it into a highway symbol. | '${name} ${extremecarver}${mtb:scale}${mtb:scale:uphill}' |
I think the parser cannot deal with the nesting of other variables in ${extremecarver...}. That is why the second example works, with all three examples separate.
Now, if I recall correctly, the highway symbol code always needs to be the first character in a label. If this is true, the following should work:
'${extremecarver|highway-symbol:box:6:5}${mtb:scale}${mtb:scale:uphill}'
This will work provided the mtb:... tags do not contain any spaces, and extremecarver fulfills the 6:5 criterium. (Note that I also removed the name at the beginning, because that would prevent the shield from being displayed. Put that in the display_name or something.)
Does this help?
Cheers.

On Thu, Nov 12, 2009 at 11:11 AM, Jan Tappenbeck <osm@tappenbeck.net> wrote:
Hi !
you use tags in the argument like extremecarver - but i only want to use strings like "H=" !!!
Hi Jan, This should be possible too. In the worst case, you can insert the magic code into the style file directly by using a hex editor, but I wouldn't recommend this. I'll see if I can take a look at this tonight. Cheers.

Jan Tappenbeck* wrotes on* /Thu Nov 12 10:11:51 GMT 2009/
**//
Hi !
you use tags in the argument like extremecarver - but i only want to use strings like "H=" !!!
regards Jan :-)
Hi, Jan i'm really not experienced with stylefiles but couldn't resolve this your problem? highway=* & maxheight>0 {set nameheight='H=${maxheight}'} highway=* & maxheight>0 {name '${nameheight|highway-symbol:box:6:4}${name}' | '${ref|highway-symbol:bval}' | '${name}'; add display_name = '${ref} ${name}' } May be it's only a silly poor man solution and you have to add for every needed string an temporary tag, afaik it works for me. cheers Gert

Gert Münzel wrote:
Jan Tappenbeck* wrotes on* /Thu Nov 12 10:11:51 GMT 2009/
**//
Hi !
you use tags in the argument like extremecarver - but i only want to use strings like "H=" !!!
regards Jan :-)
Hi, Jan i'm really not experienced with stylefiles but couldn't resolve this your problem?
highway=* & maxheight>0 {set nameheight='H=${maxheight}'} highway=* & maxheight>0 {name '${nameheight|highway-symbol:box:6:4}${name}' | '${ref|highway-symbol:bval}' | '${name}'; add display_name = '${ref} ${name}' }
Well you cannot run two things with the same command line - in my example the custom string is set in the relations file - therefore I can use it; it is however possible to set strings inside the lines file if it is setting string on unconditional rule used by conditional rule ( conditional including [0x*] - Otherwise you have to put the whole command into one line. also I know oval but not "bval". What about using it like this: highway=* & maxheight>0 {name '${maxheight|highway-symbol:box:6:4} ${name}' | '${ref|highway-symbol:oval} ${name}' |'${ref|highway-symbol:oval}' | '${name}'; add display_name = '${ref} ${name}' }
May be it's only a silly poor man solution and you have to add for every needed string an temporary tag, afaik it works for me.
cheers Gert
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi, Felix, Felix Hartmann *wrotes on* /Thu Nov 12 12:45:28 GMT 2009/
also I know oval but not "bval
arrgh, surely i don't know "bval" too. It's simply a copying/typing error and should be "box". Felix Hartmann *wrotes on* /Thu Nov 12 12:45:28 GMT 2009/
Well you cannot run two things with the same command line Hmh, as i mentioned i have actually very less experience(there is really less documentation about it) with the style stuff buti have tested it on an small testmap with very few ways. You are much more experienced with this stuff and it may be accidentally but as far i could see this two lines seems to work for me in this case.
Felix Hartmann *wrotes on* /Thu Nov 12 12:45:28 GMT 2009/
What about using it like this:
highway=* & maxheight>0 {name '${maxheight|highway-symbol:box:6:4} ${name}' | '${ref|highway-symbol:oval} ${name}' |'${ref|highway-symbol:oval}' | '${name}'; add display_name = '${ref} ${name}' }
Yes, but the "H=" which Jan wants together with the value of maxheight inside the highway shield is missing and so its not the solution he wants i guess. cheers Gert .

Gert Münzel wrote:
Hi, Felix,
Felix Hartmann *wrotes on* /Thu Nov 12 12:45:28 GMT 2009/
also I know oval but not "bval
arrgh, surely i don't know "bval" too. It's simply a copying/typing error and should be "box".
Felix Hartmann *wrotes on* /Thu Nov 12 12:45:28 GMT 2009/
Well you cannot run two things with the same command line
Hmh, as i mentioned i have actually very less experience(there is really less documentation about it) with the style stuff buti have tested it on an small testmap with very few ways. You are much more experienced with this stuff and it may be accidentally but as far i could see this two lines seems to work for me in this case.
It shouldn't once the first rule matches, the second won't be used any more. Of course the second rule will not harm either.
Felix Hartmann *wrotes on* /Thu Nov 12 12:45:28 GMT 2009/
What about using it like this:
highway=* & maxheight>0 {name '${maxheight|highway-symbol:box:6:4} ${name}' | '${ref|highway-symbol:oval} ${name}' |'${ref|highway-symbol:oval}' | '${name}'; add display_name = '${ref} ${name}' }
Yes, but the "H=" which Jan wants together with the value of maxheight inside the highway shield is missing and so its not the solution he wants i guess.
cheers Gert . _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Felix Hartmann wrotes <mailto:mkgmap-dev%40lists.mkgmap.org.uk?Subject=Re:%20%5Bmkgmap-dev%5D%20add%20info-letters%20for&In-Reply-To=%3C4AFC0E2C.6010804%40gmail.com%3E> *on* /Thu Nov 12 13:31:24 GMT 2009/
It shouldn't once the first rule matches, the second won't be used any more. Of course the second rule will not harm either. This i red also on the styles rules-page in OSMWiki and e.g.
highway=* {name '${ref|highway-symbol:oval:6:4}${name}' | '${ref|highway-symbol:oval}' | '${name}'} highway=* {name '${ref|highway-symbol:box:6:4}${name}' | '${ref|highway-symbol:box}' | '${name}' } results as expected in a label with oval highway shield and the second rule is ignored. But with highway=* & maxheight>0 {set nameheight='H=${maxheight}'} highway=* & maxheight>0 {name '${nameheight|highway-symbol:box:6:4}${name}' | '${ref|highway-symbol:box}' | '${name}'} both actions will be applied althought it's the same rule. According to your explanation only the temporary tag should be set but the second line not be taken. I have put both actions in to one rule : highway=* & maxheight>0 {set nameheight='H=${maxheight}' ; name '${nameheight|highway-symbol:box:6:4}${name}' | '${ref|highway-symbol:box}' | '${name}' } This gives me the same result as with the two lines above. May be it's simply an accident caused by ??? or couldn't it be that in some circumstances, the analysis of the rules will be handled different. cheers Gert
participants (4)
-
Clinton Gladstone
-
Felix Hartmann
-
Gert Münzel
-
Jan Tappenbeck