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 Perrin |
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. answered 07 Apr '12, 20:48 ChrisH |
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. answered 07 Apr '12, 20:54 Gnonthgol ♦ 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
|