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

Hi,

We would like to render our own map tiles for an iOS app in an offline mode. The main motivation for rendering our own map tiles is to have street labels in both local language and English. The app is now using map tiles from Cloudmade with street labels in local language by default. I have a few questions.

  1. Is it possible to render map with street labels in more than one language? In our case we want the street lable to be local language + English.
  2. What tools should I use? I have heard about Mapnik and TileMill, but don't know much about them. Are they the right tools for this and are there other tools that I should also investigate?
  3. For a few large cities (mostly in Asia) where few street names are in English, we would like to translate the names of major streets into English on our own before we do the map rendering. How can this be done?

Thank you.

asked 18 Mar '14, 13:19

jwt8070's gravatar image

jwt8070
16111
accept rate: 0%

3

Forgetting about the technicalities for a second.

The language tags are for non-local language names that are in use for the road, something which is rather rare (for roads). Please do not add "translations" of street names to OSM, in general they will simply be nonsense.

(18 Mar '14, 15:10) SimonPoole ♦

Carto/Mapnik style sheets for use with OSM - whether in TileMill or a standalone rendering server as described on switch2osm.org - depend on a database from where they load their data from. In one of the style config files you'll find SQL SELECT queries for that. These can be modified to take other names into account, e.g. instead of

SELECT name, ...

you would write (a very simplistic approach)

SELECT name || ' (' || "name:en" || ')' AS name, ...

This would then put the English name in parentheses. More complex queries - that only insert parentheses where an English name is present, or where it is present and different from the local name, or somesuch - are just a matter of more SQL.

For this to work, your database must of course have the name:en column, which you would request when running osm2pgsql to populate it, either by creating a proper style file or by using "hstore" (the above query would then use tags->'name:en' instead of just name:en).

Since SQL queries are used, you could trivially also retrieve a translation of the name from a different table by joining that into the query.

Of course it would be even better if you just added the appropriate name:en tags into OpenStreetMap!

permanent link

answered 18 Mar '14, 14:43

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

As a quick and dirty solution to the "languages" part of the problem, I'd do the same as I suggested in a previous answer to a different question - use a lua script to combine the names any way that you want, and use the standard openstreetmap-carto stylesheet (modified with TileMill if you prefer) to render tiles. You can, of course use a different stylesheet, or create your own.

Another thought might be not to restrict yourself to tiles. I'm aware of at least one iOS renderer project (OpenStreetPad), although it's not been updated for a while.

permanent link

answered 18 Mar '14, 13:35

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

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:

×710
×63
×36
×13

question asked: 18 Mar '14, 13:19

question was seen: 12,858 times

last updated: 18 Mar '14, 15:30

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