Transformation of an sf object into raster
Function transforming an object of class sf into raster (points grid) with wd
, the pixel size of the raster. landname
gives the variable names for which raster points have to be computed.
landtoraster(landgis, landname, wd, data = NULL)
landgis |
an object of class sf |
landname |
vector of names of landscape variable for which rasters are computed. |
wd |
numeric, pixels size of raster |
data |
a dataframe with X and Y columns, locations. |
a list of dataframes. The components of the list correspond to variables specifed in argument landname. Each dataframe gives the X and Y locations of pixels in raster.
O. Martin
##---- Should be DIRECTLY executable !! ---- ##-- ==> Define data, use random, ##-- or do help(data=index) for the standard data sets. data(dataSiland) data(landSiland) head(dataSiland) head(landSiland) u1=landtoraster(landSiland,c("L1","L2"),wd=20) names(u1) plot(u1[[1]][,c("X","Y")],pch=".") u2=landtoraster(landSiland,c("L1","L2"),wd=20,data=dataSiland) points(u2[[1]][,c("X","Y")],pch=".",col=2) points(dataSiland[,c("X","Y")],pch=16,cex=0.6,col=3)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.