khkwan0 / countryCityStateJson

44 stars 35 forks source link

Empty cities array for states named with multiple words #4

Closed ADavidLiu closed 4 years ago

ADavidLiu commented 5 years ago

I was working with the data from Colombia, but the cities from states with names composed of more than 1 word (Valle del Cauca, Norte de Santander, etc.) are returning an empty array.

khkwan0 commented 5 years ago

Yes, the data I pulled from had some missing/erroneous information. I did not personally gather the data. However, in /lib you will find the the node program called compilecities.json. The idea here is that any information from /src can be changed or filled in. It's pretty straightforward. Once you think you have what is correct, run node compilecities.json and it will compile the information in /src into the file compiledCities.json

I personally am not maintaining the database itself, I am maintaining the code that compiles and reads from that database. I understand it's a hassle, but if you decide to fill in the missing pieces, please send a pull request.

ADavidLiu commented 4 years ago

Thanks for getting back. I'm updating city.json to add the missing cities, but I was wondering if I really have to manually update all the id fields of the next hundreds of cities in the array. Is it necessary for the correct functioning of the package?

EDIT: I ran node compiledCities.json after making the changes (with empty id fields for the new cities) but looks like it didn't change anything.

EDIT: I ended up directly modifying the JSON in compiledCities.json

khkwan0 commented 4 years ago

that's strange, it should've created a new file. you don't have to edit everything, just whatever you think. if you still happen to have your changes i'd like to incorporate into this repo.

ADavidLiu commented 4 years ago

I uploaded the edited city.json here: https://gist.github.com/ADavidLiu/2144f2ac457937f57c88e5783d1b0917

The new cities are the ones that have an empty id ("id": "").