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', |
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
| # data available from DfT website | |
| library(mapgl) | |
| library(sf) | |
| library(dplyr) | |
| library(osmdata) | |
| library(magrittr) | |
| geodata <- "./data/west sussex_tss_review_20250714a_esuid.gpkg" | |
| st_layers(geodata) | |
| dft <- read_sf(geodata, layer = "DfT Counts") |
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(mapgl) | |
| library(units) | |
| d <- read_sf("./data/STRLIGHT/STRLIGHT.shp") | |
| maplibre(style = carto_style("dark-matter-no-labels")) |> | |
| fit_bounds(d) |> | |
| add_circle_layer(id = "Streetlighting2", |
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
| # https://wikishire.co.uk/lookup/ | |
| # https://wikishire.co.uk/wiki/Sussex | |
| # https://en.wikipedia.org/wiki/Rape_(county_subdivision) | |
| # https://britishcountyflags.com/2020/09/14/_the-rapes-of-sussex/ | |
| library(sf) | |
| library(dplyr) | |
| library(mapgl) | |
| library(units) |
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(mapgl) | |
| library(sf) | |
| library(stringr) | |
| library(dplyr) | |
| library(readr) | |
| library(lubridate) | |
| library(tidyr) | |
| # read in data and tidy up | |
| locations <- read_csv("./data/afghanistan.csv") |> |
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(rnaturalearth) | |
| library(rnaturalearthdata) | |
| library(mapgl) | |
| library(mapview) | |
| library(sf) | |
| library(dplyr) | |
| antartic10 <- ne_download(scale = 50, type = 'antarctic_ice_shelves_polys', | |
| category = 'physical') | |
| antartic10l <- ne_download(scale = 50, type = 'antarctic_ice_shelves_lines', |
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(mapgl) | |
| library(sf) | |
| library(stringr) | |
| library(dplyr) | |
| library(magrittr) | |
| library(osmdata) | |
| map_start <- c(-0.404549247616387, 50.9365654134795) | |
| initial_zoom <- 10 |
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(rnaturalearth) | |
| library(rnaturalearthdata) | |
| library(mapgl) | |
| library(sf) | |
| library(dplyr) | |
| library(rmapshaper) | |
| # https://www.naturalearthdata.com/features/ | |
| rivers50 <- ne_download(scale = 50, type = 'rivers_lake_centerlines', |
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(shiny) | |
| library(dplyr) | |
| library(readr) | |
| library(units) | |
| library(mapgl) | |
| library(stringr) | |
| # d |> filter((end >= set_units(2020, "year")) & (end <= set_units(2029, "year"))| is.na(end)) |> View() | |
| # |
NewerOlder