logo separator

[mkgmap-dev] Name Substitution not correctly working

From Felix Hartmann extremecarver at gmail.com on Sat Jul 26 11:48:25 BST 2014

On 25.07.2014 17:38, Steve Ratcliffe wrote:
> Hi
>> 1. There seems to be a problem with Chinese Tonemarks...
>> e.g. on
>> http://www.openstreetmap.org/node/244080668
>> name:zh_pinyin ~ '.*Shì' { set
>> name:zh_pinyin='${name:zh_pinyin|subst:"Shì=>"}'; echo "rule working" }
> This seems to work for me.
Hmm, have you tried it out on China from Geofabrik? I copied the "Shì" 
directly from OSM in order to be sure to get it right (not sure if there 
is a difference between Chinese 4th tone and French Accent on my 
keyboard even though the look identical).

name:zh_pinyin ~ '.* Shì'  { set 
name:zh_pinyin='${name:zh_pinyin|subst:" Shì=>"}'; echo "rule XX working" }
name:zh_pinyin ~ '.* Shì'  { set 
name:zh_pinyin='${name:zh_pinyin|subst:"Shì=>"}'; echo "rule working" }
I cannot see any echo - even tough there is plenti of Shì in China in 

The rule
name:zh_pinyin ~ '.* Shì' {echo "found Shì"} is consequently also never 
outputting an echo against Geofabrik China extract...
name:zh_pinyin ~ '.*Shì' {echo "found .Shì"} neither...

I also thought I could try to just run the rule agains all 
name:zh_pinyin - but of course also to no avail..
name:zh_pinyin=*  { set name:zh_pinyin='${name:zh_pinyin|subst:" 
Shì=>"}'; echo "rule XX working" }
name:zh_pinyin=* { set name:zh_pinyin='${name:zh_pinyin|subst:"Shì=>"}'; 
echo "rule working" }
is of course giving loads of echo - but I still end up with Shì in all 
my name:zh_pinyin.. Nothing is substituted...

So clearly I have a problem with ì...
Other rules using the exactly same notation with Shi for Japan work fine 
without probs...

Could there be a bug on Windows only, if the rule works for you 
(assuming under Linux)?
Is there a possible different notation for ì that could be used? 
Unicodelookup.com gives:
0354 	236 	0xEC 	ì

But then I don't know if Chinese 4th tone is really this caracter, or 
maybe another?
Is there a possibility to use unicode character in mkgmap style file?

I also see:
hex: 00EC
but that should be similar I would guess...
>> name:zh_pinyin ~ '.*Shi' { set
>> name:zh_pinyin='${name:zh_pinyin|subst:"Shi=>"}'; echo "rule 2 
>> working" }
>> work.
> This one does not match the given node.
I know - it was  in there to make sure that maybe there is no mashing 
together of i and ì.
>> 2. How can I remove parentheses from the name?
>> name=* { set name='${name|subst:"(=>"'}
>> name=* { set name='${name|subst:")=>"'}
> Perhaps it was just a typo in your mail, but these should be:
>   name=* { set name='${name|subst:"(=>"}' }
>   name=* { set name='${name|subst:")=>"}' }
>> Is not working. Or better it gets called but I loose all characters in
>> Japanese or Chinese...
> With these corrections it does seem to remove the brackets without
> losing anything else.
Oh yeah - that was a typo in my style. Rule is working correctly now...

> ..Steve

keep on biking and discovering new trails

openmtbmap.org & www.velomap.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20140726/9108f89c/attachment.html>

More information about the mkgmap-dev mailing list