<div dir="ltr">Hi,<div><br></div><div>I want to export a raster map (FCELL) from GRASS70 to the geotiff format using r.out.gdal and to import it later on in R. The map contains many no data values.<br><br></div><div>Here some details about the raster:<br>
Type of Map:  raster               Number of Categories: 0<br>Data Type:    FCELL<br>Rows:         750  <br>Columns:      750 <br>Total Cells:  562500     <br>total null and non-null cells: 15105636<br>total null cells: 15105047<br>
<br></div><div>So when I export the map, r.out.gdal reports: "Input raster map contains cells with NULL-value (no-data). The value -nan will be used to represent no-data values in the input map. You can specify a nodata value with the nodata option."<br>
<br></div><div>When I subsequently try to import the geotiff into R (using the package 'Raster') the nodata values are not recognised as NA's:<br><br>a <- raster("*.tif")<br></div><div>summary(a)<br>
Min.     0.5294496<br>1st Qu.  0.7171210<br>Median   0.7871540<br>3rd Qu.  1.1581826<br>Max.     1.5494517<br>NA's     0.0000000<br><br></div><div>So I am wondering if I need to set any specific parameter during the export (r.out.gdal) or import (raster()).<br>
<br></div><div>As I am not only exporting FCELL (Float32) raster but also multiple (N=500) other rasters to R I would be interested in a solution also for DCELL (Float64). Of course I can export all of as Float64 as the file size should not be a problem.<br>
<br></div><div>Any suggestions or experiences of handling NA's during raster exchange between GRASS and R?<br><br></div><div>/Johannes<br></div></div>