<div dir="ltr">Hi all,<div><br></div><div>of course it is possible to load the raster maps directly via spgrass6. However, we use this work</div><div>flow also to exchange some of the maps between different users (e.g. via email) and to permanently</div>
<div>store single files (geotiffs that contain the proj information within the file). So, I agree that using spgrass6 would be much more efficient, but I'll stick to exporting to geotiffs and so I need to solve the issues with NA's.</div>
<div><br></div><div>/Johannes</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Sep 4, 2014 at 2:31 PM, Thomas Adams <span dir="ltr"><<a href="mailto:tea3rd@gmail.com" target="_blank">tea3rd@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Johannes,<br><br></div>If you want to read your file into R, there is no need to export your map from GRASS to do this. Simply install and use the R contributed package 'spgrass6' (spgrass6 has R dependencies that need to be installed first); it works wonderfully:<br>

<br></div><div>Within GRASS, at the GRASS terminal prompt...<br></div><div><br>> library(spgrass6)<br>Loading required package: sp<br>Loading required package: XML<br>GRASS GIS interface loaded with GRASS version: GRASS 7.0.0beta3 (2014)<br>

and location: ohrfc_mpe<br>> dat<-readRAST6("xmrg0101200306z")<br>> image(dat)<br><br></div><div>This is far more efficient.<br></div><div><br></div>Tom<br><div class="gmail_extra"><br><br><div class="gmail_quote">
<div><div class="h5">
On Thu, Sep 4, 2014 at 5:32 AM, Johannes Radinger <span dir="ltr"><<a href="mailto:johannesradinger@gmail.com" target="_blank">johannesradinger@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><div class="h5">
<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.     <a href="tel:0.5294496" value="+495294496" target="_blank">0.5294496</a><br>1st Qu.  <a href="tel:0.7171210" value="+497171210" target="_blank">0.7171210</a><br>Median   <a href="tel:0.7871540" value="+497871540" target="_blank">0.7871540</a><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?<span><font color="#888888"><br><br></font></span></div><span><font color="#888888"><div>/Johannes<br>
</div></font></span></div>
<br></div></div><div class="">_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br></div></blockquote></div><br><br clear="all"><br></div></div>
</blockquote></div><br></div>