Produce a SpatialPolygons object of EtrsGridCells given a data.frame of CELLCODE NORTHINGS EASTINGS
SpatialPolygons
Object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | bb <- bbox(cbind(c(4321000, 4323000), c(3210000,3212000)))
cell.size = 1000
# Calculate the limits of the grid
bb.outer.limits <-
cbind((floor(bb[, 1] / cell.size)) * cell.size, (ceiling(bb[, 2] / cell.size)) * cell.size)
# Calculates eastings
eastings <-
seq(from = bb.outer.limits[1, 1], to = bb.outer.limits[1, 2], by = cell.size)
# Calculates northings
northings <-
seq(from = bb.outer.limits[2, 1], to = bb.outer.limits[2, 2], by = cell.size)
eastings.northings <- as.matrix(expand.grid(eastings, northings))
low.corner.cell.etrs.points<-etrsPoints(eastings.northings = eastings.northings,cell.size =1000)
df <-EtrsTableCodes(eastings.northings,1000)
sp.cells <- etrsCells(df,1000)
summary(sp.cells)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.