What I want to do :
This question is about finding an equivalent path on a grid to a given line. The following image shows what I am trying to achieve : Starting from a generic line (in red), I want to get the equivalent path which is snapped on a grid.
Why I want to do it
The grid is supposed to represent a raster. I am currently toying with a cellular automata model which simulates the run-off of fallen rain on a DEM (digital elevation model). I have pretty big cell sizes (usually around 10 meters) and I would like to account for linear walls on my domain, which greatly impact the way the water moved through the DEM. The red line corresponds to the location of such a wall. Obviously, since the cells are quite big, I can't simply rasterize the vector line since it would give the wall a 10 m-width. That is why I would like to modify the water fluxes between neighboring cells. To achieve that, I need to determine this blue line which is snapped to the cell edges.
What I did so far
First, I did a lot of googling, but I am relatively new to the manipulation of geodata, and to this king of data processing. I am quite sure this is a well-documented "problem" with well-known solutions, but I don't know how to formulate this issue better than with showing what I am looking for. My first ideas were to create additional points along the line and to snap them on a grid which matches the raster's cells edges : Before investing too much time on a junk code which may not work, I would like to know if there already are solutions out there. Usually, I prepare my data with QGIS, or with python, that's why ideally I'm interested in any QGIS processing ( or consecutive processings) which would do the tricks and/or python libraries which could do that.
If you only have vague ideas of ideas to explore I also am interested.
Similar questions on gis.stackexchange