Mapping long, lat to map-image

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

  1. macrumors 68040

    Joined:
    Feb 2, 2008
    #1
    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. macrumors G5

    gnasher729

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

    Joined:
    Feb 2, 2008
    #3
    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