[R-sig-Geo] Plot multiple temporal rasters on background image

Francesco Tonini ftonini84 at gmail.com
Wed Apr 8 20:05:18 CEST 2015


Hello everybody,

I would need your help with the following issue. I am trying to plot 
multiple consecutive temporal rasters on top of a single background 
satellite image to show the dynamic spread of a disease. If you would 
like to help me, please find the two raster images at the link posted below.

link: 
_https://www.dropbox.com/sh/de9z037ir1bwyec/AABfFqUEraGuj3wbPkfpFTtta?dl=0_

library(raster)

img <- raster('./ortho_5m_color.tif')
r <- raster('./HI_100m.img')

plot(img)    # ---> see img1.png in the shared link
plot(r, col=rev(heat.colors(5, alpha=.3)), axes=F, legend=F, add=T)   # 
---> see img2.png in the shared link
plot(r, col=rev(heat.colors(5, alpha=.3)), axes=F, legend=F, add=T) # 
---> see img3.png in the shared link

As you may notice, adding another raster on top of the previous two does 
not match the full extent anymore. If you keep plotting more and more 
the extent keeps changing (reducing) until it stops.

Any advice on how to fix this issue for plotting multiple raster layers 
on top of the satellite image? I can send the two raster files if you 
must replicate on your computer.

Thank you,
Francesco


	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list