Skip to content

Commit

Permalink
motorway and trunk as high level road
Browse files Browse the repository at this point in the history
  • Loading branch information
temospena committed Jun 3, 2024
1 parent bc19ef8 commit 3ceafdd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions code/trafftc_proxy.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
library(tidyverse)
road_network_clean = sf::st_read("outputdata/map1/road_network_clean.shp")
grid = sf::st_read("outputdata/map1/grid.geojson")
congested_tags = c("primary", "primary_link", "secondary", "secondary_link", "tertiary", "tertiary_link") #
congested_tags = c("motorway", "motorway_link", "trunk", "trunk_link",
"primary", "primary_link", "secondary", "secondary_link",
"tertiary", "tertiary_link") #

traffic_vector_grid = st_intersection(road_network_clean, grid)

Expand All @@ -21,8 +23,8 @@ traffic_cells = grid |>

# vizualise
road_network_clean = road_network_clean |>
mutate(congested_tags = ifelse(highway %in% congested_tags, "primary, secondary, terciary", "other"))
road_network_clean$congested_tags = factor(road_network_clean$congested_tags, levels = c("primary, secondary, terciary", "other")) # for viz purpouse only
mutate(congested_tags = ifelse(highway %in% congested_tags, "primary, secondary, tertiary", "other"))
road_network_clean$congested_tags = factor(road_network_clean$congested_tags, levels = c("primary, secondary, tertiary", "other")) # for viz purpouse only

mapview::mapview(traffic_cells, zcol="classification", alpha.regions = 0.2) +
mapview::mapview(road_network_clean, zcol="congested_tags")

0 comments on commit 3ceafdd

Please sign in to comment.