Description Usage Arguments Value Examples
Implements a geographical grid system as vector data (polygons) based on ETRS89-LAEA
1 | CreateEtrsVectorGrid(x, cell.size, save.flag = FALSE)
|
x |
a Spatial object or an object with a bbox(object) matrix my Deafult method |
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. |
save.flag |
if you want to save the results to a file in the disk turn it to TRUE |
An object of SpatialPolygonsDataFrame containing an attribute coding system follows the recommendations from the European Environmental Agency [EEA 2008]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | xc <- round(runif(10, min = 4321000, max = 4323000), 2)
yc <- round(runif(10, min = 3210000, max = 3212000), 2)
xy <- cbind(xc, yc)
xy.sp <- SpatialPoints(xy, proj4string = CRS("+init=epsg:3035"))
df<-as.data.frame(rep(1,length(xy.sp)))
colnames(df)<-"VALUE"
xy.sp<-SpatialPointsDataFrame(xy.sp,df)
cell.size <- 1000
aGrid <- CreateEtrsVectorGrid(x = xy.sp, cell.size = cell.size)
# ... aggregate some data into it
agg<-aggregate(xy.sp,aGrid,sum)
X11(width = 10,10)
split.screen(figs=c(1,2))
screen(1)
plot(aGrid)
plot(xy.sp,add=TRUE,pch=21,bg=rgb(1,0,0,.1),cex=xy.sp[["VALUE"]])
screen(2)
plot(aGrid)
plot(gCentroid(agg,byid=TRUE),add=TRUE,pch=21,bg=rgb(1,0,0,.1),cex=agg[["VALUE"]])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.