[GRASSLIST:155] running grass commands from CGI script

Matt Doggett mdoggett at coas.oregonstate.edu
Fri May 23 15:50:54 EDT 2003


I am putting together a system using Mapserver to render maps online
that are derived from GRASS raster grids. I am using CGI to POST to a
cgi-bin executable which then invokes a series of GRASS commands to
generate the raster before returning to Mapserver to display the
results.  This process works GREAT except for the following:


* r.mapcalc will "freeze" causing an apache timeout error.  To be
precise, actually, invoking r.mapcalc a large (N) number of times will
cause the server to timeout.  I'm not exactly sure what N is the
critical threshold that causes problems (somewhere around 10 or so).  I
have a simple process that calls r.mapcalc about five times and doesn't
cause any problems.  I have another complex function that can
potentially call r.mapcalc dozens of times.  It is this complex function
that fails.

* This process fails ONLY when running through the CGI process and the
apache webserver.  As a shell script from the command line...no
problems, no errors.

* I can run any number of other grass commands (e.g. g.rename, g.copy,
r.report, whatever). It seems to be only the r.mapcalc command that
offends apache.

Has anyone done anything like this before and succeeded?  Obviously the
problem lies BOTH in Apache and r.mapcalc. Any suggestions?

Matt

Matt Doggett
Spatial Climate Analysis Service
Oregon State University
316 Strand Ag Hall
Corvallis, OR 97331
(541)737-9153
mdoggett at coas.oregonstate.edu
 




More information about the grass-user mailing list