-
Notifications
You must be signed in to change notification settings - Fork 1
/
missing-links.R
38 lines (34 loc) · 1.31 KB
/
missing-links.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#plot map with baseline
library(dplyr)
library(sf)
library(biclar)
# MUNICIPIOSgeo = readRDS(url("https://github.com/U-Shift/biclar/releases/download/0.0.1/MUNICIPIOSgeo.Rds"))
# MUNICIPIOS = MUNICIPIOSgeo$Concelho
#
# REDEregion = readRDS("rnet_enmac_quietest_full.Rds") #quiet
# # REDEregion = readRDS("rnet_enmac_fastest_full.Rds") #fast
#
# scenario = "baseline" #baseline, enmac4, enmac10
# route = "quiet" #quiet, fast
#
# mun = MUNICIPIOS[6] #test with Lisbon 6
# BUFFER = MUNICIPIOSgeo %>% filter(Concelho == mun) %>% st_buffer(100) #maybe reduce to 200?
# REDE = REDEregion %>% st_filter(BUFFER)
# REDE = REDE %>% filter(ENMAC10 >= quantile(REDE$ENMAC10, 0.60)) #0.6 for quiet, 0.7 for fast, change here scenario. (Barreiro should be 0.65)
REDE = st_read("Lisbon_quiet_500_top40pp.gpkg")
prioritysegments = st_read("Lisbon_prioritize_baseline.gpkg")
prioritysegments_buffer = st_buffer(prioritysegments, dist = 400, joinStyle = "BEVEL", endCapStyle = "SQUARE") %>% st_union()
tmap_options(check.and.fix = TRUE)
tm_shape(REDE) +
tmap::tm_lines(
id = NULL,
lwd = "Baseline",
scale = 15,
col = "Quietness",
palette = cols4all::c4a(palette = "-mako")
)+
tm_shape(prioritysegments_buffer) +
tm_polygons(alpha = 0,
border.col = "red",
col = NA,
border.lwd = 1.5)