[GRASSLIST:1043] automating grass database creation.

I have a large historical database, all with different projections and areal
coverage . . . but consistent enough that I am writing a script to suck this
data into grass.

I have hit a snag, however, in being able to automate the database creation.

For instance, I have written the script to use a "dumby" database to start up
enough to do a "v.in.sdts catd=<my sdts catalog> -i" and redirect so I can
parse out the edges, UTM zone, and name.

Then, I try "grass5 /data/gis/my_files/borders/<NEW_NAME>/PERMANENT

where "borders" is my GISDBASE. "<NEW_NAME>/PERMANENT" is the new area for
storage desired, and I had hoped that grass would prompt me like it does in
interactive mode, to create a new area. But it won't - just gives me:

Not a valid GRASS location

Is there a way to script the creation of a database?
--
Stonie R. Cooper
Planetary Data, Incorporated
(402) 782-6611

Stonie R. Cooper wrote:

I have a large historical database, all with different projections and areal
coverage . . . but consistent enough that I am writing a script to suck this
data into grass.

I have hit a snag, however, in being able to automate the database creation.

For instance, I have written the script to use a "dumby" database to start up
enough to do a "v.in.sdts catd=<my sdts catalog> -i" and redirect so I can
parse out the edges, UTM zone, and name.

Then, I try "grass5 /data/gis/my_files/borders/<NEW_NAME>/PERMANENT

where "borders" is my GISDBASE. "<NEW_NAME>/PERMANENT" is the new area for
storage desired, and I had hoped that grass would prompt me like it does in
interactive mode, to create a new area. But it won't - just gives me:

Not a valid GRASS location

Is there a way to script the creation of a database?

Only by manually creating the directories and essential files. E.g.

  #!/bin/sh
  base=/data/gis/my_files/borders
  loc=<NEW_NAME>
  mkdir $base/$loc
  mkdir $base/$loc/PERMANENT
  cp $base/dummy/PERMANENT/DEFAULT_WIND $base/$loc/PERMANENT
  mkdir $base/$loc/mymapset
  cp $base/$loc/PERMANENT/DEFAULT_WIND $base/$loc/mymapset/WIND
  grass5 $base/$loc/mymapset

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

On Wed, Aug 27, 2003 at 02:42:24PM +0000, Stonie R. Cooper wrote:

I have a large historical database, all with different projections and areal
coverage . . . but consistent enough that I am writing a script to suck this
data into grass.

I have hit a snag, however, in being able to automate the database creation.

I have written such script for raster data (needs r.in.gdal working):

  http://mpa.itc.it/grasstutor/examples.phtml
   -> create_location.sh

Maybe it helps.

Later, after v.in.ogr is extended to generate new locations, we
could provide the same for vector data.

[...]

Markus