[Tagging] Country names

Peter Körner osm-lists at mazdermind.de
Thu Oct 14 15:03:04 BST 2010


Am 14.10.2010 15:56, schrieb Richard Mann:
> You can also test for the presence of "name:de" in "name", rather than
> just equality, so that if name contains (say) French/German/Flemish
> components, then you use that rather than making your own name
> (name:de) combination.

That would be:

SELECT name AS local_name,
        CASE WHEN NOT name ~* (tags->'name:en')
             THEN name || ' (' || (tags->'name:en') ||')'
             ELSE name
         END AS display_name
   FROM planet_point
  WHERE tags @> '"place"=>"country"'
    AND NOT name IS NULL
  LIMIT 10;

I'ts so simple.

Peter



More information about the Tagging mailing list