Outdoors

Day 20 of 30DayMapChallenge
R
30DayMapChallenge
spatial
datavisualization
Author

Michaël

Published

2023-11-20

Modified

2023-11-22

A photo of the Porcupine River in the Yukon Flats

Porcupine River – public domain by David Spencer, FWS

Day 20 of 30DayMapChallenge: « Outdoors » (previously). Get some fresh air in Alaska!

Setup

library(terra)
library(viridis)

Data

You can browse several DEM datasets on https://elevation.alaska.gov/#66.53733:-145.25385:13. Yukon Flats by Lidar look promising…

dtm_file <- "yukon_flats_usgs_2pt5_dtm.tif"

if (!file.exists(dtm_file)) {
  download.file("https://elevation.alaska.gov/download?geojson=%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-145.4186%2C66.5036%5D%2C%5B-145.4186%2C66.5710%5D%2C%5B-145.0891%2C66.5710%5D%2C%5B-145.0891%2C66.5036%5D%2C%5B-145.4186%2C66.5036%5D%5D%5D%7D&ids=134",
                "custom_download.zip")
  unzip("custom_download.zip")
  unzip("dds4/yukon_flats_usgs/dtm/yukon_flats_usgs_2pt5_dtm.zip")
}

Map

rast(dtm_file) |> 
  crop(ext(572000, 582000, 7370000, 7380000)) |> 
  plot(col = rev(magma(256)), axes = FALSE, smooth = TRUE, legend = FALSE)
Colorized Digital Elevation Model of Yukon Flats.
Figure 1: Yukon Flats. Data: USGS/Aero-Metric