Learn R Programming

geozoning (version 1.0.0)

zoneGrow: zoneGrow

Description

zoneGrow

Usage

zoneGrow(K, map, iC, optiCrit = 2, minSize = 0.012, minSizeNG = 0.001,
  distIsoZ = 0.075, LEQ = 5, MAXP = 0.1, simplitol = 0.001, disp = 0)

Arguments

K

zoning object, such as returned by the calNei function

map

object returned by function genMap

iC

index of current zone

optiCrit

criterion choice

minSize

admissible zone area threshold

minSizeNG

zone area threshold under which a zone will be removed

distIsoZ

threshold distance to next zone, above which a zone is considered to be isolated

LEQ

length of quantile sequence used to grow isolated zone

MAXP

quantile sequence maximum shift from center

simplitol

tolerance for spatial polygons geometry simplification

disp

information level (0-no info, 1-print info)

Value

a zone obtained by growing current zone

Details

either grow isolated zone or group 2 zones together if isolated zone, run optimization procedure to find the new quantile if zone very small (area < minSizeNG) do not grow it

Examples

Run this code
# NOT RUN {
data(mapTest)
qProb=c(0.2,0.5)
ZK = initialZoning(qProb, mapTest)
K=ZK$resZ
Z=K$zonePolygone
plotZ(K$zonePolygone) # plot zoning
kmi=zoneGrow(K,mapTest,6) # grow zone 6 by grouping it with its closest neighbor with same label
linesSp(kmi[[7]])
qProb=c(0.3,0.5)
criti = correctionTree(qProb,mapTest)
best = criti$zk[[2]][[1]]
Z=best$zonePolygone
plotZ(Z)
refPoint = rgeos::gCentroid(Z[[4]])
sp::plot(refPoint,add=TRUE,col="blue",pch=21)
zg=zoneGrow(best,mapTest,4) #grow isolated zone 4 by searching for other quantile
plotZ(zg)
# }

Run the code above in your browser using DataLab