Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

subsonix

macrumors 68040
Original poster
Feb 2, 2008
3,551
79
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?
 

gnasher729

Suspended
Nov 25, 2005
17,980
5,565
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?

If you google for "Mercator projection" that will probably give you some information.
 

subsonix

macrumors 68040
Original poster
Feb 2, 2008
3,551
79
If you google for "Mercator projection" that will probably give you some information.

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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.