I'm currently looking into using OSM as a replacement for Google maps. I've setup a vanilla tile-server using Postgres, Mapnik & OpenLayers, but still have one major obstacle to overcome, localisation.

I want to be able to offer a map where the user (or app) can specify which set of name translations they need. I've searched online for this, and have seen the experimental locale maps, but was wondering what i need to do to get this running on my local server.

I've looked at the imported postgres db structure and see that this has only a name it, which i assume is the default. I've used osm2pgsql to import the data, so it's presumably this step where i would need to specify which locale i would like to over-ride the default name if it exists.

If i wanted to offer maps with 4 translations, would i really need to setup 4 x full planet_osm databases, or is there a more optimal way of setting this up?

Any help much appreciated.

asked 07 Apr '12, 19:19

John%20Perrin's gravatar image

John Perrin
accept rate: 0%

You could create map tiles with no names on them. Then create overlays with the names on in each language you want to display. It would be possible to extend it too. Displaying overlays of mostly transparent tiles with names on using OpenLayers (or LeafletJS) is straightforward.

The planet_osm database could be created with osm2pgsql to have all four names in a single database and render the respective name onto the respective tile layer or overlay layer. You will need to modify the import style to include the translations you want to import.

permanent link

answered 07 Apr '12, 20:48

ChrisH's gravatar image

accept rate: 15%

You do not have to have a database for each language. You can specify the database scheme in the .style file that osm2pgsql uses. So you can have several name columns in the table, one for each language.

You can also have the lables in a transparant overlay to save the renderer having to render the same features for different languages. One example of this is at toolserver.org.

permanent link

answered 07 Apr '12, 20:54

Gnonthgol's gravatar image

Gnonthgol ♦
accept rate: 16%

Thanks, after looking into the style file on the wiki i found the following page: http://wiki.openstreetmap.org/wiki/Regionalisedmap

This mirrors what you and ChrisH are saying, i'll look into this further. Do you know if there any example mapnik style-sheets that just render names?

(07 Apr '12, 21:29) John Perrin
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: 07 Apr '12, 19:19

question was seen: 4,719 times

last updated: 07 Apr '12, 21:29

powered by OSQA