library(sf)
library(dplyr)
library(SpatialPosition)
<- st_read("media/example_points.shp") schools
<- st_convex_hull(schools)
convex_hull_amg <- st_buffer(schools, dist = 500) convex_hull_buffered
<- CreateDistMatrix(schools, mygrid, longlat = TRUE)#primarias matdist
\[ \text{Interaction} = \exp\left(-\alpha \cdot \text{mDistance}^{\beta}\right)\]
<- huff(
catchHuff knownpts = puntos,
unknownpts = mygrid,
matdist = matdist,
varname = "capacdd",
typefct = "exponential",
span = 450,
beta = 2,
returnclass = "sf",
longlat = TRUE
)
<- rasterHuff(x = catchHuff) rasterCatch
plotHuff(x = rasterCatch)
plot(st_geometry(primarias), pch = 20, col = "red", add = TRUE)
mtext("Probabilistic Catchment Areas \nof Public Schools",
side = 3,cex = 1.5, line=0.5)
mtext(text = "distance function: exponential, span = 0.45 km, beta = 2",
side = 1, line = 0.5)