[STATSGRASS] libgrass

Roger Bivand Roger.Bivand at nhh.no
Fri Dec 14 04:00:33 EST 2001


On Thu, 13 Dec 2001, Markus Neteler wrote:

> Roger, did you ever look at the "libgrass" library from
> Frank Warmerdam? We recently updated it to connect
> MapServer directly to GRASS (see it working here:
> http://grass.itc.it/start.html
> a primitive version only to proof that it is running).
> 
> Using this library 
> http://grass.itc.it/related_projects.html
> -> libgrass: Standalone GRASS 5 I/O Library to directly read/write GRASS
> Databases. 
> 
> you may exchange data directly. See 
> gdal/frmts/grass
> GDAL how to use the library if you are interested.
> 
Yes but no. If GRASS database files were "standalone" - they could exist
outside the $GISDBASE structure - there might be some good reason for
going with libgrass (which for GDAL is fine). This would correspond to the
logic of shapelib, say. However, the interface with R at the moment
presupposes that GRASS is there too, because the data objects and programs
are so closely meshed. It seems natural to be able to do:

system("g.list rast")

before doing

rast.get()

for instance. If the data were in arbitrary directories (like the output
of r.out.bin) then a looser coupling to the other GRASS programs is
sensible (like your MapServer example which is nice and surprisingly
fast!). MapServer isn't going to want to do any regular GRASS - the GRASS
DBASE is just a back-end - isn't it? The road queries are not being done
in GRASS, are they?

Of course the R/GRASS interface could equally well be compiled against
libgrass, but my guess is that having the include and lib directories in
GISBASE is an equally good route, especially because the interface and the
GRASS programs will be using the same libgis.a.

I'm also looking (not top priority) general GDAL support in R, but here
the points made by Agus about data volumes are very relevant.

Roger

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand at nhh.no
and: Department of Geography and Regional Development, University of
Gdansk, al. Mar. J. Pilsudskiego 46, PL-81 378 Gdynia, Poland.




More information about the grass-stats mailing list