[GRASS-user] floodplain creation
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?
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" .
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.
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.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:
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
v.to.rast in=streams output=streams_dir use=dir
which you can see in context here (different hydrology tool):
> 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>
>> 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:
>> 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>
>>>> 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...
More information about the grass-user