The below 2 links return slightly different results. At zoom level 10 country code is returned "SN" and country name goes along with it ("Senegal"):

At zoom level 18, when it supposed to be a more accurate result, it returns country code only "SN" What is odd, is that having country code, it is basically the same information for the country name.

I understand that those are different "place ids" and "osm ids" and "osm types", but still doesn't seem correct to me.

Any suggestions on how to address it would be appreciated.

asked 05 Jun '18, 18:02

Taras%20O's gravatar image

Taras O
accept rate: 0%

I am not an expert on Nominatim but as nobody else has answered...

Maybe it is related to the fact that the zoom 18 result is for a way (road) that is partly outside Senegal - see

Moving the lat/lon slightly so that it is closer to a way that is entirely inside Senegal seems to return the country name, e.g.

That doesn't really explain the difference between country name and country code though.

permanent link

answered 06 Jun '18, 09:57

alan_gr's gravatar image

accept rate: 14%


You're right. In Nominatim every map feature is assigned exactly one country_code during import and data updates. It's tricky (and a limitation of Nominatim) when roads cross country borders. In this case the correct country_code is returned at least. But the road is not completely inside Senegal so the spatial query looking for administrative boundaries sees the country (gray-ed on but doesn't consider it part of the address. It doesn't happen with a nearby road that doesn't cross the border Usually the recommendation is to split the OSM way at the country border. For an unnamed road and since the correct country(code) was assigned I'd say an unnecessary work-around. See also

(06 Jun '18, 12:08) mtmail

Thank you alan_gr and mtmail! That explains it.

(06 Jun '18, 20:15) Taras O

I actually just discovered something else. I have an older OSM version running on an internal server (2.x) and it returns the JSON for the same query (zoom 18):

{"place_id":"128323717","licence":"Data © OpenStreetMap contributors, ODbL 1.0. http:\/\/\/copyright","osm_type":"way","osm_id":"301447252","lat":"13.28023","lon":"-15.6339599","place_rank":"26","category":"highway","type":"track","importance":"0.1","addresstype":"road","display_name":"Saré Alkaly - Boghal - Ndiamacouta, Ndiamacouta (Chef lieu de commune), Arrondissement de Bounkiling, Sédhiou, Sédhiou Region, Senegal","name":"Saré Alkaly - Boghal - Ndiamacouta","address":{"road":"Saré Alkaly - Boghal - Ndiamacouta","village":"Ndiamacouta (Chef lieu de commune)","county":"Arrondissement de Bounkiling","state":"Sédhiou","country":"Senegal","country_code":"sn"}}

However, the OSM id seems to be different.

(06 Jun '18, 20:53) Taras O
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 05 Jun '18, 18:02

question was seen: 2,030 times

last updated: 06 Jun '18, 20:53

powered by OSQA