gridDistance

0th

Percentile

Grid distance

The function calculates the distance to cells of a RasterLayer when the path has to follow the center of neighboring raster cells (currently only implemented as a 'queen' case). Origin cells should have value TRUE (or 1), destination cells should be NA and cells that can not be traversed should be set to FALSE (or 0). The distance is in meters if the RasterLayer is not projected (+proj=longlat) and in map units (typically meters) when it is projected. Distances are calculated by summing local distances between cells, which are connected with their neighbours in 8 directions. This function currently only works for RasterLayer objects of which all values can be stored in memory

Keywords
spatial
Usage
gridDistance(x, filename = "", ...)
Arguments
x
a RasterLayer object
filename
character. output filename
...
additional arguments. See Details.
Details

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

Value

  • A RasterLayer object

See Also

For more options (directions, cost-distance) see the gdistance package on R-forge

Aliases
  • gridDistance
Examples
r <- raster(ncol=36,nrow=18)
r[] <- NA
r[500] <- 1
distRaster <- gridDistance(r) 
plot(distRaster)
Documentation reproduced from package raster, version 1.0.0-1, License: GPL (>= 3)

Community examples

Looks like there are no examples yet.