logo separator

[mkgmap-dev] The substitution $(....)

From Marko Mäkelä marko.makela at iki.fi on Sun Feb 10 16:42:14 GMT 2013

On Fri, Feb 08, 2013 at 09:08:08PM +0000, Ataro A wrote:
>I've erroneusly used the substitution $(....) in a rule in the style 
>file lines as follow:
>highway=* & route=* {set route_ref='$(route_ref), ${ref}' | '${ref}'}
>and mkgmap don't return with some error or warning.

I implemented this feature some years ago, so that you could append 
attributes from multiple relations to the relation members. For example, 
append all ${ref} of bus route relations to the ${route_ref} of the bus 
stop POIs.

>This substitution $(....), as state the manual, are reserved for the 
>use in a apply rule in the relations file and are not usable in other 
>style files.
>I've found a mkgmap bug or what other?

It could be fixed in the documentation, by saying that $(name) is 
equivalent to ${name} outside the apply action.

In uk.me.parabola.mkgmap.osmstyle.actions.ValueItem, there ${} vs $() 
chooses whether we are referring to the relation or to the relation 
member. For example,

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

in the default style will set the attribute mkgmap:boundary_name in the 
relation member. The $(mkgmap:boundary_name) refers to attribute in the 
relation member, while ${name} refers to the attribute in the relation 
itself.

Best regards,

	Marko


More information about the mkgmap-dev mailing list