[R-sig-Geo] Use a PNG image as background for lattice plotting with rasterVis

Robert J. Hijmans r.hijmans at gmail.com
Sat Oct 19 00:34:45 CEST 2013


Scott, Here is an Incomplete answer but perhaps useful anyway. You can do:

library(dismo)
g <- gmap("Pacific Northwest National Laboratory, Richland, WA, USA")
plot(g)

# and now you can add points, polygons, lines.
# you can also do

library(rasterVis)
levelplot(g)

This "works" but not as desired; I do not know how to get the colors
come out right; probably something that should be fixed in rasterVis
if this can be done with levelplot.
Robert


On Fri, Oct 18, 2013 at 2:56 PM, Waichler, Scott R
<Scott.Waichler at pnnl.gov> wrote:
> 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 at pnnl.gov
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



More information about the R-sig-Geo mailing list