From 5be209082d558a08c39bbd95c7577f3453e6e335 Mon Sep 17 00:00:00 2001 From: Bruce Delo Date: Wed, 3 Jan 2024 10:18:24 -0400 Subject: [PATCH 1/2] Changed all instances of get_stamenmap() to get_stadiamap(), with according changes to maptype. --- _episodes/05-r-telemetry-report-array.md | 24 +++++++++++------------ _episodes/06-r-telemetry-report-tagger.md | 16 +++++++-------- _episodes/11-act-actel.md | 4 ++-- _episodes/12-basic-animation.md | 2 +- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/_episodes/05-r-telemetry-report-array.md b/_episodes/05-r-telemetry-report-array.md index 5ce35d9..37de08e 100644 --- a/_episodes/05-r-telemetry-report-array.md +++ b/_episodes/05-r-telemetry-report-array.md @@ -31,12 +31,12 @@ names(full_receivers) #make a basemap for all of the stations, using the min/max deploy lat and longs as bounding box -base <- get_stamenmap( +base <- get_stadiamap( bbox = c(left = min(full_receivers$stn_long), bottom = min(full_receivers$stn_lat), right = max(full_receivers$stn_long), top = max(full_receivers$stn_lat)), - maptype = "terrain-background", + maptype = "stamen_terrain_background", crop = FALSE, zoom = 6) @@ -84,12 +84,12 @@ We can do the same exact thing with the deployment metadata from OUR project onl names(proj61_deploy) -base <- get_stamenmap( +base <- get_stadiamap( bbox = c(left = min(proj61_deploy$DEPLOY_LONG), bottom = min(proj61_deploy$DEPLOY_LAT), right = max(proj61_deploy$DEPLOY_LONG), top = max(proj61_deploy$DEPLOY_LAT)), - maptype = "terrain-background", + maptype = "stamen_terrain_background", crop = FALSE, zoom = 5) @@ -279,12 +279,12 @@ names(teq_deploy) #make a basemap for your stations, using the min/max deploy lat and longs as bounding box -base <- get_stamenmap( +base <- get_stadiamap( bbox = c(left = min(teq_deploy$DEPLOY_LONG), bottom = min(teq_deploy$DEPLOY_LAT), right = max(teq_deploy$DEPLOY_LONG), top = max(teq_deploy$DEPLOY_LAT)), - maptype = "terrain-background", + maptype = "stamen_terrain_background", crop = FALSE, zoom = 8) @@ -495,12 +495,12 @@ names(glatos_receivers) #make a basemap for all of the stations, using the min/max deploy lat and longs as bounding box -base <- get_stamenmap( +base <- get_stadiamap( bbox = c(left = min(glatos_receivers$deploy_long), bottom = min(glatos_receivers$deploy_lat), right = max(glatos_receivers$deploy_long), top = max(glatos_receivers$deploy_lat)), - maptype = "terrain-background", + maptype = "stamen_terrain_background", crop = FALSE, zoom = 8) @@ -546,12 +546,12 @@ ggsave(plot = glatos_map, filename = "glatos_map.tiff", units="in", width=15, he We can do the same exact thing with the deployment metadata from OUR project only! This will use metadata imported from our Workbook. ~~~ -base <- get_stamenmap( +base <- get_stadiamap( bbox = c(left = min(walleye_recievers$DEPLOY_LONG), bottom = min(walleye_recievers$DEPLOY_LAT), right = max(walleye_recievers$DEPLOY_LONG), top = max(walleye_recievers$DEPLOY_LAT)), - maptype = "terrain-background", + maptype = "stamen_terrain_background", crop = FALSE, zoom = 8) @@ -698,12 +698,12 @@ library(ggmap) names(gmr_deploy) -base <- get_stamenmap( +base <- get_stadiamap( bbox = c(left = min(gmr_deploy$DEPLOY_LONG), bottom = min(gmr_deploy$DEPLOY_LAT), right = max(gmr_deploy$DEPLOY_LONG), top = max(gmr_deploy$DEPLOY_LAT)), - maptype = "terrain", + maptype = "stamen_terrain", crop = FALSE, zoom = 12) diff --git a/_episodes/06-r-telemetry-report-tagger.md b/_episodes/06-r-telemetry-report-tagger.md index 1fcd15a..5232d3e 100644 --- a/_episodes/06-r-telemetry-report-tagger.md +++ b/_episodes/06-r-telemetry-report-tagger.md @@ -31,12 +31,12 @@ Where were my fish observed? We will make a static map of all the receiver stati First, we set a basemap using the aesthetics and bounding box we desire. Next, we add the detection locations onto the basemap and look at our creation! ~~~ -base <- get_stamenmap( +base <- get_stadiamap( bbox = c(left = min(proj58_matched_full_no_release$longitude), bottom = min(proj58_matched_full_no_release$latitude), right = max(proj58_matched_full_no_release$longitude), top = max(proj58_matched_full_no_release$latitude)), - maptype = "terrain-background", + maptype = "stamen_terrain_background", crop = FALSE, zoom = 5) @@ -349,12 +349,12 @@ Where were my fish observed? We will make a static map of all the receiver stati First, we set a basemap using the aesthetics and bounding box we desire. Next, we add the detection locations onto the basemap and look at our creation! ~~~ -base <- get_stamenmap( +base <- get_stadiamap( bbox = c(left = min(tqcs_matched_10_11$longitude), bottom = min(tqcs_matched_10_11$latitude), right = max(tqcs_matched_10_11$longitude), top = max(tqcs_matched_10_11$latitude)), - maptype = "terrain-background", + maptype = "stamen_terrain_background", crop = FALSE, zoom = 8) @@ -645,12 +645,12 @@ Where were my fish observed? We will make a static map of all the receiver stati First, we set a basemap using the aesthetics and bounding box we desire. Next, we add the detection locations onto the basemap and look at our creation! ~~~ -base <- get_stamenmap( +base <- get_stadiamap( bbox = c(left = min(all_dets$deploy_long), bottom = min(all_dets$deploy_lat), right = max(all_dets$deploy_long), top = max(all_dets$deploy_lat)), - maptype = "terrain-background", + maptype = "stamen_terrain_background", crop = FALSE, zoom = 8) @@ -913,12 +913,12 @@ Where were my fish observed? We will make a static map of all the receiver stati First, we set a basemap using the aesthetics and bounding box we desire. Next, we add the detection locations onto the basemap and look at our creation! ~~~ -base <- get_stamenmap( +base <- get_stadiamap( bbox = c(left = min(gmr_matched_18_19_no_release$longitude), bottom = min(gmr_matched_18_19_no_release$latitude), right = max(gmr_matched_18_19_no_release$longitude), top = max(gmr_matched_18_19_no_release$latitude)), - maptype = "terrain", + maptype = "stamen_terrain", crop = FALSE, zoom = 12) diff --git a/_episodes/11-act-actel.md b/_episodes/11-act-actel.md index 0a8d3b5..9ea8be4 100644 --- a/_episodes/11-act-actel.md +++ b/_episodes/11-act-actel.md @@ -359,12 +359,12 @@ actel_receivers <- actel_receivers %>% filter(Station.name %in% actel_deployment actel_spatial_sum <- actel_spatial_sum %>% filter(Station.name %in% actel_deployments$Station.name) -base <- get_stamenmap( +base <- get_stadiamap( bbox = c(left = min(actel_deployments$deploy_long), bottom = min(actel_deployments$deploy_lat), right = max(actel_deployments$deploy_long), top = max(actel_deployments$deploy_lat)), - maptype = "toner", + maptype = "stamen_toner", crop = FALSE, zoom = 12) diff --git a/_episodes/12-basic-animation.md b/_episodes/12-basic-animation.md index d62663f..e960576 100644 --- a/_episodes/12-basic-animation.md +++ b/_episodes/12-basic-animation.md @@ -199,7 +199,7 @@ basemap <- bottom = min(one_fish$mean_latitude), right = max(one_fish$mean_longitude), top = max(one_fish$mean_latitude)), - maptype = "stamen_toner_-_lite", + maptype = "stamen_toner_lite", crop = FALSE, zoom = 8) From 990db8f72e9fffce721b13f11137a38dbc33b7fc Mon Sep 17 00:00:00 2001 From: Bruce Delo Date: Wed, 3 Jan 2024 15:24:12 -0400 Subject: [PATCH 2/2] Added stadia API key --- setup.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.md b/setup.md index c5534f4..025013c 100644 --- a/setup.md +++ b/setup.md @@ -27,6 +27,8 @@ install.packages('lubridate') # GGmap - complimentary to ggplot2, which is in the Tidyverse install.packages('ggmap') +#This is a temporarily available API key you can use for plotting StadiaMaps in ggmap this workshop. You SHOULD NOT rely on this key being available after the workshop. +ggmap::register_stadiamaps("b01d1235-69e8-49ea-b3bd-c35b42424b00") # Plotly - Interactive web-based data visualization install.packages('plotly')