rapideditor/country-coder

Northen Cyprus' ISO code

Opened this issue · 2 comments

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:

  • There is no entry for TRNC in the ISO 3166-1
  • The entry of Cyprus contains a subitem for each of the 6 districts. 2 of these actually form TRNC:
    immagine

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.)

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., openlayers/openlayers#12940