[GRASSLIST:3256] RE: creating new mapset/location in batch-mode

Hamish hamish_nospam at yahoo.com
Thu Apr 22 02:39:06 EDT 2004

> >We are working on an internet application which uses grass for
> >interpolation (idw).
> >The user can select the kind of point data to send to grass. Now a
> >shellscript will be executet to get
> >back a .tif +  .tfw  viewd  by  the  umn  mapserver.
> >
> >what happens when  two users start one grass location with the same
> >mapset at the same time.
> >is it possible to start idw two times with different mapsets but the
> >same location and how can i create
> >a new mapset/location in batchmode.

I think it's best to keep all the base maps in a read-only mapset, and
access them with the "map at mapset" external-mapset referer.

For each process, you can make a new mapset (eg. "wwwtemp.$$") by making
a new directory by that name and copying a region (WIND) file into that
directory. Change to the new mapset with the attached script, have it
do its thing, then remove the entire directory (mapset) before finishing
the process. Maybe a cron-job to clean up any aborted mapsets [*] to
avoid disk space problems.

[*] either stop everything or test against pgrep numbers to avoid
removing a live mapset?

attached: script for changing to a new mapset, "g.nm"
It's well tested here.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: g.nm
Type: application/octet-stream
Size: 624 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20040422/35a58814/g.obj

More information about the grass-user mailing list