[GRASS-user] GRASS 7.0 svn location/map creation using console

Glynn Clements glynn at gclements.plus.com
Thu Jul 30 14:13:47 EDT 2009

[CC to grass-dev]

Enrico Gallo wrote:

> I can  use g.proj and g.mapset only inside GRASS environment,
> but if  I have non correct location I cannot enter in GRASS 7.x from
> console, using -text flag, of course

Without the GUI, you currently have to create a new location manually,

olddbase=`g.gisenv get=GISDBASE`
g.gisenv set=GISDBASE=/path/to/database
g.proj -c location=newlocation ...
g.gisenv set=GISDBASE=$olddbase
g.mapset -c gisdbase=/path/to/database location=newlocation mapset=newmapset
g.mapset gisdbase=/path/to/database location=newlocation mapset=newmapset
g.region -d

Note that GRASS 7 includes a dummy location at $GISDBASE/demolocation;
this can be used to get into GRASS, provided that you're the owner of
the GRASS installation (probably root).

For developers:

1. init.{sh,py} need an option to create a new database/location/mapset
without using the GUI.

2. g.proj should have a database= option so that -c can create a new
database along with the location.

3. g.mapset complains if the current database/location/mapset aren't
valid; it should probably be changed to use G_no_gisinit() to handle

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-user mailing list