'cities_light don't have all the cities in my country? DJANGO
I would like to know how to load all the data in cities_light of Django, I have 42 record when I run python manage.py cities_light --force-import-all or python manage.py cities_light
in settings
CITIES_LIGHT_TRANSLATION_LANGUAGES = ['es']
CITIES_LIGHT_INCLUDE_COUNTRIES = ['CR']
This return 42 records in /cities but I need more than 100
I would like to know how charge more records in the database becouse I have so much code to change if I change cities_light for another library. I thought that I could make a script for charge the rest of the records for instance a csv, but I need the obligatory fields in the database.
Thanks so much for your help.
Solution 1:[1]
Cities Light uses the open Geonames database. So it only knows the cities that are in the Geonames database. You can help and add missing cities there or fix the data on existing entries.
Also, there are different data files for cities from Geonames.
cities1000.ziphas all cities with a population >1000cities5000.zipall cities with a population >5000cities15000.zipall cities with a population >15000
So maybe you are importing the smallest file that includes only larger towns and cities.
Solution 2:[2]
Try to use the http://download.geonames.org/export/dump/[Country_Code].zip
It's the only way I found to load more cities.
You may need to update the CITIES_LIGHT_INCLUDE_CITY_TYPES variable see http://www.geonames.org/export/codes.html.
I Hope that this will help someone because it took me sometime to figure all this out
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | C14L |
| Solution 2 |
