[GRASS-dev] C function which returns raster and additional info?

Rainer M Krug r.m.krug at gmail.com
Tue Oct 18 04:26:42 EDT 2011


If this mail has made it already to the lst, I apologise - I just could not
find it anywhere.


Hi

I am thinking about the possibility of loading raster directly from GRASS
into R, to avoid the overhang of saving to disk and loading again or having
gdal in between GRASS and R.

As R (using the sp package) holds the raster in memory, I was thinking about
reading the data from GRASS by using a C function, returning the cell values
and additional info (at least the one provided in  esri ACSII file, i.e.
NCOLS, NROWS, XLLCORNER, YLLCORNER, CELLSIZE, NODATA_VALUE) plus
geo-referencing info, so that, back in R, this data can be assembled to
become a spatial object (SpatialGridDataFrame, as defined in the package
sp).

The part in R should be quite easy, as soon as I have the data - so is there
a C function which could help me to get the data?

This would be a first step - in the next step, I would be looking into the
possibility to use a similar way of writing the data to GRASS,

Any ideas, suggestions?

Thanks,

Rainer

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax (F):       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer at krugs.de

Skype:      RMkrug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-dev/attachments/20111018/5caa6999/attachment.html


More information about the grass-dev mailing list