[GRASS-user] Original location: How to create from the command line ?

Hamish hamish_b at yahoo.com
Mon Jan 19 16:00:00 EST 2009


Peter wrote:
>>>>> is there an (easy) recipe to create a completely new location from
>>>>> scratch without using a GUI ?
>>>> To be precise: If GRASS is started for the first time in "-text" mode
>>>> (=no GUI) ** without having a sample location like Spearfish or
>>>> North >>>> Carolina around**, how can location parameters
>>>> (projection, extent, EPSG...) be handed over to set up a very first
>>>> location ?
>>> is there also a way to provide the parameters _without_ interaction
>>> with the user (-> GRASS scripting & automation)

Glynn:
> > You can create a new location and mapset with "g.proj -c ...", then
> > make it current with g.mapset. But those are GRASS commands, and only
> > work within GRASS.

Moritz:
> I imagine that you can create your own location by having a
> script create the location directory, the PERMANENT mapset
> directory and the PROJ_INFO, DEFAULT_WIND and PROJ_UNITS
> files, or ?


So what we need is a wrapper script that will create a dummy location/
mapset in /tmp/ and run 'grass64 + g.proj -c' via a GRASS_BATCH_JOB (be
it .sh or .py). Any hints on how the man page parts of the build process
accomplish this?

To give access to g.parser, could the enviro vars be set up at the start
of the script so the thing could bootstrap itself? ie can we somehow
find a way to use the GRASS parser from the non-GRASS command line? I'm
guessing this is not easy due to the 2-pass way g.parser works, but a
smart devel might be able to make it happen somehow.

Writing a custom shell script parser as a wrapper for g.proj -c and all
its options seems rather non-ideal, but access to 'g.proj -c' from the
command line outside GRASS seems like a very nice tool. 

how do the Tcl/wx GUIs manage the bootstrapping?


Hamish



      



More information about the grass-user mailing list