smoothingZone: smoothingZone

Description Usage Arguments Details Value Examples

Description

smoothingZone

Usage

1
smoothingZone(z, width, boundary, disp = TRUE)

Arguments

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

Details

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.

Value

a zone (SpatialPolygon)

Examples

 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)

geozoning documentation built on May 2, 2019, 9:43 a.m.