set display name problem ( Error in style: Error: (lines:14): Unrecognised command 'display_name', Could not open style null )

I would like to set up display name with lines in my style-file like highway=tertiary { display_name '${name}' | 'tertiary' } [0x04 ........] however currently this is impossible. Could someone adapt mkgmap to treat display_name processing like "name" processing? The reason for this is that adding lengthier text to name clutters up the map, but display_name will not be printed out, but only given for turn instructions and on the tool tip - which is exactly what I would need.

On Nov 9, 2009, at 19:04, Felix Hartmann wrote:
I would like to set up display name with lines in my style-file like highway=tertiary { display_name '${name}' | 'tertiary' } [0x04 ........]
Have you tried it with "add display_name =" ...? Or do you need the syntax in the line above? This is the line I have in my style file: highway=primary | highway=secondary | highway=tertiary {name '${ref| highway-symbol:oval:6:4} ${name}' | '${ref|highway-symbol:oval:6:4}' | '${name|highway-symbol:oval:6:4}'; add display_name = '${name} ($ {ref})' } And this works for me. :-) Cheers.

On 09/11/09 18:04, Felix Hartmann wrote:
I would like to set up display name with lines in my style-file like highway=tertiary { display_name '${name}' | 'tertiary' } [0x04 ........]
however currently this is impossible. Could someone adapt mkgmap to treat display_name processing like "name" processing?
I can add the list of alternatives to all set and add commands: add display_name = '${name}' | 'tertiary'; Is that what you want? I think that would be useful elsewhere anyway. Currently you can do this, which I think does what you want but more verbose: highway=tertiary { add display_name = '${name}'; add display_name = 'tertiary'; } [0x04 ... ] In other cases that wouldn't work, for example if display_name was already set, but you wanted to append to it for example. There is also the issue that if there is a NET section a road can have up to four names, which cannot be expressed in the style file currently. ..Steve

Hi Steve,
There is also the issue that if there is a NET section a road can have up to four names, which cannot be expressed in the style file currently.
Actually, they can because tags "ref", "int_ref", "nat_ref" and "reg_ref" will assign to them (and they can all have multiple elements separated with ";") Cheers, Mark

Mark Burton wrote:
Hi Steve,
There is also the issue that if there is a NET section a road can have up to four names, which cannot be expressed in the style file currently.
Actually, they can because tags "ref", "int_ref", "nat_ref" and "reg_ref" will assign to them (and they can all have multiple elements separated with ";")
could you explain a bit more how they work? Am I right that: {name} is the standard file and will be used for everything as long as no other is used {display_name} will be used as unique (or additional?) tool tip on GPS/Mapsource as well as for routing instructions. {ref};{int_ref};{nat_ref};{ref_ref} will be used as additonal tooltip AND appended to the {name}. Is the appending to {name} somewhere in mkgmap code configurable? (the display_name patch did somthing like this) Or is the {display_name} actually written to one of theese ref* fields?
Cheers,
Mark _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Felix,
could you explain a bit more how they work?
Simply, the contents of those "ref" like names are all concatenated together with ";" between them and then the first 4 names in that list are used as the labels for the way. If the way also has a "name" then that will be the first label and you will only get 3 labels from the "ref" list. Also, if display_name is assigned, that goes in front of the refs. For example, if X=Y represents a tag called X having the value Y: name="foo" display_name="bah" ref="A123" int_ref="E99" would produce these labels: "foo" "bah" "A123" "E99" You could also have: name="foo" display_name="bah" ref="A123;E99" and the end result would be the same. Very simple. Mark

Mark Burton wrote:
Hi Felix,
could you explain a bit more how they work?
Simply, the contents of those "ref" like names are all concatenated together with ";" between them and then the first 4 names in that list are used as the labels for the way. If the way also has a "name" then that will be the first label and you will only get 3 labels from the "ref" list. Also, if display_name is assigned, that goes in front of the refs. For example, if X=Y represents a tag called X having the value Y:
name="foo" display_name="bah" ref="A123" int_ref="E99"
would produce these labels:
"foo" "bah" "A123" "E99"
You could also have:
name="foo" display_name="bah" ref="A123;E99"
and the end result would be the same.
okay, thanks for the clarification. In this case it would be great if the "|" could be used for display_name, ref, int_ref, nat_ref too! (or maybe even better for all add / set actions ) and additionally a command to append would be great too. At least that clarification makes it a lot easier for route names now for me. Instead of having the line set route_name='${name}'; set ref='${ref}' I will now simply use set int_ref='${name};${ref}|highway-symbol:hbox:6:4}' And will not be forced to fiddle around with how I append route_name to name in the general style-file. As last question - what happens if there are more than 4 labels - are label 5 and onwards simply dropped?
Very simple.
Mark _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Felix,
As last question - what happens if there are more than 4 labels - are label 5 and onwards simply dropped?
Yes, you do get a message though from the RoadDef class (warning level). Cheers, Mark PS - please ignore the patch I just posted for the recent assertions problem, I will issue another tonight. Cheers, Mark

Mark Burton wrote:
Felix,
As last question - what happens if there are more than 4 labels - are label 5 and onwards simply dropped?
Yes, you do get a message though from the RoadDef class (warning level).
Cheers,
Mark
PS - please ignore the patch I just posted for the recent assertions problem, I will issue another tonight.
just tried the patch - it got along further but ultimately still crashed on producing the tile (I try not to use --keep-going because I would then maybe miss big big errors).
Cheers,
Mark _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Felix,
just tried the patch - it got along further but ultimately still crashed on producing the tile (I try not to use --keep-going because I would then maybe miss big big errors).
My mistake, I have just committed something that I missed the other day. With r1364 and the patch I posted this evening, it should report assertions but not bomb. Those assertions should not be for roads, just for lines and shapes. I take back what I said, do try it because I don't think I have enough energy to work on this tonight. It needs more thought and my brain can't cope with it now. Cheers, Mark

