squareRaster-methods | R Documentation |
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 signature 'matrix'
squareRaster(x,cells=NULL, buffer=0)
## S4 method for signature 'SpatRaster'
squareRaster(x,cells=NULL, buffer=0)
## S4 method for signature 'SpatVector'
squareRaster(x,cells=NULL, buffer=0)
## S4 method for signature 'SpatExtent'
squareRaster(x,cells=NULL, buffer=0)
x |
A spatial object |
cells |
The number of cells in the x direction. If NULL the number of columns of x is used. |
buffer |
Additional area to add around the resulting raster |
A SpatRaster
with square cells
myraster = rast(matrix(0,10,10),extent=c(0,10,0,12.3))
squareRaster(myraster)
squareRaster(myraster, buffer=3, cells=20)
squareRaster(ext(myraster), cells=10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.