Dear list,
Using spplot and sp.layout is it possible to overlay two SpatialPixelsDataFrame objects with different cellsizes (but covering the same area) on the same plot, each with a different colourscheme? I can't seem to get the SpatialPixelsDataFrame object in sp.layout to display properly.


Note, this example isn't exactly reproducible ?(unless you can sub in your own filenames) as the two filenames below aren't real but hopefully it shows enough of my syntax to assist. If not I will attempt to make this a reproducible example.
-----------------------
library(raster)
library(rgdal)
library(classInt)
library(sp)


#Data from a 5km^2 resolution raster
obs <-raster(readGDAL("myobsdata.bil",p4s=CRS("+proj=latlong +datum=WGS84")))
obssp <- SpatialPoints(obs)
obssp=SpatialPixelsDataFrame(obssp,data=data.frame(getValues(obs)))
names(obssp@data) <- z


#Data from a 1km^2 resolution raster to a SpatialPixelsDataFrame
dem <-raster(readGDAL("myfinedata.bil",p4s=CRS("+proj=latlong +datum=WGS84")))
temp  <- SpatialPoints(dem)
temp <- SpatialPixelsDataFrame(temp,data=data.frame(getValues(dem)))
name(temp@data) <- alt


#Define the sp.layout item to plot the high resolution 'background' data
demsp = list("sp.points", temp, zcol="alt", col.regions=grey(1:100/100), cuts=99, first=TRUE)


#Define a colour palette for the lower resolution measured data
col.br <- colorRampPalette(c("gold","chartreuse4","cornflowerblue","darkblue"))


#plot both objects. demsp should be plotted first, with obssp on top. demsp should be in greyscale, obssp according to the colours chosen in col.br
spplot(obssp, "z", col.regions=col.br(100), cuts=99, alpha.regions= 0.7, sp.layout=list(demsp))
-----------------------

I can only get the object defined in spplot to display correctly. The object in the sp.layout does not show up correctly. Could this be because of differing resolutions? Any help is much appreciated.

Also, is it possible to read data files from Dropbox using readGDAL? I can't seem to pass it a filename in the form of a url.

Many thanks,

Simon


	[[alternative HTML version deleted]]

