EtrsGrid-class: Create the EtrsGrid Class

Description Arguments Value Slots Examples

Description

Represents A Geographical grid on ERTS89-LAEA Set the name of the class

Arguments

cell.size

a numeric one of the resolutions of the grid that is 0.5m, 1m, 2.5m, 5m, 10m, 25m, 50m, 100m, 250m, 500m, 1Km, 2.5Km, 5Km, 10Km, 25Km, 50Km, 100Km.

Value

An object of the class EtrsGrid

Slots

SpatialPolygonsDataFrame.

An object that the Grid net should cover completely grid

the.grid.name

character. The grid is designated as Grid_ETRS89-LAEA. For identification of an individual resolution level the cell size in metres is appended to the name. EXAMPLE LAEA_100K. The grid at a resolution level of 100km is designated as Grid_ETRS89-

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
x <- round(runif(1, min = 4320200, max = 4322000), 1)
y <- round(runif(1, min = 3210000, max = 3212000), 1)
xy <- cbind(x, y)
size = round(runif(1,min = 1500,max = 2000),0)
pl1 <-
  Polygons(list(Polygon(cbind(
    c(x,x + size,x + size,x,x),c(y,y,y + size,y + size,y)
  ))),round(runif(1,min = 1,max = 100),0))
x <- x + size
pl2 <-
  Polygons(list(Polygon(cbind(
    c(x,x + size,x + size,x,x),c(y,y,y + 2 * size,y + 2 * size,y)
  ))),round(runif(1,min = 1,max = 100),0))
x<-x-size
y<-y+size
pl3 <-
  Polygons(list(Polygon(cbind(
    c(x,x + size,x + size,x,x),c(y,y,y +  size,y +  size,y)
  ))),round(runif(1,min = 1,max = 100),0))
sps <-
  SpatialPolygons(list(pl1,pl2,pl3),proj4string = CRS("+init=epsg:3035"))
df <-
  data.frame(val=c("R5","R40","R80"),row.names = sapply(slot(sps, "polygons"), function(x)
    slot(x, "ID")))
sps<-SpatialPolygonsDataFrame(sps,data = df)
the.etrs.grid<-etrsGrid(sps,1000)
slotNames(the.etrs.grid)
the.etrs.grid@the.grid.name
head(the.etrs.grid@data,3)
plot(the.etrs.grid)
title(paste("the etrs grid",the.etrs.grid@the.grid.name))

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