Command to transliterate Characters/Cyrillic/Greek into latin1 even for Unicode maps?

The standard behavior so far for my maps in Japan or China was to use --latin1, and hope that all towns/cities/names if not name:en present - got transliterated decently into latin characters. However if using Unicode this is of course not happening. Could there be a command like {set name='${mkgmap:trans:name}' } That way one could build a map that is usable for people who do understand the local script/language, and who don't by setting all names e.g. name=('name:en|name:int|mkgmap:trans:name''(name in e.g. Japanese Script) ' Even better would of course be if there would be an additional function to check if "name" is already in two scripts - this is often the case for Japan or Thailand or Singapore... Dunno if that is easy to implement. I hope/guess the above /mkgmap:trans:name/ would be easy, as the code exists if you use e.g. --latin1. -- keep on biking and discovering new trails Felix openmtbmap.org & www.velomap.org

Push Up! After using unicode maps for some more time, I think this is really important. Especially for older devices which will only show a subset of latin1 characters present in unicode. I would like to make sure to have the possibility to use transliteration even for unicode maps. Case Object 1: name:en=moscow name=?????? Case Object 2: name=?????? Rules: name:en=* & name=* {set name='${name:en}' '${name}'} name:en!=* & name=* {set name='${mkgmap:translatin:name}' '${name}'} where mkgmap:translatin:name tells mkgamp to try to transliterate the name to latin.. Of course it would be even better if there could be a rule like name:en!=* & name=* & name!=mkgmap:latin - so mkgmap would check if the script is latin, and if not pass on to the next line. But even the simple rule without check would be a great help. On 02.07.2014 22:27, Felix Hartmann wrote:
The standard behavior so far for my maps in Japan or China was to use --latin1, and hope that all towns/cities/names if not name:en present - got transliterated decently into latin characters. However if using Unicode this is of course not happening.
Could there be a command like {set name='${mkgmap:trans:name}' } That way one could build a map that is usable for people who do understand the local script/language, and who don't by setting all names e.g. name=('name:en|name:int|mkgmap:trans:name''(name in e.g. Japanese Script) '
Even better would of course be if there would be an additional function to check if "name" is already in two scripts - this is often the case for Japan or Thailand or Singapore... Dunno if that is easy to implement. I hope/guess the above /mkgmap:trans:name/ would be easy, as the code exists if you use e.g. --latin1. -- keep on biking and discovering new trails
Felix openmtbmap.org &www.velomap.org

Hi, once upon a time I asked for similar feature too. I support Felix with this request. Unicode would be a perfect solution for maps, unfortunately I'm afraid Garmin has made Unicode unavailable for 3-rd party compilers. As I understand, new Garmin devices require Unicode maps to be digitally signed by Garmin. New devices mean for example GPSMAP 64, Egde 1000, nuvi 2014 Essential Line, probably Garmin viago too. -- Best regards, Andrzej

Well I still hope they take that out. For Edge 1000 it was not introduced at the start, but came with later firmware updates. For other devices however on newest firmware they are still read in fine.. On 8 August 2014 15:11, Andrzej Popowski <popej@poczta.onet.pl> wrote:
Hi,
once upon a time I asked for similar feature too. I support Felix with this request.
Unicode would be a perfect solution for maps, unfortunately I'm afraid Garmin has made Unicode unavailable for 3-rd party compilers. As I understand, new Garmin devices require Unicode maps to be digitally signed by Garmin. New devices mean for example GPSMAP 64, Egde 1000, nuvi 2014 Essential Line, probably Garmin viago too.
-- Best regards, Andrzej _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- Felix Hartman - Openmtbmap.org & VeloMap.org Floragasse 9/11 1040 Wien Austria - Österreich

