Hello everyone.

I have installed my own osm tile server. I osmcarto style and mapnik for rendering tiles.

Now I want to add English names to the city, that are not in English. For example: from Chineese to English and Chineese.

I know, that I need to create 'name:en' column to take english names from there.

For import I use osm2psql tool and there command is:

osm2pgsql -z 'name:en' -c --slim -d gis -C 1600 --number-processes 2 /path/to/file.

After import I have ""=>"Saint Petersburg" in 'name:en' column instead of Saint Petersburg.

If I use '-k' key while importing, I will get tags column with the following content:

"ref:en"=>"SPE", "ref:ru"=>"СПБ", "name:ab"=>"Санқт-Петербург", "name:de"=>"Sankt Petersburg", "name:en"=>"Saint Petersburg", "name:os"=>"Бетъырбух", "name:ru"=>"Санкт-Петербург", "wikipedia"=>"ru:Санкт-Петербург", "okato:user"=>"40000000000", "official_status"=>"ru:город федерального значения"

So, why in name:en column I've got some extra symbols?

And where I should make changes to see the both city names?

Thanks for help!

asked 25 Feb '16, 10:40

Bobinho's gravatar image

accept rate: 0%

You appear to have misunderstood the -z flag. This merely allows one to rename the (or create an additional) hstore column. It does not add the requested tag. So what you are seeing is the raw hstore data (all tags as key=>value pairs).

To achieve what you want it is necessary to edit the style files used by osm2pgsql. Normally you will use default.style (see here https://github.com/openstreetmap/osm2pgsql/blob/master/default.style), and modify this to add an extra line similar to the one for "name" replacing "name" with "name:en".

It is probably best to create this as a distinct style and apply it using the -S flag when you execute osm2pgsql.

permanent link

answered 25 Feb '16, 11:12

SK53's gravatar image

SK53 ♦
accept rate: 20%


Thank you! After using -S flag "name:en" column is correct. Where else I should make changes to display both city names like: Zürich (Zurich)?

(25 Feb '16, 11:44) Bobinho
Your answer
toggle preview

Follow this question

By Email:

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



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:


question asked: 25 Feb '16, 10:40

question was seen: 1,495 times

last updated: 25 Feb '16, 11:44

powered by OSQA