Downloading data may take more than 5 minutes.
# from Esri.WorldImagery map tiles
green <- greenSD::get_tile_green(bbox = c(-83.087174,42.333373,-83.042542,42.358748),
provider = "esri",
zoom = 16)
# from Sentinel-2 cloudless mosaic tiles
greenspace2 <- greenSD::get_tile_green(bbox = c(-83.087174,42.333373,-83.042542,42.358748),
zoom = 17,
provider = "eox",
year = 2022)You can extract seasonal greenspace values at multiple point locations within a city boundary.
The to_gif() function converts a multi-band raster
(e.g., greenspace bands across the growing season) into an animated GIF
for quick visual exploration.
# Load example data (or use `gs` from previous step)
sample_data <- terra::rast(system.file("extdata", "detroit_gs.tif", package = "greenSD"))
# Generate GIF
gif <- greenSD::to_gif(
r = sample_data,
fps = 5,
width = 600,
height = 600,
axes = FALSE,
title_prefix = paste("greenspace - Day", 1:terra::nlyr(sample_data) * 10)
)
# Display in RStudio Viewer or save
print(gif)
# To save the GIF manually:
magick::image_write(gif, "greenspace_animation.gif")