[GRASSLIST:1352] Web Mapping

Hi!

Currently I am developing a web mapping tool for GRASS mainly
with PHP for our biodiversity Database.
As I am using the CELL driver for generating pictures I have the
following questions:

How can I reset the CELL driver ? - changing the vars
GRASS_WIDTH and GRASS_HEIGHT to another value after using
the driver gives me error messages.

What does happen if 2 processes try to access the ressource
D_cell at the same time ?

Do I have to write a scedular to avoid ressource conflicts ?

As each process may re- g.region the GRASS-database, do I have
to lock this ressource also ?

kind regards

Mike

DI Michael Malicky
System Administrator ZOBODAT
Biologiezentrum des OOE Landesmuseums
Johann Wilhelm Klein Str. 73
A-4040 Linz
Oesterreich
Tel.: +43/732/759733/33
Fax.: +43/732/759733/99
Homepage: http://www.biologiezentrum.at

Hi Michael,

m.malicky@landesmuseum-linz.ac.at wrote:

Hi!

Currently I am developing a web mapping tool for GRASS mainly
with PHP for our biodiversity Database.
As I am using the CELL driver for generating pictures I have the
following questions:

How can I reset the CELL driver ? - changing the vars
GRASS_WIDTH and GRASS_HEIGHT to another value after using
the driver gives me error messages.

You have to stop and restart the CELL driver (d.mon stop=CELL; export
GRASS_WIDTH=300; d.mon start=CELL). This will need some time as the
memory is allocated every time.

What does happen if 2 processes try to access the ressource
D_cell at the same time ?

That should never be done. Even if it does not crash it will not produce
anything reasonable.
One setup would be to use a temporary mapset within the current location
for each process to avoid this. Or the CELL code could be modified to
use a name from an exported variable (see HTMLMAP code how this can be
done).

Do I have to write a scedular to avoid ressource conflicts ?

??

As each process may re- g.region the GRASS-database, do I have
to lock this ressource also ?

GRASS IMHO does not support multiple useres (processes) in the same
location and mapset at a time. This setup will not work. Why not
creating a temporary mapset for each process? This would require
cleaning up after the task is done, but otherwise avoid the
locking/resource problems you mentioned.

And not to forget: last time i examined the CELL driver in
GRASS5.0beta10 it was broken somehow. Had no time to find the problem.

Do you know the mapping tool from Frederico Ponchio:
www.ambientepi.arti.beniculturali.it:2020/demo/index.html ?
Perhaps you can use this or get some ideas about web-mapping with GRASS
from there.

cu,

Andreas

--
Andreas Lange, 65187 Wiesbaden, Germany, Tel. +49 611 807850
Andreas.Lange@Rhein-Main.de - A.C.Lange@GMX.net

On Thu, Jan 11, 2001 at 08:08:56AM +0100, m.malicky@landesmuseum-linz.ac.at wrote:

Hi!

Currently I am developing a web mapping tool for GRASS mainly
with PHP for our biodiversity Database.
As I am using the CELL driver for generating pictures I have the
following questions:

How can I reset the CELL driver ? - changing the vars
GRASS_WIDTH and GRASS_HEIGHT to another value after using
the driver gives me error messages.

That's unusual. Here it runs fine. I can change the resolution like
this:

#write the D_cell file:
export GRASS_WIDTH=100
export GRASS_HEIGHT=200
d.mon start=CELL
d.vect ndsgrenzen col=red
d.mon stop=CELL

#look at it:
g.region rast=D_cell -p
d.mon x0
d.rast D_cell

#reset region to location coordinates:
g.region -dp

# next try:
export GRASS_WIDTH=400
export GRASS_HEIGHT=400
d.mon start=CELL
d.vect ndsgrenzen col=red
d.mon stop=CELL

#look at it:
g.region rast=D_cell -p
d.mon sel=x0
d.rast D_cell

#reset region to location coordinates:
g.region -dp

Works fine and leads to different resolutions.

What does happen if 2 processes try to access the ressource
D_cell at the same time ?

Mhhh, no idea, sorry.

Do I have to write a scedular to avoid ressource conflicts ?

Maybe yes.

As each process may re- g.region the GRASS-database, do I have
to lock this ressource also ?

*Probably* yes as the current settings are used.

Maybe this is a little help,

Markus Neteler

On Fri, Jan 12, 2001 at 02:05:28PM +0100, Andreas Lange wrote:
[...]

> What does happen if 2 processes try to access the ressource
> D_cell at the same time ?
That should never be done. Even if it does not crash it will not produce
anything reasonable.
One setup would be to use a temporary mapset within the current location
for each process to avoid this. Or the CELL code could be modified to
use a name from an exported variable (see HTMLMAP code how this can be
done).

A small addition: You could analyse "grasslinks" how this management with
temporal datasets is done. Currently it is not fully set up here run, but if
GRASS would be properly installed on our *web server*, it would do:
Get it here:
http://www.geog.uni-hannover.de/grasslinks/

[...]

And not to forget: last time i examined the CELL driver in
GRASS5.0beta10 it was broken somehow. Had no time to find the problem.

I just generated some images - they looked o.k. But there will be a problem
at least with 24bit color table etc.

[...]

Markus

On Fri, Jan 12, 2001 at 02:05:28PM +0100, Andreas Lange wrote:

m.malicky@landesmuseum-linz.ac.at wrote:

I would also add that you might want to consider another system for web
mapping. I've been working with MapServer some, and I think it's
quite impressive, a well as being open source. It's a nice
complement to GRASS for viewing maps and querying features. Check it out
at
  http://mapserver.gis.umn.edu

Also, see my tools for developing MapServer applications:
  http://msworkbench.sourceforge.net

--
Tom Poindexter
tpoindex@nyx.net
http://www.nyx.net/~tpoindex/