Spatial Analysis of School Access

English
IMEPLAN
Author

Manuel Solano

Published

September 15, 2024

library(sf)
library(dplyr)
library(SpatialPosition)
schools <- st_read("media/example_points.shp")
convex_hull_amg <- st_convex_hull(schools)
convex_hull_buffered <- st_buffer(schools, dist = 500)
matdist <- CreateDistMatrix(schools, mygrid, longlat = TRUE)#primarias

\[ \text{Interaction} = \exp\left(-\alpha \cdot \text{mDistance}^{\beta}\right)\]

catchHuff <- huff(
  knownpts = puntos,
  unknownpts = mygrid,
  matdist = matdist,
  varname = "capacdd",  
  typefct = "exponential",
  span = 450, 
  beta = 2, 
  returnclass = "sf",
  longlat = TRUE  
)
rasterCatch <- rasterHuff(x = catchHuff)
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)