[GRASS-user] floodplain creation

Vaclav Petras wenzeslaus at gmail.com
Mon Oct 1 08:38:17 PDT 2018


On Sat, Sep 29, 2018 at 1:55 PM Shane Carey <careyshan at gmail.com> wrote:

> My last bit of the puzzle is to create the flow direction raster. How do I
> reclassify in order to get the stream direction using r.mapcalc?
>

Hi Shane,

You are welcome. What you need to do are 2 steps: 1) vector to raster
conversion with direction to be used for raster values:

v.to.rast input=streams output=streams_direction use=dir

The v.to.rast manual says: "line direction in degrees CCW from east" [1].
However, the r.stream.distance manual specifies the drainage direction to
be: "...zero and negative values are valid direction data only if they vary
from -8 to 8 (CCW from East in steps of 45 degrees). Flow direction map
shall be of integer type (CELL)." So you need to reclassify.

[1] https://grass.osgeo.org/grass74/manuals/v.to.rast.html
[2] https://grass.osgeo.org/grass74/manuals/addons/r.stream.distance.html

The reclassification with r.mapcalc would be something like the following,
but I didn't really check and it may be wrong. Alternative would be to use
r.recode.

r.mapcalc "streams_direction_8 = int((streams_direction + 45) / 45)"

So please double check the output from the above and compare it with what
you get from r.watershed.

For completeness, here is what I wrote before:

"""
Yes, just convert your streams to raster (presence-absence) and a raster
for flow direction as I mentioned here:

https://lists.osgeo.org/pipermail/grass-user/2018-September/079135.html

Since you already have the streams and you want to use them, you need to
convert them to raster and then also get stream direction for r.stream.
distance by reclassifying, e.g. with r.mapcalc, output from something like
this:

v.to.rast in=streams output=streams_dir use=dir

which you can see in context here (different hydrology tool):

http://ncsu-geoforall-lab.github.io/geospatial-modeling-course/grass/simwe.html
"""


> I am just coping in what you said from your last email Vaclav so that you
> know which part I am stuck on. This is really super - thanks again
>
> [Since you already have the streams and you want to use them, you need to
> convert them to raster and then also get stream direction for
> r.stream.distance by reclassifying, e.g. with r.mapcalc]
>
> Le gach dea ghui,
> *Shane Carey*
> *GIS and Data Solutions Consultant*
>
>
> On Fri, Sep 28, 2018 at 3:02 PM Vaclav Petras <wenzeslaus at gmail.com>
> wrote:
>
>>
>> On Thu, Sep 27, 2018 at 12:10 PM Shane Carey <careyshan at gmail.com> wrote:
>>
>>>
>>> Is there anyway of the algorithm just being able to create a floodlain
>>> for actual real rivers as opposed to the derived river dataset?
>>>
>>
>> Yes, just convert your streams to raster (presence-absence) and a raster
>> for flow direction as I mentioned here:
>>
>> https://lists.osgeo.org/pipermail/grass-user/2018-September/079135.html
>>
>> However, you need to be cautious about fit between the existing streams
>> and the DEM. Definitively check how your existing streams align with the
>> derived ones (where there are both streams).
>>
>>
>>>
>>> On Máirt 25 MFómh 2018 at 15:49, Shane Carey <careyshan at gmail.com>
>>> wrote:
>>>
>>>> Image attached shows rivers (black line) and floodplain of where it
>>>> thinks there are rivers and in some cases where there may not be rivers.
>>>>
>>>
>> To use the derived streams and get rid of parts you don't want, you could
>> buffer the existing streams and preserve only the derived streams which are
>> in that buffer.
>>
>> However, you should really look at why they are different and
>> specifically what is closer to reality.
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20181001/405d6e0c/attachment-0001.html>


More information about the grass-user mailing list