I am trying to plot geo coordinates (lat/lon) on an image I retrieve via Googles static Map API. I want to do this offline directly on the image via Ruby because I want to plot about 20,000 coordinates.
However, for this task, I need to specify the corner (top left & bottom right) coordinates. here is the link to my map: http://maps.google.com/staticmap?center=51.0,10.0&zoom=6&size=640x640&format=png&sensor=false
How can I get coordinates for the top left and bottom right corners of this map?
Thanks in advance :)
PS: My code for Lat/Lon -> X/Y is this for now:
def get_img_coords(lat, lon, w, h, lat_ul, lon_ul, lat_lr, lon_lr)
{ :x => (lon + lon_ul) * (w / (lon_lr-lon_ul)),
:y => (lat + lat_ul) * (h / (lat_lr-lat_ul)) }
end
... assuming mercator projection of course.