getStatsAlongLine: Get the mean raster values along a line

Description Usage Arguments Details Value See Also

View source: R/getStatsAlongLine.R

Description

This is applies raster::extract() but does some checking on the projection of the inputs. Set d=0 to get value at the points.

Usage

1
getStatsAlongLine(r, p, l = NULL, d = 0, na.rm = TRUE)

Arguments

r

the raster as a raster::raster object

p

the points as a sp::SpatialPoints object

l

the lines as a sp::SpatialLines object if d is not 0.

d

distance to average along the line. Distance is in the units of the points and raster objects

na.rm

whether to remove NAs in the raster when computing the average

Details

If there are multiple lines within the radius of d, then the average is over all lines covered in that radius. The segments to average is determine by a circle around the points.

Value

raster values around the points

See Also

checkunits()


UW-Upwelling-Project/imageryML documentation built on Dec. 18, 2021, 6:11 p.m.