Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

country_code of Kosovo: rs vs xk #567

Closed
muratia opened this issue Oct 28, 2016 · 11 comments
Closed

country_code of Kosovo: rs vs xk #567

muratia opened this issue Oct 28, 2016 · 11 comments

Comments

@muratia
Copy link

muratia commented Oct 28, 2016

http://nominatim.openstreetmap.org/search?q=Gjilan&format=json&polygon=0&addressdetails=1

[{"place_id":"1244873","licence":"Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright","osm_type":"node","osm_id":"299448609","boundingbox":["42.3034051","42.6234051","21.308409","21.628409"],"lat":"42.4634051","lon":"21.468409","display_name":"Gjilan, Komuna e Gjilanit, Kosova","class":"place","type":"city","importance":0.57239695346006,"icon":"http://nominatim.openstreetmap.org/images/mapicons/poi_place_city.p.20.png","address":{"city":"Gjilan","county":"Komuna e Gjilanit","country":"Kosova","country_code":"rs"}},{"place_id":"74039569","licence":"Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright","osm_type":"way","osm_id":"38167080","boundingbox":["42.4616075","42.462677","21.468622","21.4704886"],"lat":"42.4622523","lon":"21.4696809","display_name":"Xhemë Tupalla, Gjilan, Komuna e Gjilanit, 60000, Kosova","class":"highway","type":"residential","importance":0.21,"address":{"road":"Xhemë Tupalla","city":"Gjilan","county":"Komuna e Gjilanit","postcode":"60000","country":"Kosova","country_code":"rs"}},{"place_id":"12931878","licence":"Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright","osm_type":"node","osm_id":"1222862561","boundingbox":["42.6306937","42.6307937","21.1499652","21.1500652"],"lat":"42.6307437","lon":"21.1500152","display_name":"Gjilan, Rrafshi i Kosovës, Lagja NIC, Чаглавица, Komuna e Prishtinës, 38000, Kosova","class":"highway","type":"motorway_junction","importance":0.111,"address":{"junction":"Gjilan","road":"Rrafshi i Kosovës","suburb":"Lagja NIC","village":"Чаглавица","county":"Komuna e Prishtinës","postcode":"38000","country":"Kosova","country_code":"rs"}}]

This is the JSON returned form the link
But Country code is "rs" while it should be "xk".

@mtmail
Copy link
Collaborator

mtmail commented Oct 29, 2016

I'm changing the title as 'found incorrect data' isn't precise enough.

@mtmail mtmail changed the title By looking for a road or city I found incorrect data country_code of Kosovo: rs vs xk Oct 29, 2016
@muratia
Copy link
Author

muratia commented Oct 29, 2016

OK

@SomeoneElseOSM
Copy link

If it helps, here's what I saw when I looked at Kosovo a week or so ago:
Here's Kosovo in OSM:

http://www.openstreetmap.org/relation/2088990#map=8/42.567/20.901

http://osm.mapki.com/history/relation.php?id=2088990

