[GRASS-user] Script for r.proj and g.list issues

Hi,

I'm working in GRASS 6.4.0RC6 and Ubuntu 10.04.

I'm trying to write a Python script to project hundreds of files from
one location to another. Since r.proj -l outputs text that will have
to be parsed, I decided to rather follow the method explained at this
webpage (<http://www.mail-archive.com/grass-dev@lists.osgeo.org/msg14180.html&gt;\),
namely to export a list of rasters to a text file using g.list.

If I run g.list without the mapset option, I get a list of all the
rasters, but I'm particularly interested in the mapset called
'2000_02_february_trmm'. I include some of the output below to prove
that the mapset contains some rasters:
-----
g.list type=rast
----------------------------------------------
raster files available in mapset <2000_02_february_trmm>:
20000201_00_3B42RT 20000208_09_3B42RT 20000215_18_3B42RT
...
20000208_06_3B42RT 20000215_15_3B42RT 20000223_00_3B42RT
raster files available in mapset <PERMANENT>:
MCD12Q1.A2001001.005_land_cover_type1
...
test_border_nulls
----------------------------------------------
(Mon Sep 13 12:22:14 2010) Command finished (0 sec)
-----

However, g.list is behaving strangely when I ask it to list the
rasters in mapset 2000_02_february_trmm:
-----
g.list type=rast mapset=2000_02_february_trmm>
----------------------------------------------
no raster files available in mapset <2000_02_february_trmm>>
----------------------------------------------
(Mon Sep 13 12:23:11 2010) Command finished (0 sec)
------

So, I have two questions:

1) Am I following the right method to project the rasters from one
location to the other, or does an easier way exist?

2) Why is g.list not finding my mapset when it clearly exists?

Thanks
Hanlie

rasters in mapset 2000_02_february_trmm:

g.list type=rast mapset=2000_02_february_trmm>

no raster files available in mapset <2000_02_february_trmm>>

(Mon Sep 13 12:23:11 2010) Command finished (0 sec)

you made a mistake in the name of the mapset: you used “2000_02_february_trmm>”, try again without a > at the end …

Sylvain

2010/9/13, Sylvain Maillard <sylvain.maillard@gmail.com>:

rasters in mapset 2000_02_february_trmm:

-----
g.list type=rast mapset=2000_02_february_trmm>
----------------------------------------------
no raster files available in mapset <2000_02_february_trmm>>
----------------------------------------------
(Mon Sep 13 12:23:11 2010) Command finished (0 sec)
------

you made a mistake in the name of the mapset: you used
"2000_02_february_trmm>", try again without a > at the end ...

Sylvain

My bad, sorry!

Hi,

2010/9/13 Hanlie Pretorius <hanlie.pretorius@gmail.com>:

g.list type=rast mapset=2000_02_february_trmm>

btw, the scripting library brings group of interfaces to g.list, see [1].

Martin

[1] http://grass.osgeo.org/programming6/pythonlib.html

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa