I am working with R and use the following libraries: raster, sp, rgeos, rgdal
I created a RasterLayer from a SpatialPointsDataFrame. This raster can easily be exported using
raster::writeRaster(ras8b,
filename="filepath", format="GTiff" ,
datatype='INT1U')
The problem which I run in is the following: I need a 8BitsPerPixel GeoTiff. But the code I use saves the raster to an 64 BitsPerPixel Raster.
I tried to solve the problem already following several options I found on StackOverflow. For example: RasterLayer 16-bits into a RasterLayer 8-bits
This first option gave me a 8 BitsPerPixel raster, but no values in it, just NAs.
Or I converted the RasterLayer in R to integer following this post: https://gis.stackexchange.com/questions/175383/round-does-not-return-an-integer-raster-in-r/175384
But R continues to store the Raster as 64 BitsPerPixel Raster.
Somebody has a solution? If you need more information just let me know. Thanks a lot. Best regards.