[GRASS-dev] GRASS 7 scripts overhaul

Hamish hamish_b at yahoo.com
Sun Sep 4 17:59:39 EDT 2011


Markus N wrote:
...
> This set of modules I did not manage to fix:
...
> * i.landsat.rgb blue=lsat7_2002_10 green=lsat7_2002_20
> red=lsat7_2002_30
> Processing <lsat7_2002_30>...
> Color table for raster map <lsat7_2002_30> set to
> 'rules'
> Processing <lsat7_2002_20>...
> Color table for raster map <lsat7_2002_20> set to
> 'rules'
> Processing <lsat7_2002_10>...
> Color table for raster map <lsat7_2002_10> set to
> 'rules'
> WARNING: Unable to write history for <lsat7_2002_30>.
> Raster map
>    
>    <lsat7_2002_30> not found in current
> mapset.
> WARNING: Unable to write history for <lsat7_2002_20>.
> Raster map
>      
>    <lsat7_2002_20> not found in current
> mapset.
> WARNING: Unable to write history for <lsat7_2002_10>.
> Raster map
>      
>    <lsat7_2002_10> not found in current
> mapset.

It tries to run grass.raster_history() without first testing
if the map is in the current mapset.

the shell script version has this test to avoid that trouble:

# write cmd history (only if raster maps are located in the current mapset)
CURRENT_MAPSET=`g.gisenv MAPSET`
...
BLUE_MAPSET=`g.findfile -n elem=cell file=$BLUE | grep mapset | cut -d'=' -f2`
...
if [ "$BLUE_MAPSET" = "$CURRENT_MAPSET" ] ; then
    r.support ${BLUE} history="${CMDLINE}"
fi


probably we should continue this thread in bug reports.


thanks for the testing,
Hamish


More information about the grass-dev mailing list