[GRASS-user] How to find elevation drop for all cells in a basin

Thomas Adams tea3rd at gmail.com
Wed Dec 16 08:29:41 PST 2020


Hi Ken!

So, presumably, you know the locations of all the basin outlets (lat-long,
e.g.). Using  *v.what.rast*, query the elevation map to get the elevation
at the basin outlet (locations) that the vector points identify. This
associates the basin outlet elevation with its location. Assuming you have
a single elevation map, you'll need to mask the elevation map to use the
method I suggested. You can get the basin boundary -- if these are not
already identified -- to create a mask using *r.water.outlet*. For each
basin, set the MASK and do the r.mapcalc calculation I proposed, because
you know the outlet elevation and the elevation at all cells within the
MASKed basin area. r.mapcalc will create a new map 'diff' comprised of the
elevation differences between the elevation at the basin outlet and all
other cells in the basin. The elevation difference at the basin outlet will
be ZERO.

The whole process is easily scriptable. I have done this kind of thing a
fair amount, FWIW...

Later, after all the diff maps have been created, you could (if you
wanted/needed to) patch them together or do statistics on them, etc. I hope
all this makes sense...

Best,
Tom

On Tue, Dec 15, 2020 at 3:52 PM Ken Mankoff <mankoff at gmail.com> wrote:

>
> On 2020-12-15 at 12:28 -08, Thomas Adams <tea3rd at gmail.com> wrote...
> > So, if I understand, that seems pretty simple and could be done with
> > r.mapcalc:
> >
> > diff = elev - outlet_elev
> >
> > where elev is a raster map of elevations and outlet_elev is the elevation
> > at the basin outlet. Using a basin mask the calculation could be confined
> > to any basin of interest. But, I am probably missing something, I think…
>
> One of us is missing something, but I'm happy to assume it is me :).
>
> If outlet_elev is only defined at the outlets, diff is only defined at the
> outlets. I want it defined for every inland cell in every basin. I have
> 1,000s of basins.
>
> How do I define outlet_elev everywhere? I can do it now using
> r.stream.distance but prior to Anna suggesting that, I didn't know how to
> do it. Is there some trick like for each basin I set the category to the
> elevation of the outlet, and then use mapcalc @math function to create the
> outlet_elev raster?
>
>   -k.
>


-- 
Thomas E Adams, III
1724 Sage Lane
Blacksburg, VA 24060
tea3rd at gmail.com (personal)
tea at terrapredictions.org (work)

1 (513) 739-9512 (cell)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20201216/6e3cdf42/attachment.html>


More information about the grass-user mailing list