Description Usage Arguments Details Value Examples
cal.max.width.Zone
1 2 | cal.max.width.Zone(z, step = 0.001, widthMax = 0.05, boundary,
erosion = TRUE)
|
z |
spatial polygon |
step |
the difference between 2 values of parameter width in the function gBuffer |
widthMax |
the maximum value of the parameter width in gBuffer |
boundary |
union of all zones of the corrected map (result of correctBoundaryMap()) |
erosion |
logical, if TRUE, compute the maximum value of width in case erosion->dilatation, otherwise in case dilatation->erosion |
function that return the maximal value of the parameter "width" in function gBuffer in order not to make zone disappear or not to split a zone into 2 differents zones
maximum value of parameter width in the function smoothingZone
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | seed=1
map=genMap(DataObj=NULL,seed=seed,disp=FALSE,krig=2,typeMod="Gau")
criti = correctionTree(qProb = c(0.4,0.6), map = map)
Z = criti$zk[[2]][[1]]$zonePolygone
lab = criti$zk[[2]][[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)
widthMax = cal.max.width.Zone(z = Z[[3]], step = 0.001,
widthMax = 0.05, boundary = boundary, erosion = TRUE)
zone = zone.extended(z = Z[[3]], boundary = boundary)
erosion1 = rgeos::gBuffer(zone ,width = - (widthMax + 0.002) ,joinStyle="ROUND",capStyle = "ROUND")
erosion2 = rgeos::gBuffer(zone ,width = - (widthMax - 0.002) ,joinStyle="ROUND",capStyle = "ROUND")
rgeos::plot(erosion1)
rgeos::plot(erosion2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.