This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

OSM tag to human readable label

1

How can I lookup a human readable label in different languages for a OSM tag?

I.e. for amenity=charging_station it should give "electric vehicle charging station".

asked 17 Dec '19, 20:43

AddisMap_Alexander's gravatar image

AddisMap_Ale...
1.1k314062
accept rate: 0%


4 Answers:

6

"Taginfo" compiles data from the OSM wiki into an SQLite database which can be downloaded here: https://taginfo.openstreetmap.org/download

answered 17 Dec '19, 22:33

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

3

You could use a Wikidata query

SELECT ?item ?itemLabel 
WHERE 
{
  ?item wdt:P1282 'Tag:amenity=charging_station'.

    SERVICE wikibase:label { 
        bd:serviceParam wikibase:language "en"
    }
}

answered 17 Dec '19, 20:44

AddisMap_Alexander's gravatar image

AddisMap_Ale...
1.1k314062
accept rate: 0%

edited 17 Dec '19, 20:45

2

Nominatim has a list of special phrases for various POIs in multiple languages, for example English. You can download the page content in plain text using the Mediawiki API:

https://wiki.openstreetmap.org/w/api.php?action=query&prop=revisions&rvprop=content&format=json&titles=Nominatim/Special_Phrases/EN

answered 18 Dec '19, 08:13

scai's gravatar image

scai ♦
33.3k21309459
accept rate: 23%

edited 18 Dec '19, 08:17

https://github.com/openstreetmap/Nominatim/blob/master/utils/specialphrases.php also downloads and parses the tables if you're fluent in PHP.

(18 Dec '19, 12:43) mtmail

1

This is actually not as simple as the other answers imply.

The problem is that there can be a, in principle unbounded, number of tags that define a specific real world object. It isn't even guaranteed that there is some hierarchical structure in the tag use. So expecting to get a meaningful plain text name from a single "top level" tag isn't going to work particularly well.

answered 18 Dec '19, 19:22

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

Source code available on GitHub .