Lists available images for a camera and downloads them to a local directory. Images are fetched directly from USGS S3 storage; no API key is required for the downloads themselves.
Usage
download_images(
cam_id = NULL,
dest_dir,
size = "small",
limit = 1000L,
time = NULL,
overwrite = FALSE,
site_id = NULL
)Arguments
- cam_id
Character. Camera identifier. Use
find_cameras()to look up valid IDs. Cannot be used together withsite_id.- dest_dir
Character. Path to an existing local directory where images will be saved.
- size
Image size passed to
build_image_url(). One of"small"(default),"overlay", or"thumb".- limit
Integer between 1 and 50000. Page size for the internal
list_images()call. Default is1000. All images in the requested time range are downloaded via automatic pagination.- time
POSIXct, Date, or character vector of length 1 or 2 used to filter images by capture time. A length-1 value is treated as a start (on or after). A length-2 vector sets the start and end; use
NAfor an open bound. Seelist_images()for full details.- overwrite
Logical. If
FALSE(default), skip files that already exist indest_dir(resume behaviour).- site_id
Character. NWIS site number (e.g.
"05366800"or"USGS-05366800"). Cannot be used together withcam_id. If the site has more than one camera, supplycam_iddirectly.