[GRASS-user] g.region (was v.to.rast conversion)
Hamish
hamish_b at yahoo.com
Tue Dec 15 05:29:33 EST 2009
> > I should convert a shapefile into a raster file
> (GeoTIFF format) at a given resolution and I want to use the
> GRASS modules as a command line tools.
> > I followed the instructions in the chapter "Automated
> usage of grass" in the Markus's book and I created a bash
> script in order to prepare the grass enviroment:
> >
> > #!/bin/bash
> > LOCATION=test
> >
> > GISBASE=/usr/local/grass-6.5.svn
> > GISDBASE=/usr/local/share/grassdata
> >
> > rm $HOME/.grassrc6
> > rm -rf "$GISDBASE/$LOCATION" #cleaning LOCATION
> >
> > TMPDIR=$$.tmp
> > mkdir -p $GISDBASE/$TMPDIR/temp
> >
> > echo "LOCATION_NAME: $TMPDIR" > $HOME/.grassrc6
> > echo "MAPSET: temp" >> $HOME/.grassrc6
> > echo "DIGITIZER: none" >> $HOME/.grassrc6
> > echo "GISDBASE: $GISDBASE" >> $HOME/.grassrc6
> >
> > export GISBASE=$GISBASE
> > export GISRC=$HOME/.grassrc6
> > export PATH=$PATH:$GISBASE/bin:$GISBASE/scripts
> >
> > After these lines I run the v.in.ogr module to import
> the vector:
> > v.in.ogr -o -e dsn=./test_data/test_data.shp
> output=grass_map
> >
> > And the following is the error i get.
> > ERROR: region for current mapset is not set
> > run "g.region"
> >
> > I tried to get the g.region help message, also I tried
> to reset the region (with g.region -d) and to set a default
> region (with g.region -s) but I get always the same error.
> >
> > I'm very new with GRASS and I cannot understand if
> there is a problem in the installation, or it is a bug (as
> it seemed), or I'm not working in the proper way.
> >
> > Thanks (also for the patience)
> >
>
> No suggestions?
(I have like 5000 emails in my mailing list inbox, sorry if I missed yours)
If you are new to grass I would recommend using GRASS_BATCH_JOB instead
of setting the enviro vars by hand. Then the grass startup script takes
care of all of that for you.
see the wiki page for more.
http://grass.osgeo.org/wiki/GRASS_and_Shell#GRASS_Batch_jobs
Hamish
More information about the grass-user
mailing list