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

Is it possible to specify a language for results in reverse geocoding?

1

Hi all!

I was checking out this map creator page that uses OSM - http://developer.skobbler.de/mapcreator and I noticed there was an option to use transliteration. I was just wondering, is it possible to do this with reverse geocoding in Open Street Maps? It would just be super handy for me at the moment to specify the language results were coming back as.

Thanks Pete

asked 31 Oct '14, 23:10

Peteskiii's gravatar image

Peteskiii
46226
accept rate: 0%


2 Answers:

4

There's even a URL parameter accept_language available in case you want to override your browser's default language. This might come in handy, if you call this stuff from your own web application.

Example:

http://nominatim.openstreetmap.org/reverse?format=xml&lat=52.5487429714954&lon=-1.81602098644987&accept-language=de

http://nominatim.openstreetmap.org/reverse?format=xml&lat=52.5487429714954&lon=-1.81602098644987&accept-language=fr

answered 01 Nov '14, 12:33

mmd's gravatar image

mmd
5.7k15388
accept rate: 37%

Awesome! Thanks, that's perfect!

(01 Nov '14, 21:43) Peteskiii

3

The Nominatim geocoder honours the Accept-Language HTTP header and will return results in the requested language - only if it has been mapped of course. This has nothing to do with transliteration though, but instead just influences which name:xx tag will be used.

To see the difference, compare the output of

curl -H Accept-Language:de 'http://nominatim.openstreetmap.org/reverse?format=xml&lat=52.5487429714954&lon=-1.81602098644987'

and

curl -H Accept-Language:en 'http://nominatim.openstreetmap.org/reverse?format=xml&lat=52.5487429714954&lon=-1.81602098644987'

answered 01 Nov '14, 00:34

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Source code available on GitHub .