Mapping long, lat to map-image

Discussion in 'Mac Programming' started by subsonix, Dec 12, 2011.

  1. subsonix macrumors 68040

    Feb 2, 2008
    Does anyone know of a sensible approach to map longitudes and latitudes to a map image?

    A flat world map should distort the lines into curves, but how would one do this accurately. The idea is to map the long and lat relative to the graphical coordinates in the image, so that I can give a long/lat input and arrive at the exact x/y position in the image. Any ideas?
  2. gnasher729 macrumors P6


    Nov 25, 2005
    If you google for "Mercator projection" that will probably give you some information.
  3. subsonix thread starter macrumors 68040

    Feb 2, 2008
    Thanks for this, I will investigate further. Meanwhile I found some information on how to transform long/lat values into cartesian coordinates. Basically, let the center of the map be coordinate 0, 0 then use a function (Haversine formula) to get to and from long/lat values.

Share This Page