logo separator

[mkgmap-dev] Multiple relation names

From Marko Mäkelä marko.makela at iki.fi on Tue Mar 26 18:39:54 GMT 2013

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


More information about the mkgmap-dev mailing list