[GRASS5] Re: [GRASSLIST:806] Re: Live Earthquake Map: GRASS/PHP

> just some fun:
>
> http://grass.itc.it/spearfish/php_grass_earthquakes.php
> Recent Earthquakes: map generated by GRASS on the fly with PHP

..

I only suggest to generate maps from crontab every 5 min or so and not
on-fly. It would make it work faster and lower load on server.
(Imagine posting link on /. :wink:

I would ask the same for the GRASS User map on the main grass homepage.
Currently it always takes a while to load. Maybe use a cron job to
automate the thumbnail to copy/generate itself to a local file on the
webserver once a week?

Hamish

Hello Hamish,

On Wed, 26 Apr 2006 17:00:49 +1200 Hamish <hamish_nospam@yahoo.com>
wrote:

> > just some fun:
> >
> > http://grass.itc.it/spearfish/php_grass_earthquakes.php
> > Recent Earthquakes: map generated by GRASS on the fly with PHP
..
> I only suggest to generate maps from crontab every 5 min or so and
> not on-fly. It would make it work faster and lower load on server.
> (Imagine posting link on /. :wink:

I would ask the same for the GRASS User map on the main grass
homepage. Currently it always takes a while to load. Maybe use a cron
job to automate the thumbnail to copy/generate itself to a local file
on the webserver once a week?

This is partly done currently. The images are locally processed and
stored on the mapserv-server, where grass.itc.it fetches them. So maybe
copying it the the websites could speed things up...
I will think about an automated exchange (via cron, scp?) between the
two servers.

Stephan

--
GDF Hannover - Solutions for spatial data analysis and remote sensing
Hannover Office - Mengendamm 16d - D-30177 Hannover
Internet: www.gdf-hannover.de - Email: holl@gdf-hannover.de
Phone : ++49-(0)511.39088507 - Fax: ++49-(0)511.39088508

Hamish wrote:

just some fun:

http://grass.itc.it/spearfish/php_grass_earthquakes.php
Recent Earthquakes: map generated by GRASS on the fly with PHP
     

..

I only suggest to generate maps from crontab every 5 min or so and not
on-fly. It would make it work faster and lower load on server.
(Imagine posting link on /. :wink:
   
I would ask the same for the GRASS User map on the main grass homepage.
Currently it always takes a while to load. Maybe use a cron job to
automate the thumbnail to copy/generate itself to a local file on the
webserver once a week?

Done. It is fetched a few times a day.

Markus

On Wed, Apr 26, 2006 at 09:34:40AM +0200, Markus Neteler wrote:

>>> http://grass.itc.it/spearfish/php_grass_earthquakes.php
>>> Recent Earthquakes: map generated by GRASS on the fly with PHP

The new machine (grass.itc.it) offers PHP 5, so I had to
rewrite the code.

The PHP4 code example is at
  http://grass.itc.it/spearfish/php_grass_earthquakes_PHP4.php
and no longer works on that machine, not sure why (I don't
know much about PHP).

The new PHP5 code example is at
  http://grass.itc.it/spearfish/php_grass_earthquakes.php
and also fails!

The debug output is:
  echo \$LD_LIBRARY_PATH >> grasserrors2.txt;
  echo \$PATH >> grasserrors2.txt;
  echo \$GISRC >> grasserrors2.txt;
which prints:
/lib:/usr/lib:/usr/local/grass-6.1.cvs/lib
/bin:/usr/bin:/usr/local/bin:/usr/local/grass-6.1.cvs/bin:/usr/local/grass-6.1.cvs/scripts
/grass0/neteler/www/spearfish/.grassrc6_ll
ERROR: LOCATION_NAME not set

I don't understand why 'lynx' works (to fetch the USGS bulletin),
also 'convert' to make JPG from PNG, but the GRASS commands fail
with 'LOCATION_NAME not set'.

ls -la /usr/local/grass-6.1.cvs/bin | wc -l
288

GRASS is there...
There is still a map shows in the PHP page as I didn't remove the
output from the last run on the old machine.

Any ideas?

Markus

On Mon, May 22, 2006 at 12:27:24PM +0200, Markus Neteler wrote:

On Wed, Apr 26, 2006 at 09:34:40AM +0200, Markus Neteler wrote:
> >>> http://grass.itc.it/spearfish/php_grass_earthquakes.php
> >>> Recent Earthquakes: map generated by GRASS on the fly with PHP

The new machine (grass.itc.it) offers PHP 5, so I had to
rewrite the code.

The new PHP5 code example is at
  http://grass.itc.it/spearfish/php_grass_earthquakes.php
and also fails!

I got a bit closer to the problem. It seems that now
the behaviour differs from

  'GISRC' => '/grass0/neteler/www/spearfish/.grassrc6_ll',

and
  'GISRC' => '/tmp/gisrc',

But the files are identical! The former gives a LOCATION_NAME not
found error, the latter "permission denied" (see above link) to
the location, although the owner of the location was changed to
apache user/group.

Mysterious. Honestly I don't understand the GISRC/GISRCRC magic in
$GISBASE/etc/Init.sh which I have to replicate somehow in the
PHP script. Earlier it was the path to the .grassrc6 which worked
on Redhat7 but now fails (RHEL4).

Any hints?

Markus

Hallo Marcus,

I do not know, how are you doing things.

I my script, I generate gisrc on-the-fly and then I export the ENV
variables. Works for mapsets owned by other users too.

svn subversion.gdf-hannover.de/.../pywps

look in file Wps/grass.py, function mkmapset

Jachym

On Sun, May 28, 2006 at 12:08:36AM +0200, Markus Neteler wrote:

On Mon, May 22, 2006 at 12:27:24PM +0200, Markus Neteler wrote:
> On Wed, Apr 26, 2006 at 09:34:40AM +0200, Markus Neteler wrote:
> > >>> http://grass.itc.it/spearfish/php_grass_earthquakes.php
> > >>> Recent Earthquakes: map generated by GRASS on the fly with PHP
>
> The new machine (grass.itc.it) offers PHP 5, so I had to
> rewrite the code.
>
> The new PHP5 code example is at
> http://grass.itc.it/spearfish/php_grass_earthquakes.php
> and also fails!
>

I got a bit closer to the problem. It seems that now
the behaviour differs from

  'GISRC' => '/grass0/neteler/www/spearfish/.grassrc6_ll',

and
  'GISRC' => '/tmp/gisrc',

But the files are identical! The former gives a LOCATION_NAME not
found error, the latter "permission denied" (see above link) to
the location, although the owner of the location was changed to
apache user/group.

Mysterious. Honestly I don't understand the GISRC/GISRCRC magic in
$GISBASE/etc/Init.sh which I have to replicate somehow in the
PHP script. Earlier it was the path to the .grassrc6 which worked
on Redhat7 but now fails (RHEL4).

Any hints?

Markus

_______________________________________________
grass-dev mailing list
grass-dev@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-dev

--
Jachym Cepicky
e-mail: jachym.cepicky@centrum.cz
URL: http://les-ejk.cz
GPG: http://les-ejk.cz/gnupg_public_key/jachym_cepicky-gpg_public_key.asc
-----------------------------------------
OFFICE:
GDF-Hannover
Mengendamm 16d
30177 Hannover
Germany
e-mail: cepicky@gdf-hannover.de
URL: http://gdf-hannover.de
Tel.: +49 511-39088507

Markus Neteler wrote:

> > >>> http://grass.itc.it/spearfish/php_grass_earthquakes.php
> > >>> Recent Earthquakes: map generated by GRASS on the fly with PHP
>
> The new machine (grass.itc.it) offers PHP 5, so I had to
> rewrite the code.
>
> The new PHP5 code example is at
> http://grass.itc.it/spearfish/php_grass_earthquakes.php
> and also fails!
>

I got a bit closer to the problem. It seems that now
the behaviour differs from

  'GISRC' => '/grass0/neteler/www/spearfish/.grassrc6_ll',

and
  'GISRC' => '/tmp/gisrc',

But the files are identical! The former gives a LOCATION_NAME not
found error, the latter "permission denied" (see above link) to
the location, although the owner of the location was changed to
apache user/group.

But does that account have the necessary permissions? Owning the
file/directory simply means that the owner permissions are used
(rather than the group or world permissions), but those permission are
necessary.

Also, the web-server account needs execute permission on all of the
parent directories.

Mysterious. Honestly I don't understand the GISRC/GISRCRC magic in
$GISBASE/etc/Init.sh which I have to replicate somehow in the
PHP script. Earlier it was the path to the .grassrc6 which worked
on Redhat7 but now fails (RHEL4).

You don't need to set $GISRCRC. GRASS itself only uses $GISRC;
$GISRCRC should only be used within Init.sh itself (the export is
gratuitous).

--
Glynn Clements <glynn@gclements.plus.com>