Update current focal for the next iteration.
update_focal(old_focal, new_rasterized, extent, mw)Focal obtained from terra::focal() for the current
iteration.
Output obtained from update_rasterize()
for the next iteration.
Extent of the cells corresponding to the coordinates with the
highest concentration for the current iteration. Extent is output from
terra::ext().
Moving window obtained from create_mw().
Martin Haringa
Spatial extent refers to the geographic area covered by a spatial dataset. It defines the boundaries in terms of its geographic coordinates (north, east, south, west).
An focal is updated by the following steps:
The extent of the cells corresponding to the coordinates with the highest concentration (xmin, xmax, ymin, ymax) is determined.
A buffer of size two times the radius plus the cell size around this extent. All cells within this new extent will impact the focal values.
Subset (crop) the rasterized data to include only the cells within this new extent. Perform focal calculations only for these new cells.
As the focal values of the cells near the borders may be inflated, crop the result again to include only the cells within a radius of the original extent.
Merge this updated focal with the previous focal object.