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

No Continent being returned for reverse geocode

1

I am wanting to return the Continent for a reverse geocode, I have used the documentation links as an example but I seem to be getting everything but the continent returned.

http://nominatim.openstreetmap.org/search/Unter%20den%20Linden%201%20Berlin?format=json&addressdetails=1&limit=1&polygon_svg=1

http://nominatim.openstreetmap.org/reverse?format=xml&lat=52.5487429714954&lon=-1.81602098644987&zoom=18&addressdetails=1

Am I doing something wrong? missing parameter?

Any help greatly appreciated.

Regards,

asked 04 May '16, 12:11

john5092563's gravatar image

john5092563
26112
accept rate: 0%


One Answer:

2

Nominatim imports the 7 continents, but only as center point. So you can search for "Europe" only and get a result back.

That means for example Europe https://www.openstreetmap.org/node/25871341 is treated as a child of Germany, not its parent.

What is the usecase you need continents for? I wanted to add those to https://geocoder.opencagedata.com/ because we use multiple geocoders and some return a continent while others (like Nominatim) don't and that's inconsistent. I would probably use a fixed country=>continent mapping though which might be incorrect for cities which are on two continents (Istanbul).

answered 04 May '16, 13:29

mtmail's gravatar image

mtmail
4.8k1574
accept rate: 27%

I guess the actual reason is that OSM has all its continents just defined as nodes, not as ways / boundary relations. I wonder what the reason for this is.

(04 May '16, 13:39) scai ♦

I think the general avoidance of super-national borders, be it continents or trade areas (European Union, NAFTA). In Taginfo all admin_level 0 or 1 I see are errors. admin_level=2 are countries.

(04 May '16, 13:57) mtmail

Source code available on GitHub .