ascgen function

Making Raster Maps From SpatialPoints Objects

Making Raster Maps From SpatialPoints Objects

ascgen creates an object of class SpatialPixelsDataFrame

using a set of points contained in an object of class SpatialPointsDataFrame.

ascgen(xy, cellsize = NULL, nrcol = NULL, count = TRUE)

Arguments

  • xy: an object inheriting the class SpatialPoints
  • cellsize: the cell size (resolution) of the object of class SpatialPixelsDataFrame to be built
  • nrcol: the size of the square raster map to be created (number of rows/columns)
  • count: logical. If TRUE, the resulting object contains the number of points in each cell. If FALSE, all the cells are set to zero

Returns

Returns an object of class SpatialPixelsDataFrame.

Author(s)

Clement Calenge clement.calenge@ofb.gouv.fr

See Also

SpatialPixelsDataFrame-class for additional information on objects of class SpatialPixelsDataFrame and SpatialPoints-class for additional information on objects of class SpatialPoints.

Examples

## generates a random sample of points xy <- matrix(runif(1000), ncol=2) ## coerce them to SpatialPoints xy <- SpatialPoints(xy) plot(xy) ## generate a SpatialPixelsDataFrame ## (and count the number of points) spd <- ascgen(xy, cellsize=0.1) image(spd)
  • Maintainer: Clement Calenge
  • License: GPL (>= 2)
  • Last published: 2024-09-06

Useful links