Skip to contents

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 by outside_range and 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 by at_sea.

water

Raster of the water fraction or percentage of ~1 km cells (e.g. download_landcover("water")). Coarse fallback for at_sea when no land polygons 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 urban test. If NULL, Natural Earth urban areas are downloaded when that test runs.

Value

A list of class filter_layers.

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"))
} # }