Hi Felix
Could there be a command like {set name='${mkgmap:trans:name}' } That way one could build a map that is usable for people who do understand the local script/language, and who don't by setting all names e.g. name=('name:en|name:int|mkgmap:trans:name''(name in e.g. Japanese Script) '
A quick patch attached which is a first attempt at such a thing. Usage: ${name|ascii:} ${name|latin1:} You need the colon there at the moment, but I will fix that if we go with this syntax. An alternative syntax could be: ${name|transliterate:ascii}
Even better would of course be if there would be an additional function to check if "name" is already in two scripts - this is often the case for Japan or Thailand or Singapore... Dunno if that is easy to implement. I hope/guess the above /mkgmap:trans:name/ would be easy, as the code exists if you use e.g. --latin1.
-- keep on biking and discovering new trails
Felix openmtbmap.org &www.velomap.org
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Steve, thanks a lot for the patch. I'm gonna try it out today. Haven't found time yet so far and it will require a fair bit of rewriting my style to make it useful. the notation is fine with me. Doesn't need to be simple, as one can use it to define intermediary keys.. On 11.08.2014 23:26, Steve Ratcliffe wrote:
Hi Felix
Could there be a command like {set name='${mkgmap:trans:name}' } That way one could build a map that is usable for people who do understand the local script/language, and who don't by setting all names e.g. name=('name:en|name:int|mkgmap:trans:name''(name in e.g. Japanese Script) '
A quick patch attached which is a first attempt at such a thing.
Usage:
${name|ascii:} ${name|latin1:}
You need the colon there at the moment, but I will fix that if we go with this syntax. An alternative syntax could be: ${name|transliterate:ascii}
Even better would of course be if there would be an additional function to check if "name" is already in two scripts - this is often the case for Japan or Thailand or Singapore... Dunno if that is easy to implement. I hope/guess the above /mkgmap:trans:name/ would be easy, as the code exists if you use e.g. --latin1.
-- keep on biking and discovering new trails
Felix openmtbmap.org &www.velomap.org
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- keep on biking and discovering new trails Felix openmtbmap.org & www.velomap.org

