
Identify escape/safety points where roads cross the hazard-zone boundary
Source:R/grid_region_escape.R
find_escape_points.RdIntersects a road/pathway network with the boundary of the hazard zone and converts the intersection geometry to points. These points represent candidate exits from the hazard zone.
Arguments
- hazard_zone
Hazard/evacuation zone.
- roads
Road/pathway network.
- study_area
Optional local study area used to crop candidate escape points to a broader region around the study area.
- region_buffer_m
Buffer distance passed to
make_region_area()whenstudy_areais supplied.
Examples
r <- terra::rast(nrows = 4, ncols = 4, xmin = 0, xmax = 4, ymin = 0, ymax = 4,
vals = 1, crs = "EPSG:3857")
zone <- terra::as.polygons(r, dissolve = TRUE)
roads <- terra::vect(matrix(c(-1, 2, 5, 2), ncol = 2, byrow = TRUE),
type = "lines", crs = "EPSG:3857")
find_escape_points(zone, roads)
#> class : SpatVector
#> geometry : points
#> dimensions : 2, 0 (geometries, attributes)
#> extent : 0, 4, 2, 2 (xmin, xmax, ymin, ymax)
#> coord. ref. : WGS 84 / Pseudo-Mercator (EPSG:3857)