[R-sig-Geo] using spplot to superimpose points and polygons on SpatialGridDataFrame

Parviez Hosseini hosseini at ecohealthalliance.org
Wed Mar 12 18:03:36 CET 2014


I realize this is an old post, but this thread is still one of the top google
finds when trying to research the issue. 

I was able to reproduce the problem simply by replacing:

gridded(meuse.grid) <- TRUE ## original line

with 

gridded(meuse.grid) <- FALSE ## original line

Thus:
library(sp)
data(meuse)
data(meuse.grid)
coordinates(meuse) <- c("x", "y")
coordinates(meuse.grid) <- c("x", "y")
gridded(meuse.grid) <- FLASE  ## TRUE successfully overlays points.
pts <- list("sp.points", meuse, pch = 4, col = "black", cex=0.5)
greys <- grey(0:256 / 256)
spplot(meuse.grid, "dist", col.regions=greys, sp.layout=list(pts),
   cuts=length(greys)-1, colorkey=TRUE) 

runs quietly, but there no points produced by sp.layout=list(pts), they are
under the meuse.grid points






--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/using-spplot-to-superimpose-points-and-polygons-on-SpatialGridDataFrame-tp2763881p7585938.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list