[GRASS-dev] text interface for GRASS70

Markus Neteler neteler at osgeo.org
Tue Mar 22 04:22:07 EDT 2011


On Tue, Mar 22, 2011 at 3:38 AM, Glynn Clements
<glynn at gclements.plus.com> wrote:
>
> Pierre Roudier wrote:
>
>> I just compiled grass7-svn (revision 45721) on my server, but I can't
>> initiate any mapset:
>>
>> pierrer at grass:~$ grass70 -text
>> Unable to start GRASS. You can:
>>  - Launch GRASS with '-gui' switch (`grass70 -gui`)
>>  - Create manually GISRC file (/home/pierrer/.grass7/rc)
>>  - Launch GRASS with path to the location/mapset as an argument
>> (`grass70 /path/to/location/mapset`)
>>
>> It is a remote machine without X, so I can't really use the graphical
>> way. For the other options, I understand I should have a location +
>> mapset already on my server (which is not the case).
>>
>> I could certainly copy one of my local projects on the server bu I was
>> wondering if that was a bug of the text interface. I understand this
>> is related to this bug:
>> http://osgeo-org.1803224.n2.nabble.com/GRASS-7-CLI-startup-td5923640.html
>
> 7.0 doesn't have a curses version of database/location/mapset dialog
> (or of anything else; all curses-based functionality has been
> removed).
>
> As suggested in the above message, specifying the path to an existing
> mapset directory as an argument should work (but probably doesn't get
> much testing). The "demolocation" location should be installed under
> $GISBASE; you may be able to use that, provided that you own the
> PERMANENT mapset. Once you have started GRASS, you can create a new
> database/location/mapset with "g.mapset -c ...".
>
> If you don't own the demolocation/PERMANENT directory, you can create
> a copy which you do own with e.g. "cp -r ..." and use that.
>
> Ultimately, we really need to add e.g. a "-c" flag to the grass70
> script to allow the creation of a new database/location/mapset on
> systems where the GUI cannot be used.


Here an older posting which may be useful:

On Thu, Jul 30, 2009 at 8:13 PM, Glynn Clements
<glynn at gclements.plus.com> wrote:
> Without the GUI, you currently have to create a new location manually,
> e.g.:
>
> 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
> this.

See in Addons also "grass_create_location.sh" for this:
http://trac.osgeo.org/grass/browser/grass-addons/general/grass_create_location

(it should better be a Python script, consider above a proof
of concept)

Markus


More information about the grass-dev mailing list