logo separator

[mkgmap-dev] Multiple relation names

From Geoff Sherlock geoffrey_sherlock at btinternet.com on Tue Mar 26 19:58:39 GMT 2013

Hi Marko,

Yes I understand the concept now, I just can't get it to work! I have 
simplified the lines file now, but no change:

type=route & name=* {
    apply {
        set route_display_name='$(route_display_name)/${name}'|'${name}';
    }
}
(highway=track | highway=bridleway | highway=cycleway | highway=footway) & 
route_display_name=* {set name='${route_display_name}'}

Still only showing one name when I know there are two, still not setting the 
name to the route name if the way name is already set. Both in Garmin apps 
and on device.

If I replace route_display_name with just name, and remove the line that 
sets the way name; it does not change the way name at all???

Downloaded and tried with mkgmap-r2538 with no success either.

Thanks for your help and information, but I feel like I'm banging my head 
against a wall with this one. Think I will give up on it for now, at least I 
am showing more route names than before; I'll give it another try at a later 
date - although I really can't see anything wrong in the style?!?!?

Thanks again, Geoff.

-----Original Message----- 
From: MarkoMäkelä
Sent: Tuesday, March 26, 2013 6:39 PM
To: Development list for mkgmap
Subject: Re: [mkgmap-dev] Multiple relation names

On Tue, Mar 26, 2013 at 05:44:05PM -0000, Geoff Sherlock wrote:
>OK, I think I see how the concatenation is done now.
>
>I changed my lines file to thus (relation tag route_display_name is set in
>relations):
>
>type=route & route_display_name=* {
>    apply {
>        set
>route_display_name='$(route_display_name),${route_display_name}';
>    }
>}
>(highway=track | highway=bridleway | highway=cycleway | highway=footway) &
>route_display_name=* {set name='${route_display_name}' continue
>with_actions}
>
>But I do not get a comma separated list of names, still just a single name
>showing in Mapsource or Basecamp - and without a comma.
>
>Also why does this does this not replace names already defined for a
>track/bridleway etc!!!!???? It only gets set if the name is not already 
>set.

Did you have a look at the the default style? It sets bus route $ref in
highway=bus_stop relations. It also sets the boundary names on boundary
lines (not sure if that is still being used). But, let me quote it:

(type=boundary | type=multipolygon) & boundary=administrative & name=*
{ apply
   {
     set mkgmap:boundary_name='$(mkgmap:boundary_name)/${name}' |
'${name}';
   }
}

The ${name} refers to the relation attribute. The 'set' and
$(mkgmap:boundary_name) [note $(...) instead of ${...}] refers to the
relation member. This command will do one of two things:

(1) if 'mkgmap:boundary_name' is not already set on the member, assigns
it to the 'name' of the relation
(2) otherwise, appends '/' and the relation name to mkgmap:boundary_name

This parameter is used in the default/lines file to assign a name for
the boundary:

boundary=administrative { name '${mkgmap:boundary_name}' }

Technically, I guess you could write something like this directly:

apply { set name='$(name)/${name}' | '${name}' }

However, this could be a bad idea, because it would overwrite the name
of any relation member, such as a section of a river or a highway (if
they are part of the relation).

Also, have a look at the styles/default/routes-* relations. I used to
build a multi-layer map that had --style=routes-bus and
--style=routes-bicycle in separate transparent layers, selectable on the
maps menu in the device.

Best regards,

Marko
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev at lists.mkgmap.org.uk
http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev 



More information about the mkgmap-dev mailing list