NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I'm working on a project where on a road/highway segment, I want to show the name of the road in English as well as the name of the road in the native language. I'm working in XML (mapnik stylesheets) and I found the location where the labels are being added, but when I try to add multiple labels, only one of the labels displays. Is there a way to do this?

asked 24 Nov '15, 14:29

bddavidson's gravatar image

bddavidson
1613411
accept rate: 100%

edited 29 Nov '15, 17:21

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554

I think we have a very similar question here on this help site - but I could not find it.

(29 Nov '15, 16:43) aseerel4c26 ♦

I was able to figure it out. On ingest, if you add an hstore column, it will add all the tags as key/value pairs. I was able to then edit the query slightly to include the native language name as well as the english name.

SQL query update:

select way,highway,name,(tags -> 'name:en') as my_column <-- Add this piece
   from &prefix;_line
   where waterway IS NULL
     and leisure IS NULL
     and landuse IS NULL
     and tags is not null //Also add this line
     and name is not null

Styling (TextSymbolizer):

<>size="9" fill="black" placement="line" fontset-name="book-fonts" halo-radius="1" halo-fill="#fed7a5">[name] + ' ' + [my_column]<>
permanent link

answered 01 Dec '15, 18:56

bddavidson's gravatar image

bddavidson
1613411
accept rate: 100%

2

Hope you don't mind me accepting your own answer for you as the help site won't let you do it yourself :)

(01 Dec '15, 18:58) SomeoneElse ♦

I was wondering about that. Thanks!

(01 Dec '15, 19:07) bddavidson

Have a first look in the OSM wiki about Map_internationalization ...

there is at least one example where names (of places) are displayed in native language and in English below.

Try to get in contact to the maintainer of those server.

permanent link

answered 29 Nov '15, 16:01

stephan75's gravatar image

stephan75
12.6k556210
accept rate: 6%

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:

×341
×86
×63
×16

question asked: 24 Nov '15, 14:29

question was seen: 4,907 times

last updated: 01 Dec '15, 19:07

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum