[OSM-talk] Transcription and 'internationalization' in place names
Stephan Knauss
osm at stephans-server.de
Tue Apr 17 02:17:15 BST 2012
Andrew Errington writes:
> In Korea it is most useful (to Koreans and visitors) if we carry on as we
> do, but I would like a tool that automatically constructs
> name="name:ko+<space>+(+name:en+)"
It is for map rendering. So the renderer should construct this.
Good news is that Mapnik doe not need to be modified for this. It is just a
modified query in the database.
For the bilingual map of Thailand (and Laos, Cambodia, Vietnam) I did add a
view to the database. That way I did not need to modify the style-file
which makes it a lot easier to keep in sync with upstream.
That view will return a custom string whenever mapnik asks for a name to
put on the map.
In this case it will construct the bilingual name (if available) including
a fallback in case no bilingual tagging is available:
case when (tags ? 'name:en') then case when (name != (tags->'name:en'))
then name || ' ' || (tags->'name:en') else tags->'name:en' end else name
end AS name,
As the name tag already contains the name in the local language no special
handling is needed for this.
In case you want to implement different rules for the name based on
geographic boundaries you could replace the simple logic above with a piece
of pgsql whick does the construction based on bounding box checks.
You could also construct the bilingual label at the time of database import
and store it in a separate column. Either by a modified import or using a
trigger on the database.
Stephan
>
> Best wishes,
>
> Andrew
>
>
> _______________________________________________
> talk mailing list
> talk at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/talk
More information about the talk
mailing list