Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joelacus/world-cities
Geolocation data for all of the cities in the world as json/csv. Generate your own custom list with extra data.
https://github.com/joelacus/world-cities
cities csv custom dataset geolocation json world-cities-database
Last synced: 3 months ago
JSON representation
Geolocation data for all of the cities in the world as json/csv. Generate your own custom list with extra data.
- Host: GitHub
- URL: https://github.com/joelacus/world-cities
- Owner: joelacus
- Created: 2023-10-17T01:27:52.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-24T21:37:23.000Z (6 months ago)
- Last Synced: 2024-07-25T00:02:15.611Z (6 months ago)
- Topics: cities, csv, custom, dataset, geolocation, json, world-cities-database
- Language: Python
- Homepage:
- Size: 27 MB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# World Cities Geolocation Data
Geolocation data for all of the cities in the world as json/csv. [See Examples](#examples).You can generate your own custom list with extra data with the python script.
*NPM install coming soon.*
## Custom Lists
To generate your own list, run `python get_world_cities.py` and follow the CLI prompts.
Available data:
- ISO-3166 2-letter country code
- Full country name
- State
- County
- City/place name
- Alternative names
- Latitude
- Longitude
- Timezone
- Population
- AltitudeYou can choose whether you want to include cities/places with greater than '1000', '5000', or '15000' in population.
A [free Geocoding API key](https://geocode.maps.co/join/) is now required to fetch 'state' and 'county' data.
## Examples
world_cities.json
```
[
{
"country": "GB",
"name": "London",
"lat": "51.50853",
"lng": "-0.12574"
},
...
]
```
world_cities.csv
```
country,name,lat,lng
GB,London,51.50853,-0.12574
...
```
world_cities_(including_US_states).json
```
[
{
"country": "US",
"state": "NY",
"name": "New York City",
"lat": "40.71427",
"lng": "-74.00597"
},
...
]
```
world_cities_(including_US_states).csv
```
country,state,name,lat,lng
US,NY,New York City,40.71427,-74.00597
...
```## Sources
[GeoNames](https://www.geonames.org/datasources/): Country Code, City/Place Name, Alternative Names, Latitude, Longitude, Timezone, Population, and Altitude.[Geocoding](https://geocode.maps.co/): States and Counties.
[annexare](https://github.com/annexare/Countries): Full Country Names.
## Licence
[Creative Commons Attribution 4.0 License](https://creativecommons.org/licenses/by/4.0/)