I have to build a 8 bits raster as ascii
(.asc
). I'm trying to use R writeRaster fonction, however it is not working:
Reproducible example:
library(raster)
rr <- raster(matrix(sample(1:100, 100),10,10), xmn=0, xmx=10, ymn=0, ymx=10)
writeRaster(rr, "D:/temp/test_tif.asc", datatype="INT1U", overwrite=T)
dataType(raster("D:/temp/test_tif.asc"))
[1] "INT4S"
This is not working, however when using tif
, the same script works:
writeRaster(rr, "D:/temp/test_tif.tif", datatype="INT1U", overwrite=T)
dataType(raster("D:/temp/test_tif.tif"))
[1] "INT1U"
Any idea why it isn't working for asc
?