[GRASSLIST:4623] Re: libgrass problems

Glynn Clements glynn at gclements.plus.com
Fri Oct 22 21:45:41 EDT 2004


Dylan Beaudette wrote:

> ....After the helpful suggestion as to where to get libgrass, I am having 
> problems actually using it...
> 
> an example:
> --------------------------- 
> gdal_translate -of GTIFF cumulative_beam_irradiation ~/export/beam.tiff
> ERROR 1: libgrass: MAPSET is not set
> Aborted
> ---------------------------
> 
> Any ideas?

[I haven't actually used libgrass, but as it's based upon the core
GRASS libraries, I assume that it requires a similar environment.]

At a minimum, the environment variable $GISRC has to refer to a file
which contains valid settings for GISDBASE, LOCATION_NAME and MAPSET. 
This determines where maps are found.

When you start a GRASS session, $GISRC is set to ~/.grassrc5 (5.0.x
and early 5.3), ~/.grassrc53 (recent 5.3) or similar (it's a bit more
complex in 5.7), and that file is initialised from the settings
entered into the startup dialog.

So, if you use it from within a GRASS session, there shouldn't be any
problems. Or you can just point $GISRC at an existing ~/.grassrc53 (or
similar) file, and it will use those settings. Or you can create your
own file and point $GISRC at that.

It may (or may not) also be necessary for $GISBASE to point to the
root of a GRASS installation (e.g. /usr/local/grass5). If libgrass
needs to access certain data files or helper programs, it might use
$GISBASE to locate them.

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-user mailing list