# GRASS GIS: creating raster with a certain gradient and extent

Constraints - Use only GRASS GIS - Automated using pyGRASS

Input

• DEM
• River raster OR river as vector (both are computed)
• gradient of the valley (as a float)
• vector line with direction and magnitude of the gradient

The idea I want to create a script (pyGRASS) to execute the following steps automatically.

The general idea is to construct a "virtual surface" layer. This surface layer will be a raster with a certain extent and gradient. The direction of this gradient will be described by a vector line.

Thus, in essence I want to create a raster (of certain width) along a vector line with a certain gradient. Thus the raster will start with a certain height which will decrease along the line up untill the end of the line.

Creating "virtual surface"

I am not sure how I will actually create this surface. I've looked into r.gradient but here I have to specify the direction of the gradient by hand. I already have the direction and magnitude (vector)

Has anyone an idea or a different approach to solve this problem? Faced it before?

• Sorry, but it's not clear what you are asking. What are the inputs and what is the output you expect? What do you mean "river". A river is NOT a straight line from the highest point to the lowest. This sentence in your question leaves me scratching my head: "In short, the river (with constant depth) will follow the gradient resulting in depth differences over the course of the river compared to the DEM." Aug 14, 2019 at 9:38
• I understand why this is not clear. I'll edit my question to the core of the problem. Aug 14, 2019 at 13:26
• Can you use `r.plane`? grass.osgeo.org/grass72/manuals/r.plane.html Aug 18, 2019 at 14:05
• @mankoff I will look into it. At first glance, it looks promising. Thanks! Aug 19, 2019 at 8:02

Can you use `r.plane`? r.plane