Description Usage Arguments Details Value Examples
smoothingZone
1 | smoothingZone(z, width, boundary, disp = TRUE)
|
z |
zone to be modified (SpatialPolygon) |
width |
smoothing parameter in gBuffer if dilatation is followed by erosion |
boundary |
union of all zones of the corrected map (result of correctBoundaryMap()) |
disp |
logical, if TRUE, display the value of "widthExt" in case of dilatation->erosion, otherwise display "widthInt" in case of erosion->dilatation |
function that returns a new smoothed zones. Attention: this function is just a tool for a better visualisation of the map, if it doesn't work properly, please choose another value of the width parameter.
a zone (SpatialPolygon)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | seed=1
map=genMap(DataObj=NULL,seed=seed,disp=FALSE,krig=2,typeMod="Exp",nPointsK=500)
criti = correctionTree(qProb = c(0.5), map = map)
Z = criti$zk[[1]][[1]]$zonePolygone
lab = criti$zk[[1]][[1]]$lab
# zones' correction
res = correctBoundaryMap(Zi = Z, map = map)
Z = res$Z
# map boundary after correction
boundary = Z[[1]]
for(i in 2:length(Z)){
boundary = rgeos::gUnion(boundary, Z[[i]])
}
# plot map
plotM(map = map, Z = Z, lab = lab, byLab = FALSE)
# smoothing
zone = Z[[2]]
newZone = smoothingZone(z = zone, width = 0.05, boundary = boundary)
sp::plot(zone)
sp::plot(newZone)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.