Skip to contents

Extract values from one or more GeoTIFF images based on a set of point locations, supplied as (x, y) or (longitude, latitude) coordinates. If a path to a folder is provided, all images in the folder will be processed.

Usage

extract_values(path, xy_coords, method = "simple")

Arguments

path

path to a folder containing one or more GeoTIFF files e.g. "~/Documents/rasters", or path pointing to one or more GeoTIFF files e.g. c("~/rasters/clay.tif", "~/rasters/density.tif")

xy_coords

a data frame of (x, y) or (longitude, latitude) coordinates. Note the order - incorrect order of coordinates may result in erroneous or NaN results.

method

one of "simple", which returns the exact value at the cell or pixel that the point falls in, or "bilinear", which returns a value interpolated from the values of the four nearest raster cells.

Value

a data frame of values