Starting with rasterpic is very easy! You just need an image (png, jpeg/jpg or tif/tiff) and a spatial object from the sf or the terra package to start using it.
Basic usage
Here we use the shape of Austria as an example:
Options
The function provides several options for expansion, alignment, and cropping.
Expand
With this option, the image is expanded beyond the spatial object:
Alignment
Decide where to align the image:
Crop and mask
Create impressive maps:
Supported objects for geotagging
- Spatial objects of the sf package:
sf, sfc, sfg or bbox.
- Spatial objects of the terra package:
SpatRaster, SpatVector, SpatExtent.
- A vector of coordinates with the form
c(xmin, ymin, xmax, ymax).
rasterpic can parse the following image formats:
-
png files.
-
jpg/jpeg files.
-
tif/tiff files.