logo separator

[mkgmap-dev] Append Name with general rules via style-file

From Steve Ratcliffe steve at parabola.me.uk on Sat Aug 8 15:48:41 BST 2009

Hi Felix

> highway=* {
> 	name 	| '${ref} ${name} ${name1} ${name2}'
> 		| '${name} ${name1} ${name2}'
> 		| '${ref} ${name1} ${name2}'
> 		| '${ref} ${name} ${name2}'
> 		| '${ref} ${name} ${name}1'
> 		| '${ref} ${name}
> 		| '${ref} ${name1}
> 		| '${ref} ${name2}
> 		| '${name} ${name1}
> 		| '${name} ${name2}
> 		| '${name1} ${name2}
> 		| '${name}'
> 		| '${name1}'
> 		| '${name2}'
> 		| '${ref}'
>
> }

In this case you could give each value a default value of nothing, so
it would always match with just the one rule

   { name '${ref|def:} ${name|def:} ${name1|def:} ${name2|def:}' }

But you would get extra spaces when any of the value were empty.

You should also be able to do this to append any number of things
with only one line for each thing to be appended:

highway=* {
	set fullname='';
	set fullname='${ref}';
	set fullname='${fullname} ${name}';
	set fullname='${fullname} ${name1}';
	set fullname='${fullname} ${name2}';
	name '${fullname}';
}

But I see that didn't work because of a bug.  That is now fixed and
so the example will build up a string with spaces only where needed.
The only problem would be that if ref doesn't exist, then there
will be a space at the start.  I can't see a way around this
at the moment, but we could add something for that.

..Steve



More information about the mkgmap-dev mailing list