Skip to content

Instantly share code, notes, and snippets.

@rafapereirabr
Created August 14, 2023 14:49
Show Gist options
  • Save rafapereirabr/ba70e7314eec3700c23f5212f63bbad1 to your computer and use it in GitHub Desktop.
Save rafapereirabr/ba70e7314eec3700c23f5212f63bbad1 to your computer and use it in GitHub Desktop.
walking isochrone Sao Paulo with r5r
library(r5r)
library(mapview)
# build transport network
data_path <- system.file("extdata/spo", package = "r5r")
r5r_core <- setup_r5(data_path)
# load origin/destination points
points <- read.csv(file.path(data_path, "spo_hexgrid.csv"))
origin_1 <- subset(points, id =='89a8100c393ffff')
# estimate isochrone from origin_1
iso1 <- isochrone(r5r_core,
origin = origin_1,
mode = c("walk"),
cutoffs = seq(0, 60, 5)
)
colors <- c('#ffe0a5','#ffcb69','#ffa600','#ff7c43','#f95d6a',
'#d45087','#a05195','#665191','#2f4b7c','#003f5c')
mapview(iso1,
zcol = "isochrone",
col.regions = rev(colors),
layer.name = 'Minutes',
alpha = .1)
@rafapereirabr
Copy link
Author

Screenshot 2023-08-14 114830

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment