OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

#1 2018-10-29 21:30:29

Canario
Member
Registered: 2009-12-26
Posts: 7

Display of more than one name for streets, hiking paths, etc.

Often a single path has a name, e.g. "Path 1" and at the same time this path is part of a hiking route, e.g. "Route 17".

Now I wonder, if it is possible to display both names on a garmin map. At the moment, only the name of the path is displayed.

It is possible to display the name of the route in the garmin map or both names?


I'am grateful for any help.

Canario

Offline

#2 2018-10-30 00:07:51

ligfietser
Moderator
Registered: 2008-10-09
Posts: 4,896
Website

Re: Display of more than one name for streets, hiking paths, etc.

If you compile your own maps, that is possible with mkgmap, see p12 in the style manual on http://www.mkgmap.org.uk/doc/index.html how to achieve this. I use this to render cycling route names next to the streetnames in my Openfietsmaps.

Offline

#3 2018-10-30 20:14:02

Canario
Member
Registered: 2009-12-26
Posts: 7

Re: Display of more than one name for streets, hiking paths, etc.

Thank you very much! That's exactly what I am looking for.

I guess that you have defined a rule in the relations file with the substitution ${route_ref} and then accessing it in the lines file.
I will give it a try.

Canario

Last edited by Canario (2018-10-30 20:14:28)

Offline

#4 2018-10-31 20:38:39

ligfietser
Moderator
Registered: 2008-10-09
Posts: 4,896
Website

Re: Display of more than one name for streets, hiking paths, etc.

Yes, something like that, you can find my style file here:
https://github.com/ligfietser/mkgmap-st … er/styles/

Offline

#5 2018-10-31 21:30:16

Canario
Member
Registered: 2009-12-26
Posts: 7

Re: Display of more than one name for streets, hiking paths, etc.

Great, thank you! This helps a lot (but it is still not easy for me).

In your relations file there is a rule that contains an "/" as operator:
"set iname='${iname}/${name}'| '${name}';"

Whole rule:
network=icn
    {
        apply {
        set icn_from_relation=yes;
        set iname='${iname}/${name}'| '${name}';
        set iref='${iref}/${ref}'| '${ref}';
    }
}

Could you please explain, what this "/" causes or should cause? I couldn't find it in the style manual.

Thank you in advance.

Canario

Offline

#6 2018-11-01 06:34:40

ligfietser
Moderator
Registered: 2008-10-09
Posts: 4,896
Website

Re: Display of more than one name for streets, hiking paths, etc.

The slash sign is just a text divider that shows up when one way has a name and one or more route relations, so for example way X is part of route A and route B, the name will be A / B / X.  Instead of a slash sign you can use different symbols, like  - or ( ) or whatever you like.

Offline

#7 2018-11-05 21:39:57

Canario
Member
Registered: 2009-12-26
Posts: 7

Re: Display of more than one name for streets, hiking paths, etc.

Ah, thank you.

I've tried back and forth but I am not able to name/show the names of e.g. a superior bicycle route (relations) and the name of a subordinated track, which is part of the superior route at the same time. Your sample files are a great help, but I still have a hard time to understand what is going on (in particular without a debugger).

The code in my relations file:

type=route & route=bicycle
{
apply
    {
    set name='${rname}';
    }       
}


The code in the lines file:
highway=* {name '${rname} ${name}'  |   '${rname}' }

The variable "rname" is e.g. not recognized at all.

I am able to display the name of the relation or the name of the track, but not both at the same time.

Canario

Offline

#8 2018-11-06 11:48:25

ligfietser
Moderator
Registered: 2008-10-09
Posts: 4,896
Website

Re: Display of more than one name for streets, hiking paths, etc.

In my style files I use a different type of line for cycling routes so that name is not included in the highway name.
However, highway=* {name '${rname} ${name}'  |   '${rname}' } should work.
Maybe you have copied also the last line of my lines file, which include 'inc/compat_lines';
This is included to make the old style files compatible with newer mkgmap versions, I dont know if this overrules other commands, I have no knowledge what is going on either wink
In the inc/compat_lines you see also a line with

name=* { name '${name}' }

Better ask on the mkgmap dev list.

Offline

#9 2018-11-06 11:56:19

ligfietser
Moderator
Registered: 2008-10-09
Posts: 4,896
Website

Re: Display of more than one name for streets, hiking paths, etc.

Canario wrote:

The code in my relations file:

type=route & route=bicycle
{
apply
    {
    set name='${rname}';
    }       
}

Better try this:

type=route & route=bicycle 
{
apply 
    {
    set rname='${name}'
    }       
}

Otherwise you don't have a variable named rname

Offline

Board footer

Powered by FluxBB