Skip to contents

This function takes species occurrence data, generates a buffer around each occurrence point, rasterizes the buffer onto a given raster template, and converts the resulting raster data into a long-format data.table. The buffer distance can be specified by the user.

Usage

make_buffer_rasterized(DT, file, dist = 500)

Arguments

DT

A data.table or data.frame containing species occurrence data. The data should include the columns: decimalLatitude, decimalLongitude, family, genus, and species.

file

A file path to the raster file that will be used as a template for rasterizing the buffers.

dist

A numeric value specifying the buffer distance in meters. Default is 500 meters.

Value

A data.table in long format with two columns: cell, indicating the raster cell number, and species, indicating the species name corresponding to the cell.

Examples

if (FALSE) { # \dontrun{
# Assuming DT contains species occurrence data and 'raster_file.tif' is the raster template
buffer_df <- make_buffer_rasterized(DT, file = "raster_file.tif", dist = 500)
} # }