Description Usage Arguments Value Examples
Creates an EtrsSourceSurface class that holds the basic information for Source surface represanation in ETRS-LAEA grid form
1 2 3 | ## S4 method for signature 'SpatialPolygonsDataFrame,ANY,ANY,numeric'
etrsSourceSurface(input.surface,
over.method.type, surface.value.col, cell.size)
|
input.surface |
SpatialPolygonsDataFrame. |
over.method.type |
ANY. |
surface.value.col |
ANY. |
cell.size |
numeric : cell.size 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 |
an EtrsSourceSurface object
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 | 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))
sps <-
SpatialPolygons(list(pl1,pl2),proj4string = CRS("+init=epsg:3035"))
df <-
data.frame(AREA = sapply(slot(sps, "polygons"), function(x)
slot(x, "area")),VALUE=c(10,20),row.names = sapply(slot(sps, "polygons"), function(x)
slot(x, "ID")))
sps<-SpatialPolygonsDataFrame(sps,data = df)
sps.source<-etrsSourceSurface(input.surface = sps,over.method.type = "PropCal",surface.value.col = 2,cell.size = 500)
plot(sps,border=2,lwd=3,col=rgb(.4,sps@data$VALUE/100,0,.25))
text(coordinates(sps)[,1],coordinates(sps)[,2],paste("VALUE=",sps@data$VALUE,sep=" "),cex=1)
text(coordinates(sps)[,1],coordinates(sps)[,2]+100,paste("ID=",row.names(sps@data),sep=" "),cex=1.2)
plot(sps.source,add=TRUE,lty=3,border=4)
text(coordinates(sps.source)[,1],coordinates(sps.source)[,2],sps.source@data$CELLVALUE,col=4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.