zone.extended: zone.extended

Description Usage Arguments Details Examples

Description

zone.extended

Usage

1
zone.extended(z, boundary)

Arguments

z

a zone of the map

boundary

union of all zones of the corrected map (result of correctBoundaryMap())

Details

for a zone that has commun border with the map, it will be extended at the side of commun border. We search the commun border which is a spatiaLines. This spatialLines is composed of several Lines containing only 2 points. For each Lines, we project the 2 points to the convexHull of the "relaxation" of the map's boundary. We have then 4 points (2 come from a Line, 2 come from the projection). with 4 points, we will have a SpatialPolygone which is the extension part of the Line.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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)
# extend zone
z = geozoning:::zone.extended(z = Z[[1]], boundary = boundary)
sp::plot(z)
sp::plot(Z[[1]],add=TRUE)

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