Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- GTFS Database Schema for DuckDB | |
| -- Based on GTFS Specification v2.0 | |
| -- levels.txt | |
| CREATE TABLE levels ( | |
| level_id TEXT PRIMARY KEY, | |
| level_index DOUBLE NOT NULL, | |
| level_name TEXT | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(readr) | |
| library(dplyr) | |
| library(sf) | |
| library(mapgl) | |
| # download data here: https://roadtraffic.dft.gov.uk/downloads | |
| dft <- read_csv("dft_traffic_counts_aadf_by_direction.csv", | |
| col_types = cols( | |
| count_point_id = col_double(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ui <- | |
| page_sidebar( | |
| tags$head( | |
| tags$link( | |
| rel="shortcut icon", | |
| href="https://github.com/szechno/wscc_shinyapp/blob/main/favicon.ico?raw=true" | |
| ) | |
| ), | |
| theme = bs_theme(bootswatch = "simplex", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # preload functions ---- | |
| # server ---- | |
| server <- function(input, output, session) { | |
| # bs_themer() | |
| # selected/clicked esuid we call `v` ---- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(shiny) | |
| library(shinyWidgets) | |
| library(bslib) | |
| library(mapgl) | |
| library(sf) | |
| library(stringr) | |
| library(dplyr) | |
| library(DBI) | |
| library(RSQLite) | |
| library(callr) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(shiny) | |
| library(shinyWidgets) | |
| library(bslib) | |
| library(mapgl) | |
| library(sf) | |
| library(stringr) | |
| library(dplyr) | |
| library(DBI) | |
| library(RSQLite) | |
| library(callr) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Improvements: | |
| # add `mode` to get_routes by filtering available highway = * | |
| # 'footway', 'unclassified','service', 'track', 'bridleway', 'path', | |
| # 'residential', 'tertiary', 'primary', 'trunk', 'secondary', 'motorway', | |
| # 'tertiary_link', 'pedestrian', 'cycleway', 'primary_link', 'motorway_link', | |
| # 'trunk_link', 'secondary_link', 'living_street', 'construction', 'services', | |
| # 'proposed', 'busway', 'crossing' | |
| # mode == 'walking' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(sf) | |
| library(dplyr) | |
| library(readr) | |
| library(tidyr) | |
| library(tidygraph) | |
| library(sfnetworks) | |
| library(stplanr) | |
| library(stringr) | |
| library(purrr) | |
| library(mapview) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # prelim functions | |
| # download oemextract and clean up ---- | |
| get_oemextract <- function(wsx = "D:/data_store/Boundaries/county/county.shp"){ | |
| message("Warning this will take 5-10 mins") | |
| wsx <- sf::read_sf(wsx) |> dplyr::select(geometry) | |
| wsx_roads <- osmextract::oe_get( | |
| wsx |> st_transform(crs = 4326), | |
| query = "SELECT * FROM 'lines' WHERE highway IN ('footway', 'unclassified', | |
| 'service', 'track', 'bridleway', 'path', 'residential', 'tertiary', |
NewerOlder