If you are planning to build GIS application, you may need this:

http://downloads.cloudmade.com/
http://www.naturalearthdata.com/

To calculate distances, you will need Harvestine formula:

http://en.wikipedia.org/wiki/Haversine_formula