The function calculates the distance from a set of points to all cells of a RasterLayer.
The distance unit is in meters if the RasterLayer is not projected (+proj=longlat) and in map units (typically meters) when it is projected.
Usage
distanceFromPoints(object, xy, filename='', ...)
Arguments
object
RasterLayer object
xy
Matrix of x and y coordinates, or a SpatialPoints* object.