
Download and georeference photos
get_photos.RdDownload and georeference photos
Arguments
- source
character; url(s) build fromfind_photos().- outdir
characterorNULL; Directory where photos will be saved. Defaults toNULL, in which case the package user overwrite directory (tools::R_user_dir()) is used.- mode
character; One of :"raw": download photos as-is, with no spatial reference."gcp": download and attach Ground Control Points (GCPs). The photo is georeferenced but not resampled onto a regular grid."warp": download, georeference, and warp using GDAL. The photo is resampled to a grid, ensuring compatibility with most GIS software.
- quiet
logical. IfTRUE, suppress progress messages. Default toFALSE.- overwrite
logical. IfTRUE, existing files are overwritten. Default toFALSE.
Details
Georeferencing performed by "gcp" or "warp" is only a first approximation,
based on the scale and orientation metadata provided with the scans.
This positioning can be significantly inaccurate. For precise work,
users should refine the georeferencing manually in a GIS software.
To assist with manual georeferencing, see get_georef_helpers()
The affine transformation is used, which means no geometric deformation is applied beyond shift, rotation, and scale. All georeferenced outputs are written in EPSG:3857 (Web Mercator).
Examples
if (FALSE) { # \dontrun{
library(sf)
library(terra)
x <- read_sf(system.file("extdata/penmarch.shp", package = "happign"))
image_metadata <- find_photos(x, 1969)
tmp <- tempdir()
photo <- get_photos(image_metadata$url[1], tmp)
plot(rast(photo))
} # }