[GRASSLIST:1060] Re: automating grass database creation.

Glynn Clements glynn.clements at virgin.net
Thu Aug 28 01:10:25 EDT 2003


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 at virgin.net>




More information about the grass-user mailing list