-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
UK Cities #168
Comments
@drakodev can you please elaborate more about this issue ? |
@drakodev Thanks for the brief. Will look into it ASAP. |
@drakodev Actually there's some issue with Data.
|
I have question related to this question about United Kingdom(UK). Here I facing a problem For Example United Kindom-> England -> London -> City of London or United Kingdom-> London -> City of London which is correct I don't know. but here problem when I selected United Kingdom then in States data showing England and also City of London inside states data. No London Option Here and Showing all cities in States Data. there is some issue but I don't understand what happened here |
@drakodev the first is the correct one. |
@nigelhorne Which one? |
The current database format cannot accommodate the regions in UK. Should there maybe be another table called regions? Most countries would not have regions but some do, like UK or Italy. Alternatively we could follow Google Maps' lead and not use regions at all and just map the cities to their own states. |
I have a similar issue that is brought up in this thread. For the UK, you currently have a mix of Non-Metropolitan Counties, Metropolitan Districts, and the Boroughs of London. Our customers are reaching out because they expect to be able to use Non-Metropolitan Counties, Metropolitan Counties, and Greater London. Would it be possible to add in the options Merseyside, Greater Manshester, South Yorkshire, Tyne and Wear, West Midlands, and West Yorkshire (Metropolitan Counties) and Greater London. These articles helped my understanding: Otherwise, this is a great library and has been super helpful! |
I was expecting the
A list of GB divisions can be found here: https://en.wikipedia.org/wiki/ISO_3166-2:GB Note on that wiki page it also lists "parent subdivision" which could give some clues to resolving #290 So maybe for places that have a "parent subdivision" there could be a This way if I wanted to find places in England, I'd search: country_code === "GB" && parent_code === "ENG" But the key thing, in relation to OP, is that |
The data in this gist might be of use: https://gist.github.com/duhaime/1d6d5a8dc77c86128fcc1a05a72726c9 It has a couple of json files which map city to county, and once you have the county it should be possible to work out the ISO 3166-2 division (eg. via data on wikipedia article above). There are of course some additional data sets which might be of use, namely: https://github.com/kevinroberts/city-timezones - each city in the json includes 2 letter country code, and a province (which could be mapped to an ISO 3166-2 code I think). I've got some datasets downloaded so will try this evening to see I can generate required data for UK cities. |
@dr5hn , I was able to add valid codes for some of the Process used:
An updated city record looks something like this: {
"id": 48219,
"name": "Alfreton",
"state_id": 2336,
"state_code": "ENG",
"state_name": "England",
"country_id": 232,
"country_code": "GB",
"country_name": "United Kingdom",
"latitude": "53.09766000",
"longitude": "-1.38376000",
"wikiDataId": "Q2462661",
"region_name": "Derbyshire",
"region_code": "DBY"
}, As you can see, the two new fields are appended to the end of the original record. This approach means we can still check by country (eg. Some stats:
I could have relaxed some of the matching algos to get more, but didn't want to introduce bad data. The zip attached below is the EDIT: If it were possible to get the const iso3166_2 = `${city.country_code}-${city.region_code ?? city.state_code}` |
Just found this which might help fix up more records for UK cities, I will investigate in a few days if time permits: https://simplemaps.com/data/gb-cities |
Does anyone have a fix for UK ? as most of them cities are in "England" state instead of them right ones. |
Same here, still looking for a solution |
UK Cities are part of England State as per stateId
The text was updated successfully, but these errors were encountered: