Hi all, I need generate tiles for my country(Armenia) and all names comes out in native Armenian language. Is there a way to translit it to English? I want to make offline map app for foreigners and thus need latin char names in map.... Can you hint how to setup the osm.xml or other config file to get all street names in english

asked 16 Sep '11, 09:10

Gevork's gravatar image

Gevork
189121319
accept rate: 0%


I am not familiar with the Armenian language and whether or not there is a potential automatic transliteration into English. If there is, then that transliteration could be implemented as a PostgreSQL stored procedure, and in the Mapnik style file you could then write

select my_transliteration_procedure(name), ... other fields ...

wherever it now says

select name, ... other fields ...

If, on the other hand, you are not looking for an automatic transliteration but only want the English names displayed where they have been explicitly entered as name:en tags in OpenStreetMap, then you need to modify the osm2pgsql style file (usually called default.style) and add a column for the name:en tag so that it ends up in your database; and after that you can modify the Mapnik style file to use something like

select case when "name:en" is not null then "name:en" else "name", ... other fields ...

Of course if all you want is a one-off set of tiles then you can also leave the Mapnik style unchanged and run something like

update planet_osm_xxx set name="name:en" where "name:en" is not null;

on the tables generated by osm2pgsql.

permanent link

answered 16 Sep '11, 09:28

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
70.9k836431106
accept rate: 24%

@Frederik Ramm you are my star :)))) Thanks a lot

(16 Sep '11, 10:06) Gevork

Be carefull when transliterating (and translating words like "street"). You probably want to do a manual check of the result before contributing the "name:en" tag to the main OSM db. At least working inside postgres might be handyer than working via the api, depending on what you're used to.

Once you have the tag in the db of course, just change the mapnik style and you're good to go.

(16 Sep '11, 10:54) Vincent de P... ♦

@vincent de phily @Frederik Ramm I have managed to change default.style and now name:en is going to db. BUT! I couldn't find Mapnik style file and didn't fully understood how exactly change it... Could you help out???

(25 Sep '11, 17:26) Gevork

@Frederik Ramm I was able to get English names to come up for high zoom level objects like roads and buildings using your steps above but it seems like city and country names are using their native alphabet still. Do you have any idea on what might be the issue?

I am using Thailand as a test. I thought perhaps the country and city objects didn't have a "name:en" tag, however it seemed unlikely to me that streets in Bangkok, Thailand would have english names added, but the country and city itself would not.

For updating the tables, I listed all tables in my postgis database and then ran your update command for all tables that matched the pattern planet_osm_xxx.

Thanks in advance for any help.

(05 Oct '18, 20:22) coderunner

Is it possible that you simply have the low-zoom tiles cached, so that you are still seeing tiles from before you made the style change? You could clear your cache with something like rm -rf /var/lib/mod_tile/* or you could use the /dirty suffix on a tile.png request to have that tile re-rendered.

(05 Oct '18, 20:34) Frederik Ramm ♦

@Frederik Ramm Ah! Yes you are right. I am using a custom piece of software for rendering and forgot I am caching zoom 0 to 12 and not re-rendering them. That fixed it. Thanks for your help!

Also, I noticed you also commented on my question here:

https://help.openstreetmap.org/questions/66165/openstreetmap-carto-english-names

mentioning that the German fork of osm-carto is the best solution. Are there any major shortcomings to doing it the way I have here versus using the fork?

(05 Oct '18, 23:19) coderunner
showing 5 of 6 show 1 more comments

I have edited the default.style and have made following sql statements

update planet_osm_line set name="name:en" where "name:en" is not null; update planet_osm_point set name="name:en" where "name:en" is not null; update planet_osm_polygon set name="name:en" where "name:en" is not null; update planet_osm_roads set name="name:en" where "name:en" is not null;

thanks to @Fredrik Ramm

permanent link

answered 12 Apr '14, 16:28

Gevork's gravatar image

Gevork
189121319
accept rate: 0%

https://help.openstreetmap.org/questions/66165/openstreetmap-carto-english-names is a similar question with more up-to-date answers.

permanent link

answered 05 Oct '18, 20:32

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
70.9k836431106
accept rate: 24%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×312
×19

question asked: 16 Sep '11, 09:10

question was seen: 6,848 times

last updated: 05 Oct '18, 23:19

powered by OSQA