powered by
Given a raster object, an extent, or a bounding box, a raster of with square cells and having the extent and number of cells specified is returned.
# S4 method for matrix squareRaster(x,cells=NULL, buffer=0) # S4 method for Raster squareRaster(x,cells=NULL, buffer=0) # S4 method for Spatial squareRaster(x,cells=NULL, buffer=0) # S4 method for Extent squareRaster(x,cells=NULL, buffer=0)
A bounding box from a SpatialPoints or SpatialPolygons object or an Extent from a Raster.
SpatialPoints
SpatialPolygons
Extent
The number of cells in the x direction. If NULL the number of columns of x is used.
Additional area to add around the resulting raster
A rasterLayer with square cells
rasterLayer
# NOT RUN { myraster = raster(matrix(0,10,10),xmn=0,xmx=10,ymn=0,ymx=12.3) squareRaster(myraster) squareRaster(extent(myraster), cells=10) squareRaster(bbox(myraster), cells=10) # }
Run the code above in your browser using DataLab