I have noticed that, from Google Maps page, you can get an "embed" link to put inside an iframe and load the map in a browser. (no news here)

The image size can be adjusted to be very large, so I am interested in getting som big images as single .PNGs.

More specifically, I would like to define a rectangular area from a bounding box (upper-right and lower-left coordinates), and get the corresponding image, with an appropriate zoom factor.

But my question is: How can I use Python to get the "pixel content" of this map as an image object?

(My rationale is: if the browser can get and render such image content, then Python should be capable of doing it, too).

EDIT: this is the content of the HTML file that shows my sample map:

<iframe 
    width="2000"
    height="1500"
    frameborder="0"
    scrolling="yes"
    marginheight="0"
    marginwidth="0"
    src="http://maps.google.com.br/maps?hl=pt-BR&amp;ll=-30.027489,-51.229248&amp;spn=1.783415,2.745209&amp;z=10&amp;output=embed"/>

EDIT: I did as suggested by Ned Batchelder, and read the content of an urllib.urlopen() call using the src address taken from the iframe above. The result was a lot of javascript code, which I think has to do with the Google Maps JavaScript API. So, the question lingers: how could I do some useful stuff from all this stuff in Python in order to get the map image?

EDIT: this link appears to contain some pretty relevant info on how Google Maps tiles their maps: http://www.codeproject.com/KB/scrapbook/googlemap.aspx

also: http://econym.org.uk/gmap/howitworks.htm

Edit
Report