C++ classes for coordinates conversions, for geomagnetic field calculations, and for solving geodesic problems.

GeographicLib is a small set of C++ classes for performing conversions between geographic, UTM, UPS, MGRS, geocentric, and local cartesian coordinates, for gravity (e.g., EGM2008), geoid height, and geomagnetic field (e.g., WMM2010) calculations, and for solving geodesic problems.

http://geographiclib.sourceforge.net/