[Qgis-user] Correcting river flow

Nicolas Cadieux nicolas.cadieux at archeotec.ca
Sun Apr 14 04:11:51 PDT 2019


Hi Micha,

Great ideas, thanks.  I was trying to get the v.drape to work in Qgis but I was getting errors.  I figure it’s bad topology.  I will fix it and try again directly in Grass. I did manage to get the end nodes and start nodes.  That has not easy as the vectorizing was done in very small sections.  I was surprised to see so little merging tools that could deal with this without manually selecting the lines.  I tried with an old Qgis 2.18 plugin but it was not working properly.

Your work flow is similar than what I had in mind but the detail you gave will most certainly be useful.

Nicolas




> Le 14 avr. 2019 à 02:24, Micha Silver <tsvibar at gmail.com> a écrit :
> 
> Here's an idea, using GRASS, that might get you started.
> 
> 
> 
> First use the v.drape module to convert your river network to a 3D grass vector. Now add X,Y,Z coordinates to all start and end points for all river sections with v.to.db. With that you can extract those river sections where the Z value of the endpoint is greater than the Z of the start point. Finally, with v.edit, slip only those river sections.
> 
> 
> 
> Putting it all together. This is untested, use at your own risk :-)
> 
> 
> 
> v.in.ogr input=rivers.shp output=rivers
> 
> r.in.gdal input=srtm.tif output=srtm
> 
> g.region -ap vect=rivers res=30 # Assuming the SRTM is 1 arcsec, or 30 m resolution
> 
> 
> 
> # Make 3D rivers vector
> 
> v.drape input=rivers output=rivers_3d elev=srtm
> 
> 
> 
> # Add X,Y,Z for start and end points
> 
> v.db.addcolumn map=rivers_3d columns="start_x DOUBLE, start_y DOUBLE start_z DOUBLE, end_x DOUBLE end_y DOUBLE end_z DOUBLE"
> 
> v.to.db map=rivers_3d option=start columns="start_x,start_y,start_z"
> 
> v.to.db map=rivers_3d option=end columns="end_x,end_y,end_z"
> 
> 
> 
> # Flip only those river sections that are in wrong direction
> 
> # Add the "snap" tool along the way to make sure line segments are indeed connected
> 
> v.edit rivers_3d tool=flip,snap where="end_z>start_z" thresh=10
> 
> 
> 
>> On 13/04/2019 23:31, Nicolas Cadieux wrote:
>> Hi, 
>> 
>> I have a difficult problem.  I have a very large river network file made with a 2D shapefile.  (I have the SRTMs for the same region).  I would like to model a river network but I need to keep in mind the river flow direction.  Unfortunately, I think this file was manually digitized and therefore, line directions have no relationship with river flow direction. 
>> 
>> Can anyone suggest a way to use my SRTMs to change the line directions or to add a flow direction variable without resorting to manually editing the layer? 
>> 
>> Thanks, 
>> 
>> Nicolas 
>> 
>> _______________________________________________ 
>> Qgis-user mailing list 
>> Qgis-user at lists.osgeo.org 
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user 
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
> -- 
> Micha Silver
> Ben Gurion Univ.
> Sde Boker, Remote Sensing Lab
> cell: +972-523-665918
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20190414/672585ce/attachment.html>


More information about the Qgis-user mailing list