EtrsAncillarySurface-class: The EtrsAncillarySurface class

Description Value Slots Examples

Description

The EtrsAncillarySurface class holds the basic information for ancillary surface represanation in ETRS-LAEA grid form. Land-use or land-cover are the most frequently used ancillary datasets, but any dataset that has classes of relatively density could be used here.

Value

An EtrsAncillarySurface Object

Slots

SpatialPolygonsDataFrame.

the input surface plus new data column WCELLWEIGHT

over.method.type

character. PropCal only. An ancillary Surface must have a CELLVALUE

cell.size

numeric. Indexing the column of data frame that contains the value of #'interest

CELLVALUE

character. The size of the cell (the new map unit)

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
# test EtrsAncillarySurface -------------------------------------------------------
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 = 500,max = 1000),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 + size,y + size,y)
  ))),round(runif(1,min = 1,max = 100),0))
ancS <-SpatialPolygons(list(pl1,pl2),proj4string = CRS("+init=epsg:3035"))

df <-data.frame(RelDens=c(0.15,0.85),bin=c(1,1),row.names = sapply(slot(ancS, "polygons"), function(x)slot(x, "ID")))
ancS<-SpatialPolygonsDataFrame(ancS,data = df)
ancS.grided<-etrsAncillarySurface(input.surface = ancS,over.method.type = "PropCal",surface.value.col = 1,cell.size = 500,binary = FALSE)
plot(ancS.grided,border=4,lwd=2)
plot(ancS,add=TRUE,col=rgb(0,.25,.3,.1))
text(coordinates(ancS)[,1],coordinates(ancS)[,2],paste("reDens=",ancS[[1]]))
text(coordinates(ancS.grided)[,1],coordinates(ancS.grided)[,2],paste("CELLVALUE=",ancS.grided[[4]]))

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