Given the answers to the other queries so far (1233505 and 1233545) I think you do want a GIS module, in which case Geo::GDAL::FFI will do what you need.
As noted before, the Earth is not a sphere. It is a geoid that is normally modelled using an oblate spheroid (that requires a flattening parameter). However, there are coordinate systems that use spheres to model the underlying system. The coordinate systems definitions also include the radius of the sphere or spheroid, so one can model the sun or some planetary body like Mars, or anything one likes (it is just spherical geometry in the end).
The likely approach for the problem is to work with the data as (latitude, longitude, height) triplets. This is already supported by GDAL and can be loaded using the Well Known Text system for geometric objects.
If you follow this approach then GDAL (and GEOS and Proj underneath) will handle all the heavy lifting, including projecting onto a two-dimensional surface for display.
|