rayshader uses height matrix filled by column, not by rows
Pakillo opened this issue · 0 comments
Pakillo commented
library(terra)
#> terra 1.5.21
library(raster)
#> Loading required package: sp
r = rast(nrows = 3, ncols = 3, xmin = 0, xmax = 3, ymin = 0, ymax = 3,
resolution = 1, vals = 1:9)
plot(r)
raster <- raster(r)
m <- matrix(raster::extract(raster, raster::extent(raster)),
nrow = ncol(raster), ncol = nrow(raster))
m
#> [,1] [,2] [,3]
#> [1,] 1 4 7
#> [2,] 2 5 8
#> [3,] 3 6 9
Need to transpose resulting matrix in terra_to_matrix