On Tuesday 05 August 2008 22:25:30 Mark Bakker wrote:
> Can we do the same? I am sure we can (not sure we want, as Google has been
> somewhat difficult to people writing scripts to manipulate images from
> google maps).

I tried doing something similar to this a while ago. You can use gdal to point 
to your tile of interest (e.g., 
http://khm3.google.com/kh?v=30&hl=en&t=tqsrsstr), which is a JPG (or PNG, 
can't remember), and then plot the RGB using imshow(). Difficulty is how to 
get the tile (it is documented somewhere, but I don't know how to do it). 
This is some sample code that seems to work, and hopefully gets the ball 
rolling :)

import osgeo.gdal as gdal

g = gdal.Open ("http://khm3.google.com/kh?v=30&hl=en&t=tqsrsstr";)
R = g.GetRasterBand(1).ReadAsArray()
G =g.GetRasterBand(2).ReadAsArray()
B =g.GetRasterBand(3).ReadAsArray()
RGB = np.array((256,256,3)) # Clearly, there must be a better way of doing 
this!
RGB[:,:,0] = R
RGB[:,:,1] = G
RGB[:,:,2] = B

[...]


-- 
NERC Centre for Terrestrial Carbon Dynamics,
Department of Geography, University College London
Gower Street, London WC1E 6BT, UK

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to