This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Not correct content of ’name:en’ column

0

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

Bobinho
11224
accept rate: 0%


One Answer:

3

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.

answered 25 Feb '16, 11:12

SK53's gravatar image

SK53 ♦
28.1k48268433
accept rate: 22%

1

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

Source code available on GitHub .