evacpath can compare
pedestrian-evacuation assumptions without changing the underlying study
inputs. This article uses the packaged example data and clips all
spatial inputs to a small focus area before modeling.
library(evacpath)
library(terra)
focus <- ext(669000, 675000, 9223000, 9225000)
dem <- crop(rast(system.file("extdata/dem.tif", package = "evacpath")), focus)
inundation <- crop(
rast(system.file("extdata/tsunami_inundation_depth.tif", package = "evacpath")),
focus
)
roads <- crop(vect(system.file("extdata/rds.gpkg", package = "evacpath")), focus)
zones <- prepare_tsunami_zones(
inundation = inundation,
dem = dem,
target_crs = "EPSG:32748"
)
roads <- clean_roads(
roads,
exclude = list(field = "man_made", values = "pier"),
target_crs = "EPSG:32748"
)walking_speed_mps controls conversion from route
distance to evacuation time. The lcp_* arguments control
the conductance surface and can change modeled route geometry.
comparison <- compare_evac_scenarios(
hazard_zone = zones$hazard_zone,
escape_zone = zones$escape_zone,
roads = roads,
dem = zones$dem,
target_crs = "EPSG:32748",
max_origins = 500,
max_destinations = 100,
scenarios = list(
baseline = list(walking_speed_mps = 1.22),
slow_walkers = list(walking_speed_mps = 0.75),
alternative_neighbours = list(lcp_neighbours = 8)
)
)
comparison$summaryDiagnostics collect coordinate reference system, geometry, overlap, elevation, origin, destination, and optional reachability issues in one report.
Routes are retained only when keep_routes = TRUE. This
keeps ordinary runs lightweight while allowing route-density analysis
when it is needed.