saveZK: saveZK function called by correctionTree

Description Usage Arguments Details Value Examples

Description

saveZK function called by correctionTree

Usage

1
2
saveZK(map, K1, Z2, qProb, listOfZ, indCur, crit, cost, costL, nz, mdist,
  pErr = 0.9, optiCrit = 2, simplitol = 0.001)

Arguments

map

object returned by function genMap

K1

previous zoning

Z2

current zoning geometry (list of SpatialPolygons)

qProb

probability vector used to generate quantile values

listOfZ

list of zoning objects

indCur

index of new list element

crit

list of criteria

cost

list of costs

costL

list of per label costs

nz

list of number of zones

mdist

list of distance matrices

pErr

equality tolerance for distance calculations

optiCrit

criterion choice

simplitol

tolerance for spatial polygons geometry simplification

Details

Given a map object, a list of zonings, a current and a previous zoning, adds the current zoning to the list of zonings if it has at least 2 zones,after recalculating zone neighborhood and transferring zone labels.

Value

a list with components

listOfZ

updated list of zoning objects, first element corresponds to initial zoning, each other element is a list with each (last if ALL=FALSE) level zoning objects

mdist

list of initial distance matrix and all (last if ALL=FALSE) level distance matrices

crit

list of initial criterion and all (last if ALL=FALSE) level criteria

cost

list of initial cost and all (last if ALL=FALSE) level costs

costL

list of initial cost per label and all (last if ALL=FALSE) level costs per label

nz

list of initial number of zones and all (last if ALL=FALSE) level number of zones

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(mapTest)
# run zoning with 2 quantiles corresponding to probability values 0.4 and 0.7
criti=correctionTree(c(0.4,0.7),mapTest,LASTPASS=FALSE,SAVE=TRUE)
K1=criti$zk[[1]][[1]]#initial zoning
Z1=K1$zonePolygone
printZsurf(Z1) # 8 zones with 2 small zones (7 and 8)
Z2 = geozoning:::remove1FromZ(Z1,7,K1$zoneN)
printZsurf(Z2) #7 zones
indCur=2
newRes=geozoning:::saveZK(mapTest,K1,Z2,c(0.4,0.7),criti$zk,indCur,
        criti$criterion,criti$cost,criti$costL,criti$nz,criti$mdist)
newZ=newRes$listOfZ[[2]][[1]]$zonePolygone
printZsurf(newZ) #6 zones

hazaeljones/geozoning documentation built on May 30, 2019, 3:06 p.m.