[GRASSLIST:4554] Re: grass cmd from php???

Markus Neteler neteler at itc.it
Fri Oct 15 12:21:05 EDT 2004


On Fri, Oct 15, 2004 at 09:52:00AM +0200, Markus Neteler wrote:
> On Fri, Oct 15, 2004 at 01:41:22AM +0100, Glynn Clements wrote:
> > 
> > Massimiliano Cannata wrote:
> > 
> > > Just as a curisity, for a possible future mapserver application....
> > > It is possible to execute a grass command from php?
> > > If yes, how to pass the command? (it should open a grass session with 
> > > all the var needed i guess!)
> > 
> > Essentially, you need to set the appropriate environment variables
> > then run the program. See $GISBASE/etc/Init.sh for a full list of the
> > environment variables which are set for a normal interactive session,
> > but the important ones are GISBASE and GISRC.
> > 
> > For a server, you will need to either dynamically create a mapset for
> > each "session", or manage a pool of mapsets. The key point is that you
> > can't safely run multiple commands simultaneously in a single mapset.
> 
> 
> Maybe this mail thread is also helpful:
> 
>  http://grass.itc.it/pipermail/grass5/2004-August/015106.html

I have made it a quick-and-dirty web page now which generates a
GRASS raster/vector map on the fly:

 http://grass.itc.it/spearfish/php_grassmap.php

You can grab the code there.

Thanks to Sharyn Namnath and Glynn Clements for their comments in
the 'grass5' mailing list.

Cheers

 Markus




More information about the grass-user mailing list