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

Markus Metz markus.metz.giswork at googlemail.com
Fri Apr 20 03:40:18 EDT 2012


On Thu, Apr 19, 2012 at 10:57 PM, Rich Shepard <rshepard at appl-ecosys.com> wrote:
>  On one project the r.stream.extract error, "Accumulation map does not
> match elevation map!", was caused by a mask on the elevation map. With this
> project the mask was removed, and no longer limits the DEM region.

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.

>
>  I started over to ensure the elevation map was not masked. Because of the
> large size, I used the NHD basin map's region to set the analytical region:
>
>        g.region vect=basins align=dem_proj
>
> Then changed resolution from 1 US Foot (0.305m) to 10m (30 US Feet).

In your last posts you were using a resolution of 30m?
>
>  This is the same region and elevation map used in the process leading to
> application of the r.stream.extract module, the accumulation map was
> generated by r.watershed, and r.stream.extract has no problem running with
> the unweighted accumulation map. Therefore, I assume the error arose in the
> calculation of weight or applying that weight to the unweighted accumulation
> map.

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.

>
>  If this assumption is correct, where do I look to find how to resolve the
> problem?

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=???

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

HTH,

Markus M


More information about the grass-user mailing list