rapideditor / country-coder

📍➡️ 🇩🇰 Convert longitude-latitude pairs to ISO 3166-1 codes quickly and locally
https://ideditor.codes
ISC License
220 stars 17 forks source link

Northen Cyprus' ISO code #121

Open AlexPerathoner opened 1 year ago

AlexPerathoner commented 1 year ago

Currently, any request with coordinates pointing to Northen Cyprus, returns no country code.

Its entry in borders.json does indeed have no codes specified:

{
   "type":"Feature",
   "properties":{
      "wikidata":"Q23681",
      "nameEn":"Northern Cyprus",
      "groups":[
         "Q644636",
         "145",
         "142"
      ],
      "driveSide":"left",
      "callingCodes":[
         "90 392"
      ]
   },
    ...
},

However, even though the Turkish Republic of Northern Cypr is politically separated from Cyprus (Republic of Cyprus), it should share the same country code CY. Here's why:

bhousel commented 12 months ago

Just wanted to follow up on this.. I spent way more time on this today than I'd like to admit, but I'm really struggling with how groups work, and the giant borders.json file is not easy to work with, so I wasn't able to make this happen. I might come back to it later or just rewrite things to be easier for me to understand if I get some time.

(I added some tests to the test suite that we can adjust once we're able to get the code to return different results here.)

petrospap commented 11 months ago

Hello, I was looking for some kind of script to get country names from coordinates and find yours. Seems like you have done serious work here! Unfortunately, some data are not correct and this is the reason that I cannot use this script, until fixed.

There NO country with name “Northern Cyprus"

Same issues in other projects have fixed. i.e., https://github.com/openlayers/openlayers/issues/12940