From 14a097fe9ef4a818b920337a483f42cec0781295 Mon Sep 17 00:00:00 2001 From: syounkin Date: Wed, 6 Nov 2024 16:48:21 -0600 Subject: [PATCH] Moved basemap chunk Code in routeslts called basemap before it was defined. To correct this the basemap chunk was moved up in the script. --- cycling_route_analysis_brouter.Rmd | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/cycling_route_analysis_brouter.Rmd b/cycling_route_analysis_brouter.Rmd index f39fb6f..ba94673 100644 --- a/cycling_route_analysis_brouter.Rmd +++ b/cycling_route_analysis_brouter.Rmd @@ -161,6 +161,18 @@ routes <- st_transform(bind_rows(routes), crs = 4326) Notes: - this queries the brouter server to get routes +## Set boundaries and get basemap +```{r basemap, eval = TRUE, echo = TRUE, results = "show", warning = FALSE, error = TRUE, message = FALSE} + +bbox <- st_bbox(st_buffer(cycle_boundary_poly, dist = 500)) +bbox <- c(left = as.double(bbox[1]), + bottom = as.double(bbox[2]), + right = as.double(bbox[3]), + top = as.double(bbox[4])) + +#get basemap +basemap <- get_stadiamap(bbox = bbox, zoom = 15, maptype = "stamen_toner_lite") +``` ## Combine routes with Bike LTS ```{r ltscount, eval = TRUE, echo = TRUE, results = "show", warning = FALSE, error = TRUE, message = FALSE} @@ -271,19 +283,6 @@ logo <- image_read(path = "other/BFW_Logo_180_x_200_transparent_background.png") school_symbol <- image_read_svg(path = "other/school_FILL0_wght400_GRAD0_opsz24.svg") ``` -## Set boundaries and get basemap -```{r basemap, eval = TRUE, echo = TRUE, results = "show", warning = FALSE, error = TRUE, message = FALSE} - -bbox <- st_bbox(st_buffer(cycle_boundary_poly, dist = 500)) -bbox <- c(left = as.double(bbox[1]), - bottom = as.double(bbox[2]), - right = as.double(bbox[3]), - top = as.double(bbox[4])) - -#get basemap -basemap <- get_stadiamap(bbox = bbox, zoom = 15, maptype = "stamen_toner_lite") -``` - ## Generate map of addresses ```{r mapaddresses, eval = TRUE, echo = FALSE, results = "show", warning = FALSE, error = TRUE, message = FALSE}