Hi,

I am reading in some raster files and converting them to GeoTiff (using the raster package), I want them to be 8 bit unsigned integer (values in the case of this particular raster range from 0 to 55). However when writing the raster to GeoTiff R seems to assign it to dataType "FLT4S" despite specifying the dataType. See example code below:

foo<- raster(raster.files[1],datatype = INT1U)
dataType(foo)
[1] "INT1U"
fool<- writeRaster(foo,filename=paste("../test/",raster.files[1],sep=""), format="GTiff",dataType = 'INT1U',overwrite=TRUE)
dataType(fool)
[1] "FLT4S"

Any help/ insight would be appreciated. Thanks!


Emma

--
Emma White
PhD Candidate
Geospatial Science Center of Excellence
South Dakota State University
Email: [email protected]
Web: http://globalmonitoring.sdstate.edu/people.php?view=3&a=show&id=86

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to