Steve Ratcliffe wrote:
On 09/11/09 18:04, Felix Hartmann wrote:
I would like to set up display name with lines in my style-file like highway=tertiary { display_name '${name}' | 'tertiary' } [0x04 ........]
however currently this is impossible. Could someone adapt mkgmap to treat display_name processing like "name" processing?
I can add the list of alternatives to all set and add commands:
add display_name = '${name}' | 'tertiary';
Is that what you want? I think that would be useful elsewhere anyway.
Currently you can do this, which I think does what you want but more verbose:
highway=tertiary { add display_name = '${name}'; add display_name = 'tertiary'; } [0x04 ... ]
In other cases that wouldn't work, for example if display_name was already set, but you wanted to append to it for example.
Okay, didn't know I can use the same "command (add key) twice with";" but it would do for a start. Appending however would be a truly great feature. My standard naming for any type of road is like the following - and then depending on the type I change the structure a bit. An append command would make the below much simpler and cleaner. name '${ref|highway-symbol:hbox:6:4} ${name} ${route_name} ${extremecarver1}' | '${ref|highway-symbol:hbox:6:4} ${route_name} ${extremecarver1}' | '${ref|highway-symbol:hbox:6:4} ${name} ${extremecarver1}' | '${ref|highway-symbol:hbox:6:4} ${extremecarver1}' | '${name} ${route_name} ${extremecarver1}' | '${name} ${extremecarver1}' | '${route_name} ${extremecarver1}' | '${extremecarver1}' | '${ref|highway-symbol:box:6:4} ${name} ${route_name} ${extremecarver}' | '${ref|highway-symbol:box:6:4} ${route_name} ${extremecarver}' | '${ref|highway-symbol:box:6:4} ${name} ${extremecarver}' | '${ref|highway-symbol:box:6:4} ${extremecarver}' | '${name} ${route_name} ${extremecarver}' | '${name} ${extremecarver}' | '${route_name} ${extremecarver}' | '${extremecarver}' | '${ref|highway-symbol:oval:6:4} ${name} ${route_name}' |'${ref|highway-symbol:oval:6:4} ${route_name}' | '${name} ${route_name}' |'${route_name}' |'${ref|highway-symbol:oval:6:4} ${name}' | '${name}' | '${ref|highway-symbol:oval:6:4}' } you can imagine that adding append command would save me lots of trouble (even though it is copy paste only)... Appending would be especially great to be used from the relations file.
There is also the issue that if there is a NET section a road can have up to four names, which cannot be expressed in the style file currently.
That is interesting - what are the names used for? It would be really great to have several tooltips available. I noticed that the highway-symbol seems to be using its own tool tip. name 1 is {name} {ref}| {name} | {ref} and would also be the tool tip and be printed on the map name 2 I would use to put the naming inside for the routing instruction, this would be something like {name} {name_from_relation} {ref} {mtb:scale}{mtb:scale:uphill} .... name 3 I would use to display on tooltip only addiditional attibutes like surface, mtb:scale, tracktype,... name 4 could be used to show in verbose text like mtb:description , on/off hours for ferries, .... there is nothing in net section to show long descriptions like for POI is there? That way one could even add short texts to relations so to have a "basic travelguide".... And for the default style-file putting service hours for ferries, or gondolas would be great. This would be a for now unique feature for Garmin maps.
..Steve _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Steve Ratcliffe wrote:
On 09/11/09 18:04, Felix Hartmann wrote:
I would like to set up display name with lines in my style-file like highway=tertiary { display_name '${name}' | 'tertiary' } [0x04 ........]
however currently this is impossible. Could someone adapt mkgmap to treat display_name processing like "name" processing?
I can add the list of alternatives to all set and add commands:
add display_name = '${name}' | 'tertiary';
Is that what you want? I think that would be useful elsewhere anyway.
Hi Steve, could you do please commit that? I have run into problems that won't work without "|" because I would like to exchange "ref" so simply using add won't work and set neither, because I don't know whether the combinations of things I want to use do exist. Best however would be a command to append labels like { append name '${ref}' } that would replace the current command { name '${name} {ref}' | '${name}' | '${ref}' }. In case that nothing in the append name '' exists then it will not be carried out. In case that some exist, only those existing should be placed.
Currently you can do this, which I think does what you want but more verbose:
highway=tertiary { add display_name = '${name}'; add display_name = 'tertiary'; } [0x04 ... ]
In other cases that wouldn't work, for example if display_name was already set, but you wanted to append to it for example.
There is also the issue that if there is a NET section a road can have up to four names, which cannot be expressed in the style file currently.
..Steve _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

On Nov 11, 2009, at 22:47, Felix Hartmann wrote:
Best however would be a command to append labels like { append name '${ref}' } that would replace the current command { name '${name} {ref}' | '${name}' | '${ref}' }. In case that nothing in the append name '' exists then it will not be carried out. In case that some exist, only those existing should be placed.
Could you provide an example of what you want to do? Would something like this work for you: {name '${name|append:ref}'} which would have the same effect as { name '${name} {ref}' | '${name}' | '${ref}' }? If so, what is the advantage of the append? Cheers.
participants (4)
-
Clinton Gladstone
-
Felix Hartmann
-
Mark Burton
-
Steve Ratcliffe