Hello,

Let's suppose that 'gmap' is the image resulting from a GetMap.bbox() call
and 'r' is your Raster*.  A suitable solution is:

library(rasterVis)

levelplot(r) + layer_(grid.raster(gmap,
                                                             x=lonCenter,
y=latCenter,
                                                             width=width,
height=height,

default.units='native'))

The 'lonCenter', 'latCenter', 'width' and 'height' parameters have to be
extracted from the image attributes. In the next links you will find an
example using ggmap (which is built upon RgoogleMaps). Between lines 17 and
25 you will find details to extract them:

https://gist.github.com/oscarperpinan/5451682
http://procomun.wordpress.com/2013/04/24/stamen-maps-with-spplot/

Perhaps you will have to play with the 'alpha' values to mix the result of
levelplot and grid.raster.

Best,

Oscar Perpiñán Lamigueiro
Grupo de Sistemas Fotovoltaicos (IES-UPM)
Dpto. Ingeniería Eléctrica (EUITI-UPM)
URL: http://oscarperpinan.github.io
Twitter: @oscarperpinan
LinkedIn: http://es.linkedin.com/in/oscarperpinan
El 18/10/2013 23:56, "Waichler, Scott R" <Scott.Waichler@pnnl.gov> escribió:

> Hi,
>
> I've learned the basics of using RgoogleMaps and rasterVis, and now I want
> to combine their capabilities to use levelplot() with a georeferenced PNG
> image as a background in the lattice panel.  And, I want to plot to the
> normal R graphics devices, not the web as package plotGoogleMaps does.  Can
> anyone provide an example of how to use the result of RgoogleMaps'
> GetMap.bbox() as a background image in a plot produced with the rasterVis
> version of lattice graphics?
>
> Thanks,
> Scott Waichler
> Pacific Northwest National Laboratory
> Richland, WA USA
> scott.waichler@pnnl.gov
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

