raster (version 1.0.0-1)

distanceFromPoints: Distance from points

Description

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.
filename
Filename for the output RasterLayer
...
Additional arguments. See Details.

Value

  • A RasterLayer object

Details

The following additional arguments can be passed, to replace default values for this function rll{ format Character. Output file type. See writeRaster datatype Character. Output data type. See dataType overwrite Logical. If TRUE, "filename" will be overwritten if it exists progress Character. Valid values are "text", "tcltk", "windows" (on that platform only) and "" }

See Also

distance, gridDistance, pointDistance

Examples

Run this code
r <- raster(ncol=36,nrow=18)
xy = c(0,0)
dist <- distanceFromPoints(r, xy) 
#plot(dist)

Run the code above in your browser using DataLab