Given the lat/long coordinates, how can we find out the city/country?

Another option: Download the cities database from http://download.geonames.org/export/dump/ Add each city as a lat/long -> City mapping to a spatial index such as an R-Tree (some DBs also have the functionality) Use nearest-neighbour search to find the closest city for any given point Advantages: Does not depend on an external server to be available Very … Read more

Getting distance between two points based on latitude/longitude

Update: 04/2018: Vincenty distance is deprecated since GeoPy version 1.13 – you should use geopy.distance.distance() instead! The answers above are based on the Haversine formula, which assumes the earth is a sphere, which results in errors of up to about 0.5% (according to help(geopy.distance)). Vincenty distance uses more accurate ellipsoidal models such as WGS-84, and … Read more