EtrsSurface-class: The EtrsSurface class

Description Value Slots See Also Examples

Description

The etrs surface class holds the basic information for surface represanation in ETRS-LAEA grid from

Value

An EtrsSurface Object

Slots

SpatialPolygonsDataFrame.

the input surface plus new data columns

over.method.type

character. MaxArea for categorical data PropCal for numeric #'values

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)

See Also

etrsSurface.default, etrsMaxArea, etrsPropCal

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
32
33
34
35
testpropcal <- function() {
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:2100"))
df <-
  data.frame(val=c("R5","R40","R80"),row.names = sapply(slot(sps, "polygons"), function(x)
    slot(x, "ID")))
sps<-SpatialPolygonsDataFrame(sps,data = df)
}
Source.Surface <- testpropcal()

# Uses the default etrsSurface method
Source.Surface.MaxArea <-
etrsSurface(
  input.surface = Source.Surface, over.method.type = "MaxArea", cell.size = 1000
)
summary(Source.Surface.MaxArea)

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