[GRASS-user] r.stream.extract: map mis-match error

Rich Shepard rshepard at appl-ecosys.com
Fri Apr 20 09:23:15 EDT 2012


On Fri, 20 Apr 2012, Markus Metz wrote:

> It is perfectly ok to set the region to a subregion of the DEM and to set
> a MASK. These settings should not be modified, however. As long as
> r.watershed and r.stream.extract are used on the same region settings and
> the same MASK, the map mismatch error should not happen. Just in case,
> masking should be done by creating a MASK, not by modifying the elevation
> values.

Markus,

   For the current there is no mask and the region is set to the same
parameters before the model is run. That's why I cannot find the source of
the error.

> In your last posts you were using a resolution of 30m?

   No. The location units are US Feet so g.region reports them as 30. That's
approximately 10m and I use the latter as a descriptor. The original DEM has
a cell size of 1 x 1 feet (0.305 x 0.305 m) and is much too large to process
on a system with 4G RAM.

> But in your last posts, applying the weight worked fine (map1.pdf,
> map2.pdf, map3.pdf)? The weighed accumulation map seemed to produce the
> best results. BTW, the vector output of r.stream.extract would have been
> easier to see on the screenshots.

   This is true. The problem was the residual mask that caused two
comparatively large areas to not be defined as basins by r.watershed. That's
shen I removed that map and started over with the full-size DEM rather than
the one 'clipped' to the vector basin boundaries. Now I get too many small
basins but the former white areas with null elevations do contain identified
basins.

> Try to set the region and MASK before the analysis, then don't modify
> these settings during the analysis. Something like
>
> g.region vect=basins align=dem_proj
> g.region res=10m -a
> r.resamp.stats in=dem_proj out=dem_10m method=average -w
> v.to.rast in=basins out=MASK type=area use=val val=1
> r.watershed elevation=dem_10m acc=dem_10m.acc basin=dem_10m.basin
> threshold=150000
> r.mapcalc "dem_10m.acc.w = dem_10m.acc * weight"
> r.stream.extract elevation=dem_10m acc=dem_10m.acc.w
> stream_rast=dem_10m.streams stream_vect=dem_10m_streams threshold=???

   This is different. I'll work on this today. The r.stream.extract,
r.stream.basins, r.stream.order, and r.basin modules are essential for the
two current big projects. So, I want to learn and better understand how to
use them to get meaningful results.

> You may need to try different values for threshold with r.stream.extract
> in order to get the desired detail.

   I've tried different thresholds for r.watershed but not -- yet -- for
r.stream.extract. I need to try the latter as well as looking at vector
output.

> HTH,

   I'm sure it will.

Thank you very much,

Rich



More information about the grass-user mailing list