## spatial pixels:
library(sp)
data(meuse.grid)
gridded(meuse.grid) <- ~x+y
tl <- getSpatialTiles(meuse.grid, block.x=1000)
image(meuse.grid)
lines(as(tl, "SpatialLines"))
# all at once:
pix.lst <- tile(meuse.grid, block.x=1000)
## lines:
library(plotKML)
data(eberg_contours)
line.lst <- tile(eberg_contours, block.x=5000)
spplot(line.lst[[1]][2])
## polygons:
data(eberg_zones)
## this one requires ogr2ogr function:
pol.lst <- tile(eberg_zones, block.x=5000)
spplot(pol.lst[[1]][2])Run the code above in your browser using DataLab