[GRASS-user] temporary file during r.mapcalculation in a python-script?

Helmut Kudrnovsky hellik at web.de
Sun Oct 23 16:38:04 EDT 2011


hi,

in a python-script for grass65 (which I want to bring to run) there are
following r.mapcalculations:

    grass.run_command('r.mapcalculator', amap = r_accumulation , formula =
'%s*%s' % (r_accumulation, r_mask) , outfile = r_accumulation, overwrite =
True)
    grass.run_command('r.mapcalculator', amap = r_drainage , formula =
'%s*%s' % (r_drainage, r_mask) , outfile = r_drainage, overwrite = True)
    grass.run_command('r.mapcalculator', amap = r_stream+'_nothin' , formula
= '%s*%s' % (r_stream+'_nothin', r_mask) , outfile = r_stream+'_nothin',
overwrite = True)
[...]

AFAIK it isn't possible that with r.mapcalculator a input raster map can be
overwritten by itself as outfile. is this right?

what would be the best way in the example above to workaround this? a
temporary file?

best regards
Helmut

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/temporary-file-during-r-mapcalculation-in-a-python-script-tp6922940p6922940.html
Sent from the Grass - Users mailing list archive at Nabble.com.


More information about the grass-user mailing list