Collects the optional spatial data used by the layer-based tests of
filter_occurrences(). A test runs only when its layer is supplied. Each
argument accepts a file path or an object already in memory.
Usage
filter_layers(
range = NULL,
land = NULL,
water = NULL,
climate = NULL,
built = NULL,
cropland = NULL,
ghs_mean = NULL,
ghs_max = NULL,
urban = NULL
)Arguments
- range
Species range polygon(s) (
sf, terra::SpatVector or a path to e.g. a shapefile), any CRS. Used byoutside_rangeand to exempt records inside the range from the isolation tests.- land
Detailed land polygons, e.g. the GSHHG shoreline from
download_shoreline()or OpenStreetMap land polygons. Used byat_sea.- water
Raster of the water fraction or percentage of ~1 km cells (e.g.
download_landcover("water")). Coarse fallback forat_seawhen nolandpolygons are given, and used to pick candidate records for the shoreline test when both are given.- climate
Climate raster for the climate tests (e.g. CHELSA bio10), in the units your thresholds use.
- built, cropland
Rasters of built-up and cropland fraction or percentage (e.g. from
download_landcover()). Fractions (0-1) are converted to percent automatically.- ghs_mean, ghs_max
GHS-BUILT-S derived rasters: mean and maximum built-up m2 per 100 m cell within ~1 km cells (see
aggregate_ghs()).- urban
Urban-area polygons for the CoordinateCleaner
urbantest. IfNULL, Natural Earth urban areas are downloaded when that test runs.
Examples
if (FALSE) { # \dontrun{
lay <- filter_layers(range = "range.shp",
land = download_shoreline("data/coast"),
climate = "CHELSA_bio10_1981-2010_V.2.1.tif",
built = download_landcover("built", "data"))
} # }
