OpenRange_sf {OpenRange}R Documentation

Download range maps that intersect a user-supplied sf object.

Description

OpenRange_sf extracts range maps that intersect a specified SpatialPolygons or SpatialPolygonsDataFrame object.

Usage

OpenRange_sf(
  sf,
  directory,
  species.names.only = FALSE,
  return.species.list = TRUE,
  crop.ranges = FALSE,
  include.gid = FALSE,
  projection = 4326,
  scenario = "present",
  default_only = TRUE,
  ...
)

Arguments

sf

An object of class sf

directory

Directory that range maps should be saved in.

species.names.only

Return species names rather than spatial data? Default is FALSE.

return.species.list

Should a species list be returned in addition to downloading range maps? Default is FALSE

crop.ranges

Should the ranges be cropped to the focal area? Default is FALSE.

include.gid

Should the files returned have a unique GID appended to them? This is needed if downloading multiple maps for the same species.

projection

Numeric. What projection should maps be returned in? 4326 (default) or 3857

scenario

Which climate scenario should be represented by maps? See BIEN_ranges_list_scenarios.

default_only

Logical. Should only default ranges be included? Default is TRUE.

...

Additional arguments passed to internal functions.

Value

All range maps that intersect the user-supplied shapefile.

Note

Details on the construction of BIEN range maps is available at https://bien.nceas.ucsb.edu/bien/biendata/bien-3/

See Also

Other range functions: OpenRange_api_load_species(), OpenRange_api_species(), OpenRange_get_license(), OpenRange_get_stats(), OpenRange_list_scenarios(), OpenRange_load_species(), OpenRange_species()

Examples



saguaro_poly <- OpenRange_load_species("Carnegiea gigantea")

#Create a temp directory
temp_dir <- file.path(tempdir(), "BIEN_temp")

#Get range maps for all species with ranges that overlap the range range of saguaros
OpenRange_sf(sf = saguaro_poly,
           directory = temp_dir)

#Note that this will save many sfs to the directory (or working directory)


[Package OpenRange version 0.0.1 Index]