Use ggpath to create a layer with images at locations
Source:R/layer_image_path.R
layer_image_path.Rd
Use the ggpath::geom_from_path()
function with sfext::read_sf_exif()
and
stat = "sf_coordinates"
to create a layer showing images at locations.
Usage
layer_image_path(
data = NULL,
path = NULL,
path_col = "path",
width = 0.1,
crs = getOption("maplayer.crs", 3857),
segment_params = NULL,
neatline = FALSE,
basemap = FALSE,
...
)
Arguments
- data
A
sf
object with a column containing file paths that has the same name as the path_col argument. Optional if "path" is provided forsfext::read_sf_exif()
. Required if path isNULL
. If path is provided, data is ignored.- path
A path to folder or file.
- path_col
Column name with file paths from data. Defaults to "path" (path name used by data returned from
sfext::read_sf_exif()
)- width
Width of the image in npc (Normalised Parent Coordinates) passed to
ggpath::geom_from_path()
; defaults to 0.1.- crs
The coordinate reference system (CRS) into which all data should be projected before plotting. If not specified, will use the CRS defined in the first sf layer of the plot.
- segment_params
Not implemented: parameters to define segments connecting images to the location.
- neatline
A logical object,
CoordSf
object, or a list containing aCoordSf
object (typically fromlayer_neatline()
) added to layer byset_neatline()
.If logical and
TRUE
, add a neatline layer using data, crs and any additional parameters passed to ... If logical andFALSE
, return x as is.If object from
layer_neatline()
, add it as is.
- basemap
Either a logical vector or ggplot object.
If logical and
TRUE
, add x toggplot2::ggplot()
. IfFALSE
, return x as is.If a ggplot, add x to basemap object.
If a ggproto object (or list that contains a ggproto object), add x and basemap object to
ggplot2::ggplot()
.- ...
Additional parameters to pass to
exiftoolr::exif_read()