Produces an animation of annual forest change in the area bounded by the
extent of a given AOI, or AOIs. The AOI polygon(s) is(are) also plotted on
the image. The gfc_stack
must be pre-calculated using the
annual_stack
function. The animation can be either an animated
GIF (if type
is set to 'gif') or a series of '.png' files with a
corresponding '.html' webpage showing a simple viewer and the forest change
animation (if type
is set to 'html'). The HTML option is recommended
as it requires no additional software to produce it. The animated GIF option
will only work if the imagemagicK software package is installed beforehand
(this is done outside of R).
animate_annual(
aoi,
gfc_stack,
out_dir = getwd(),
out_basename = "gfc_animation",
site_name = "",
type = "html",
height = 3,
width = 3,
dpi = 300,
dataset = "GFC-2022-v1.10"
)
one or more AOI polygons as a SpatialPolygonsDataFrame
or sf
object. If there is a 'label' field in the dataframe, it will be used to
label the polygons in the plots. If the AOI is not in the WGS84 geographic
coordinate system, it will be reprojected to WGS84.
a GFC product subset as a
RasterStack
(as output by annual_stack
)
folder for animation output
basename to use when naming animation files
name of the site (used in making title)
type of animation to make. Can be either "gif" or "html"
desired height of the animation GIF in inches
desired width of the animation GIF in inches
dots per inch for the output image
which version of the Hansen data to use
annual_stack
was run
annual_stack