etrsCells-data.frame-numeric-method: The Contsructor of the EtrsCells object

Description Usage Arguments Value Examples

Description

The Contsructor of the EtrsCells object

Usage

1
2
3
## S4 method for signature 'data.frame,numeric'
etrsCells(etrs.table.codes = "data.frame",
  cell.size = "numeric")

Arguments

etrs.table.codes

a data frame CELLCODE,EASTOFORIGIN,NORTHOFORIGIN

cell.size

a numeric 0.5m, 1m, 2.5m, 5m, 10m, 25m, 50m, 100m, 250m, 500m, 1Km, 2.5Km, 5Km, 10Km, 25Km, 50Km, 100Km

Value

an EtrsCells object

Examples

 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.df <- etrsCells(df,1000)
summary(sp.df)

etsakl/DasyMapR documentation built on May 16, 2019, 9:07 a.m.