ailich / GLCMTextures

This R package calculates the most common gray-level co-occurrence matrix (GLCM) texture metrics used for spatial analysis on raster data.
https://ailich.github.io/GLCMTextures/
GNU General Public License v3.0
12 stars 4 forks source link

as.int fails in "quantize_raster" #11

Closed KlilNoy closed 2 years ago

KlilNoy commented 2 years ago

Hello, While trying the code on WorldView2 images (11bit), we got the following error: Error: 'as.int' is not an exported object from 'namespace:terra'

using the data included in the package, same error appears.

r<- rast(volcano, extent= ext(2667400, 2667400 + ncol(volcano)*10, 6478700, 6478700 + nrow(volcano)*10), crs = "EPSG:27200") 
quantized <- quantize_raster(r, n_levels = 16,  method = "equal prob")
Error: 'as.int' is not an exported object from 'namespace:terra'

Thanks in advanced, Micha and Klil

ailich commented 2 years ago

@KlilNoy, try upgrading terra to the development version. There's some important functions that haven't reached the CRAN version quite yet. Use install.packages('terra', repos='https://rspatial.r-universe.dev') and then let me know if it works for you.

KlilNoy commented 2 years ago

Thank you very much. this was the problem.