Am I doing something wrong? name:int!=* & name=* {set name='${name|ascii:} ${name}' However for Syria or Greece I don't see any change. Is my command wrong, or is there maybe a bug in the patch?... On 11.08.2014 23:26, Steve Ratcliffe wrote:
Hi Felix
Could there be a command like {set name='${mkgmap:trans:name}' } That way one could build a map that is usable for people who do understand the local script/language, and who don't by setting all names e.g. name=('name:en|name:int|mkgmap:trans:name''(name in e.g. Japanese Script) '
A quick patch attached which is a first attempt at such a thing.
Usage:
${name|ascii:} ${name|latin1:}
You need the colon there at the moment, but I will fix that if we go with this syntax. An alternative syntax could be: ${name|transliterate:ascii}
Even better would of course be if there would be an additional function to check if "name" is already in two scripts - this is often the case for Japan or Thailand or Singapore... Dunno if that is easy to implement. I hope/guess the above /mkgmap:trans:name/ would be easy, as the code exists if you use e.g. --latin1.
-- keep on biking and discovering new trails
Felix openmtbmap.org &www.velomap.org
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- keep on biking and discovering new trails Felix openmtbmap.org & www.velomap.org

ups, that was just a typo in the email, not in my style... Would be cool if you could check later. On 14.08.2014 13:24, Steve Ratcliffe wrote:
On 13/08/14 15:40, Felix Hartmann wrote:
Am I doing something wrong?
name:int!=* & name=* {set name='${name|ascii:} ${name}'
Apart from the missing close '}' it looks OK to me.
I can investigate more later.
..Steve
-- keep on biking and discovering new trails Felix openmtbmap.org & www.velomap.org

Any News Steve or Andrzej? Is the patch actually working for you? On 14 August 2014 13:34, Felix Hartmann <extremecarver@gmail.com> wrote:
ups, that was just a typo in the email, not in my style...
Would be cool if you could check later.
On 14.08.2014 13:24, Steve Ratcliffe wrote:
On 13/08/14 15:40, Felix Hartmann wrote:
Am I doing something wrong?
name:int!=* & name=* {set name='${name|ascii:} ${name}'
Apart from the missing close '}' it looks OK to me.
I can investigate more later.
..Steve
-- keep on biking and discovering new trails
Felix openmtbmap.org & www.velomap.org
-- Felix Hartman - Openmtbmap.org & VeloMap.org Floragasse 9/11 1040 Wien Austria - Österreich

Hi Yes, I have created a map of Greece with the patch and your rule inserted just before the <finalize> in the lines file. It seems to work as expected. ..Steve On 19/08/14 18:31, Felix Hartmann wrote:
Any News Steve or Andrzej? Is the patch actually working for you?
On 14 August 2014 13:34, Felix Hartmann <extremecarver@gmail.com <mailto:extremecarver@gmail.com>> wrote:
ups, that was just a typo in the email, not in my style...
Would be cool if you could check later.
On 14.08.2014 13:24, Steve Ratcliffe wrote:
On 13/08/14 15:40, Felix Hartmann wrote:
Am I doing something wrong?
name:int!=* & name=* {set name='${name|ascii:} ${name}'
Apart from the missing close '}' it looks OK to me.
I can investigate more later.
..Steve
-- keep on biking and discovering new trails
Felix openmtbmap.org <http://openmtbmap.org> & www.velomap.org <http://www.velomap.org>
-- Felix Hartman - Openmtbmap.org & VeloMap.org Floragasse 9/11 1040 Wien Austria - Österreich
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi everyone, okay - I found the problem now.... Is it possible that the command: mkgmap:country ~ '(GRC)' is not working properly for lines that are no address. So for simple streetlabels to be shown - it seems to me that "mkgmap:country~" is not properly read in from the boundaries file. Or the boundaries for Greece and for example Taiwan are not good at all (but it seems to work without problems for points!). So if I create the map like: /mkgmap:country ~ '(GRC)' & name:int!=* & name=* {set name='${name|ascii:} ${name}'}/ I end up with the nearly no street name transliterated. While if I simply use: /name:int!=* & name=* {set name='${name|ascii:} ${name}'}/ then it works as expected... Could it be that the mkgmap:country tag is only read in under certain rules, but not generally for all objects? My current solution would be to just skip using the mkgmap:country command - and instead using a file in /inc folder that is changed depending on country (and anyhow not use unicode for maps spanning several countries like continents). That's not a big problem... On 21.08.2014 23:55, Steve Ratcliffe wrote:
Hi
Yes, I have created a map of Greece with the patch and your rule inserted just before the <finalize> in the lines file.
It seems to work as expected.
..Steve
On 19/08/14 18:31, Felix Hartmann wrote:
Any News Steve or Andrzej? Is the patch actually working for you?
On 14 August 2014 13:34, Felix Hartmann <extremecarver@gmail.com <mailto:extremecarver@gmail.com>> wrote:
ups, that was just a typo in the email, not in my style...
Would be cool if you could check later.
On 14.08.2014 13:24, Steve Ratcliffe wrote:
On 13/08/14 15:40, Felix Hartmann wrote:
Am I doing something wrong?
name:int!=* & name=* {set name='${name|ascii:} ${name}'
Apart from the missing close '}' it looks OK to me.
I can investigate more later.
..Steve
-- keep on biking and discovering new trails
Felix openmtbmap.org <http://openmtbmap.org> & www.velomap.org <http://www.velomap.org>
-- Felix Hartman - Openmtbmap.org & VeloMap.org Floragasse 9/11 1040 Wien Austria - Österreich
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- keep on biking and discovering new trails Felix openmtbmap.org & www.velomap.org

Hi Felix
Is it possible that the command: mkgmap:country ~ '(GRC)'
is not working properly for lines that are no address.
That rule only matches if mkgmap:country is exactly: GRC If you want to match literal parenthesis you need '\(GRC\)' and since the pattern has to match the whole name you maybe want something like this: '.*\(GRC\).*' As we discussed before, I think it would make sense to allow the match to occur anywhere in the string. ..Steve
participants (3)
-
Andrzej Popowski
-
Felix Hartmann
-
Steve Ratcliffe