There's no "RS" anywhere there. The "rs" that appears greyed-out at http://nominatim.openstreetmap.org/details.php?place_id=159334847 I've always interpreted as "somewhere nearby" (but I'm no Nominatim expert, obviously).

The Kosovo relation has:
ISO3166-1:alpha2 XK
ISO3166-1:alpha3 XXK

and the Serbia relation has:
ISO3166-1 RS
ISO3166-1:alpha2 RS
ISO3166-1:alpha3 SRB
ISO3166-1:numeric 688

So is it possible that a missing "ISO3166-1" for Kosovo is the problem?

@lonvia
Copy link
Member

lonvia commented Nov 4, 2016

Kosovo currently isn't in Nominatim's base country table. This table has been generated manually and needs to be redone at some point.

@muratia
Copy link
Author

muratia commented Nov 4, 2016

I am a software developer with lot of background in databases.

From: Sarah Hoffmann [mailto:notifications@github.com]
Sent: Friday, November 4, 2016 3:21 PM
To: twain47/Nominatim Nominatim@noreply.github.com
Cc: muratia ahmet.murati@live.com; Author author@noreply.github.com
Subject: Re: [twain47/Nominatim] country_code of Kosovo: rs vs xk (#567)

Kosovo currently isn't in Nominatim's base country table https://github.com/twain47/Nominatim/blob/master/data/country_osm_grid.sql . This table has been generated manually and needs to be redone at some point.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #567 (comment) , or mute the thread https://github.com/notifications/unsubscribe-auth/AKAL9a9HoiJTJuQV3xlRGNbcplCdXK1tks5q6z8-gaJpZM4KjPhg . https://github.com/notifications/beacon/AKAL9aXzZdXoYxvlvaIYzxAP52i10qqKks5q6z8-gaJpZM4KjPhg.gif

@muratia
Copy link
Author

muratia commented Nov 4, 2016

From: Sarah Hoffmann [mailto:notifications@github.com]
Sent: Friday, November 4, 2016 3:21 PM
To: twain47/Nominatim Nominatim@noreply.github.com
Cc: muratia ahmet.murati@live.com; Author author@noreply.github.com
Subject: Re: [twain47/Nominatim] country_code of Kosovo: rs vs xk (#567)

Kosovo currently isn't in Nominatim's base country table https://github.com/twain47/Nominatim/blob/master/data/country_osm_grid.sql . This table has been generated manually and needs to be redone at some point.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #567 (comment) , or mute the thread https://github.com/notifications/unsubscribe-auth/AKAL9a9HoiJTJuQV3xlRGNbcplCdXK1tks5q6z8-gaJpZM4KjPhg . https://github.com/notifications/beacon/AKAL9aXzZdXoYxvlvaIYzxAP52i10qqKks5q6z8-gaJpZM4KjPhg.gif

I prepared but I am not sure should I get it though git and then commit so I am attaching here

Kosovo

xk "name"=>"Kosova", "name:af"=>"Kosovo", "name:am"=>"ኮሶቮ", "name:an"=>"Kosovo", "name:ar"=>"كوسوفو", "name:az"=>"Kosovo", "name:be"=>"Косава", "name:bg"=>"Косово", "name:bn"=>"কসোভো", "name:br"=>"Kosovo", "name:bs"=>"Kosovo", "name:ca"=>"Kosovo", "name:ce"=>"Косово", "name:co"=>"Kosovo", "name:cs"=>"Kosovo", "name:cv"=>"Косово ", "name:cy"=>"Kosovo", "name:da"=>"Albanien", "name:de"=>"Kosovo", "name:ee"=>"Kosovo", "name:el"=>"Κόσοβο", "name:en"=>"Kosovo", "name:eo"=>"Kosovo", "name:es"=>"Kosovo", "name:et"=>"Kosovo", "name:eu"=>"Kosovo", "name:fa"=>"کوسوو", "name:fi"=>"Kosovo", "name:fo"=>"Kosovo", "name:fr"=>"Kosovo", "name:fy"=>"Kosovo", "name:ga"=>"Cosaiv", "name:gd"=>"Cosobho", "name:gl"=>"Kosovo", "name:gn"=>"Kosovo", "name:gv"=>"Kosovo", "name:he"=>"קוסובו", "name:hi"=>"कोसोवो", "name:hr"=>"Kosovo", "name:ht"=>"Kosovo", "name:hu"=>"Koszovó", "name:hy"=>"Կոսովո", "name:id"=>"Kosovo", "name:ie"=>"Kosovo", "name:io"=>"Kosovo", "name:is"=>"Kosóvó", "name:it"=>"Kosovo", "name:ja"=>"コソボ", "name:jv"=>"Kosovo", "name:ka"=>"კოსოვო", "name:kg"=>"Kosovo", "name:kk"=>"Косово", "name:km"=>"កូសូវ៉ូ ", "name:kn"=>"ಕೊಸೊವೊ", "name:ko"=>"코소보", "name:ku"=>"Kosovo", "name:kv"=>"Косово", "name:ky"=>"Косово", "name:la"=>"Kosovia", "name:lb"=>"Kosovo", "name:li"=>"Kosovo", "name:ln"=>"Kosovo", "name:lt"=>"Kosovas", "name:lv"=>"Kosova", "name:mg"=>"Kosovo", "name:mk"=>"Косово", "name:ml"=>"കൊസോവോ", "name:mn"=>"Косово", "name:mr"=>"कोसोव्हो", "name:ms"=>"Kosovo", "name:mt"=>"Kosovo", "name:na"=>"Kosovo", "name:ne"=>"कोसोभो", "name:nl"=>"Kosovo", "name:nn"=>"Kosovo", "name:no"=>"Kosovo", "name:oc"=>"Kosova", "name:os"=>"Kосово", "name:pl"=>"Kosowo", "name:ps"=>"کوسوو", "name:pt"=>"Kosovo", "name:qu"=>"Kusuwu", "name:rm"=>"Cosovo", "name:ro"=>"Kosovo", "name:ru"=>"Косово", "name:sc"=>"Kòssovu", "name:se"=>"Kosovo", "name:sh"=>"Kosovo", "name:sk"=>"Kosovo", "name:sl"=>"Kosovo", "name:sq"=>"Kosova", "name:sr"=>"Косово", "name:su"=>"Kosovo", "name:sv"=>"Kosovo", "name:sw"=>"Kosovo", "name:ta"=>"கொசோவோ", "name:te"=>"కొసావో", "name:tg"=>"Косово", "name:th"=>"โคโซโว", "name:tl"=>"Kosovo", "name:tr"=>"Kosova", "name:tt"=>"Косово", "name:uk"=>"Косово", "name:ur"=>"کوسوو", "name:uz"=>"Kosovo", "name:vi"=>"Kosovo", "name:wo"=>"Kosovo", "name:yi"=>"קאָסאָווע", "name:yo"=>"Kósófò", "name:zh"=>"科索沃", "name:ace"=>"Kosovo", "name:als"=>"Kosova", "name:ang"=>"Kosovo", "name:arz"=>"كوسوڤو", "name:ast"=>"Kosovo", "name:bar"=>"Kosovo", "name:bcl"=>"Kosobo", "name:ceb"=>"Kosovo", "name:chr"=>"ᎪᏗᏉ", "name:crh"=>"Kosovo", "name:csb"=>"Kosovo", "name:diq"=>"Kosova", "name:dsb"=>"Kosowo", "name:eml"=>"Kosovo", "name:ext"=>"Cosovu", "name:frp"=>"Kosovo", "name:haw"=>"Kosowo", "name:hsb"=>"Коsоvо", "name:ilo"=>"Kosovo", "name:lad"=>"Kosovo", "name:lij"=>"Kosovo", "name:lmo"=>"Kosovo", "name:mzn"=>"کوزوو", "name:nah"=>"Cosovo", "name:nds"=>"Kosovo", "name:nov"=>"Kosovo", "name:pam"=>"Kosovo", "name:pdc"=>"Kosovo", "name:pih"=>"Kosovo", "name:pms"=>"Kosovo", "name:pnb"=>"ਕੋਸੋਵੋ", "name:pnt"=>"Κόσοβο", "name:rmy"=>"Kosovo", "name:sah"=>"Косовa", "name:scn"=>"Kòssuvu", "name:sco"=>"Kosovo", "name:srn"=>"Kosovokondre", "name:stq"=>"Kosovo", "name:szl"=>"Kosowo", "name:tet"=>"Kosovo", "name:tpi"=>"Kosovo", "name:udm"=>"Косово", "name:vec"=>"Kosovo", "name:war"=>"Kosovo", "name:wuu"=>"科索沃", "name:xal"=>"Косово", "name:zea"=>"Kosovo", "name:zh_py"=>"科索沃", "name:simple"=>"Kosovo", "name:zh-yue"=>"科索沃", "name:zh_pyt"=>"科索沃", "name:bat-smg"=>"Kuosuovs", "name:fiu-vro"=>"Kosovo", "name:roa-rup"=>"Cosova", "name:be-x-old"=>"Kosovo", "official_name"=>"Republika e Kosovës", "name:zh-min-nan"=>"Kosova", "official_name:be"=>"Рэспубліка Косово", "official_name:el"=>"Δημοκρατία της Κόσοβος", "official_name:en"=>"Republic of Kosovo", "official_name:es"=>"República de Kosovo", "official_name:et"=>"Kosovo Vabariik", "official_name:fr"=>"République d'Kosovo", "official_name:ja"=>"アルバニア共和国", "official_name:lb"=>"Republik Kosovo", "official_name:pl"=>"Republika Kosovo", "official_name:pt"=>"República da Kosovo", "official_name:sk"=>"Kosovo republika", "official_name:sv"=>"Republiken Kosovo", "official_name:vi"=>"Cộng hoà Kosovo" xk 10

@lonvia
Copy link
Member

lonvia commented Jan 15, 2017

The table I was referring to contains the geometry of the country.

@muratia
Copy link
Author

muratia commented Jan 15, 2017

Currently Kosovo hasn't done demarcation with all neighbors so the Geometry can be with errors.

@SomeoneElseOSM
Copy link

@lonvia just wondering what are the next steps here? Does someone need to download and install Nominatim, figure out the format of https://github.com/twain47/Nominatim/blob/master/data/country_osm_grid.sql?raw=true , edit Serbia in there and create a new entry for Kosovo based on the existing OSM borders? If so, is there any documentation that could help with that process, and does anything else need doing to link to "new country"? Pardon my ignorance of Nominatim here; I'm aware of it only as a black box that things go into and things come out of... Presumably there are other country issues too (https://trac.openstreetmap.org/ticket/5305#ticket has been around for a while; is e.g. South Sudan a "country" in Nominatim too?).

@lonvia
Copy link
Member

lonvia commented Jan 18, 2017

To be honest, I don't know exactly (incidentally that's what's the biggest blocker for this issue at the moment). country_osm_grid contains the polygons made from OSM administrative boundaries and split into convenient squares for faster lookup. There is a script that creates the table from an existing Nominatim database. So roughly the following needs to be done:

  • import a Nominatim database (filter boundary relations with admin_level < 8 from a planet, that's sufficient)
  • update country_name table (add new countries preferably by copying data from the relevant placex entries)
  • create new country_osm_grid table using sql/country_grid.sql
  • repeat: visualize result, check for errors, fix OSM data, create new country_osm_grid
  • dump country_osm_grid and country_name tables

Note that the country_osm_grid.sql file has become a bit too large to host in a github repo, so we'll probably have to host an updated version somewhere else. So if somebody wants to take this update on, I would prefer to get a PR for country_name.sql only and have the grid table separate. Bonus points if you can also provide a visual diff between the old and the new content of country_osm_grid.

@lonvia
Copy link
Member

lonvia commented Feb 19, 2017

country_name has been updated in e77a07c. For country_osm_grid.sql we have created an updated version. Both are deployed on osm.org. We still need a place to permanently put the updated version. Progress for this is tracked on #616.

Kosovo should now appear fine in search results, so closing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants