[GRASS-user] error: accumulation map does not match with elevation map! (r.basin)

Markus Metz markus.metz.giswork at gmail.com
Wed Jan 23 06:18:36 PST 2013


On Wed, Jan 23, 2013 at 1:21 PM, Helmut Kudrnovsky <hellik at web.de> wrote:
>> but when I launch r.basin in a closing section of the basin, I get the
> error: "map of accumulations
>> does not match the map of elevations."
>
> r.basin is based upon r.stream.extract and other useful modules.

The bug is in r.basin which modifies the current region after
r.watershed is called and before r.stream.extract is called, if the
default threshold should be used. In this case, the region is set to
match the input elevation map in order to get the resolution (nsres
only by the way). The fix would be to replace in r.basin.py line 135 -
137
        info_region = grass.read_command('g.region', flags = 'p', rast
= '%s' % (r_elevation))
        dict_region = grass.parse_key_val(info_region, ':')
        resolution = float(dict_region['nsres'])
with
        resolution = grass.region()['nsres']

HTH,

Markus M

>
> from the r.stream.extract-manual [1]:
>
> [...]
>  If accumulation is given, elevation must be exactly the same map used to
> calculate accumulation.
> [...]
>
> [1]
> http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.stream.extract/description.html
>
> HTH
>
>
>
> -----
> best regards
> Helmut
> --
> View this message in context: http://osgeo-org.1560.n6.nabble.com/error-accumulation-map-does-not-match-with-elevation-map-tp5029128p5029261.html
> Sent from the Grass - Users mailing list archive at Nabble.com.
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user


More information about the grass-user mailing list