[GRASS-dev] Grass Variables/ Perl

Jachym Cepicky jachym.cepicky at centrum.cz
Thu Aug 3 04:21:23 EDT 2006


#!/usr/bin/perl -w

$ENV{GRASS_WIDTH} = 20;
$ENV{GRASS_HEIGHT} = 20;

system("d.mon start=PNG");
system("d.rast soils");
system("d.mon stop=PNG");

jachym

On Thu, Aug 03, 2006 at 10:01:11AM +0200, "Peter Löwe" wrote:
> >%ENV gives you the environment variables,
> 
> >if ($ENV{GISBASE}){
> >    &main();
> >}
> >else {
> >    print "You have to run GRASS first!"
> >}
> >
> >you can also read from stdin:
> >
> >@region = `g.region -g`
> 
> Hello Jachym,
> 
> that's true. However, neither `export GRASS_WIDTH=42` nor system "export GRASS_WIDTH=42" can be used to set the variables for later commands to make use of the settings (aka generate a huge PNG). Within the GRASS environment, the GRASS_HEIGHT/WIDTH will still default to 640/480.
> A remarkably awkward workaround would be to create a shell-script from within the perl environment and run it later. but i believe theremust be a better way.
> 
> Peter
> -- 
> Dr. Peter Löwe
> 
> Diplom-Geograph
> 
> <loewe at geomancers.net>
> <peter.loewe at gmx.de>
> 
> 
> 
> 
> 
> Echte DSL-Flatrate dauerhaft für 0,- Euro*. Nur noch kurze Zeit!
> "Feel free" mit GMX DSL: http://www.gmx.net/de/go/dsl

-- 
Jachym Cepicky
e-mail: jachym.cepicky at 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 at gdf-hannover.de
URL:    http://gdf-hannover.de
Tel.:   +49 511-39088507
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: Digital signature
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20060803/0c4aeb9e/attachment.bin


More information about the grass-dev mailing list