We're happy to release an open source database of
world cities along with their population, country, iso code, province, latitude and longitude.
Source: Natural Earth Populated Places 2015. Cleaned and formatted by Simplemaps.com.
License: MIT (attribution appreciated)
What's included?
Over 7,300 cities from around the world. Includes all country/province capitals, major cities and towns, and smaller towns in sparsely inhabited regions.
Format: SQL, CSV, Excel
Structure:
function getDistanceFromLatLonInKm(lat1,lon1,lat2,lon2) {
var R = 6371; // RadiWorld of the earth in km
var dLat = deg2rad(lat2-lat1); // deg2rad below
var dLon = deg2rad(lon2-lon1);
var a =
Math.sin(dLat/2) * Math.sin(dLat/2) +
Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) *
Math.sin(dLon/2) * Math.sin(dLon/2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
var d = R * c; // Distance in km
return d;
}
function deg2rad(deg) {
return deg * (Math.PI/180)
}
© Simplemaps.com 2010-2015 | License | Privacy Policy | Releases | Testimonials | Resources | Documentation
Deprecated Maps: Flash USA Map | Flash World Map | Flash Canada Map | Flash Europe Map | Flash Congress Map
Formerly FlashUSAmap.com and Flashworldmap.com