List of major cities with latitude longitude and timezone
Asked Answered
T

7

30

I am looking for an open source flat file (comma separated values for example) of the major cities in this world, together with their latitude longitudes and timezone. The first 1000 or more is fine. Is such a resource available?

Eventually, a combination of two flats files (lat/long & timezone) is fine too.

Thimble answered 23/8, 2011 at 3:16 Comment(1)
See also this community wiki entryStallard
L
11

Have a look at: http://www.maxmind.com/app/worldcities

here is also a free version: http://www.maxmind.com/app/geolitecity

Laquanda answered 23/8, 2011 at 3:18 Comment(3)
This one has a lot of duplicate entries in it, which are different by one letter and etc.Freiburg
Have a look at pt,Porto entries (yes, there are duplicates for the same city) to estimate the quality of that dataset.Uzzi
The worldcities link doesn't work anymore, and "GeoLite Legacy databases were discontinued on January 2, 2019"Trifling
I
22

You can take a look at this

http://www.partow.net/miscellaneous/airportdatabase/#Download

tells you the lat-long info of all major cities with airports

Ideologist answered 23/8, 2011 at 3:24 Comment(2)
The following command converts the database to "City, Country:LatDecimal:LonDecimal" format. cat GlobalAirportDatabase.txt | grep -v "00:00:00" | awk -F':' '{print $4", "$5":"$9""($6+$7/60+$8/3600)":"$13""($10+$11/60+$12/3600)}' | sed 's/:S/:-/' | sed 's/:U/:-/' | sed 's/:N/:/' | sed 's/:E/:/' > WorldCitiesChaechaeronea
Nice! Despite the name, it contains not the airport coordinates. There are 7322 cities in that CSV right now. The coordinates, however, seem rather arbitrary to me. For Augsburg (Germany), for example, it is definitily not an important part of the city where the coordinates point to.Uzzi
L
11

Have a look at: http://www.maxmind.com/app/worldcities

here is also a free version: http://www.maxmind.com/app/geolitecity

Laquanda answered 23/8, 2011 at 3:18 Comment(3)
This one has a lot of duplicate entries in it, which are different by one letter and etc.Freiburg
Have a look at pt,Porto entries (yes, there are duplicates for the same city) to estimate the quality of that dataset.Uzzi
The worldcities link doesn't work anymore, and "GeoLite Legacy databases were discontinued on January 2, 2019"Trifling
H
2

Building on Parapura's answer (+1 for the great idea of using airport lists):

Here is another much more complete airport database (46325 airports as of today and apparently actively maintained).

To hopefully save other's time, here are the few command lines I used to get it all:

wget ourairports.com/data/airports.csv
wget ourairports.com/data/airport-frequencies.csv
wget ourairports.com/data/runways.csv
wget ourairports.com/data/navaids.csv
wget ourairports.com/data/countries.csv
wget ourairports.com/data/regions.csv

To get major cities, I would use the airports qualified as "large_airport".

Homogeny answered 22/4, 2015 at 0:43 Comment(3)
This assumes that every major city has an airport.Tribadism
@Tribadism Could you give a counter example?Uzzi
This dataset includes 616 large airports, 4500 medium airports, and 35000 small airports. That should cover anything most people describe as a major city.Birdwatcher
T
2

I had this problem - I needed it to place markers on a map. Here is the procedure that I followed:

https://gist.github.com/rolfen/cdaf1895b44659c1c4d2b90970af443e

The data is provided by Wikipedia:
https://en.wikipedia.org/w/index.php?title=List_of_cities_by_longitude&printable=yes

I do some processing on that using the browser debugging console.

The output is a JSON object. If you can work with JavaScript, it should be easy to tweak.

Tribadism answered 24/12, 2017 at 12:35 Comment(2)
Replacing "#mw-content-text > table.wikitable tbody tr" by "table.wikitable tbody tr" and it works for me.Uzzi
Thank you @MartinThoma . It seems the markup has changed, I'm updating the gist.Tribadism
I
2

I've found one that's still on the web and kept reasonably up-to-date: https://simplemaps.com/data/world-cities

The Basic version (approx. 41 thousand locations) is available free under Creative Commons licensing in CSV or Excel formats. Lat, long, and population are all included. I've just downloaded it, so no quality testing yet.

Interblend answered 22/8, 2022 at 23:32 Comment(0)
P
1

This one ships as CSV files http://www.geobytes.com/geoworldmap/ and contians latitude longitudes and timezones.

Petrapetracca answered 22/4, 2015 at 1:17 Comment(0)
S
1

I would recommend NaturalEarth where you can download files with major cities including their names in different languages and their population. Country borders and time zones are provided as well. The download formats include SHP, SQLite and GeoPackage; no CSV though, but all are easy to read in QGIS (where you can convert them to CSV) or e.g. Python.

If you need smaller cities as well have a look at https://www.geonames.org/ - at that site CSV downloads of cities are provided (with coordinates, names and other properties).

Simonides answered 23/9, 2022 at 14:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.