kuwisdelu / matter

Out-of-core statistical computing and signal processing
http://www.cardinalmsi.org
54 stars 4 forks source link

`to_raster()` fails for non-gridded character rasters #27

Closed kuwisdelu closed 3 weeks ago

kuwisdelu commented 2 months ago

This needs to work.

kuwisdelu commented 2 months ago

Reproducible example:

set.seed(1, kind="default")
nr <- 32
nc <- 32
x <- seq(-4, 4, length.out=nr)
y <- seq(1, 3, length.out=nc)
co <- expand.grid(x=x, y=y)
x <- co$x
y <- co$y
vals <- matrix(atan(x / y), nrow=nr, ncol=nc)
vals <- rescale_range(vals, c(0, 1))
vals <- rgb(vals, vals, vals)
to_raster(x, y, vals)
Error in approx2(x, y, vals, interp = "none", nx = nx, ny = ny, tol = c(rx,  : 
  z has an unsupported data type
kuwisdelu commented 3 weeks ago

Fixed by https://github.com/kuwisdelu/matter/commit/9fea34e6338e93a7f9fe19aa7ab7772b89dd5c4a