I have a vector layer for stream network created by r.stream.extract and then vectorized stream file using r.to.vect of grass algorithm in qgis.

I want to find nearest point for a given point on stream network, what steps should i follow to find nearest point on stream network for this point??

Example below : Here I need to find the point(X,Y) on stream (line layer) which is nearest to red point.

enter image description here


You are looking for r.stream.snap tool, i think.

r.stream.snap - Snap point to modelled stream network.
Input can be stream network, point vector map with outlets or outlet coordinates.

It's a special module that needs to be installed via g.extension

extension list

As a workaround if that doesn't work, other software could do it. For example, via QGIS interface or directly, Taudem has a specific tool for that named "Move Outlet to Streams".

move outlet

  • Thanks. would it give lat long of point on stream network? I am interested to find lat long of point on stream network which is nearest to given point – sudhanshud Sep 30 '17 at 21:08
  • As long as you have a point layer, you can always have X,Y coordinates. If you need lat.long, then just use epsg:4326 coordinate system. – gisnside Sep 30 '17 at 21:11
  • See here to export X,Y coordinates : How to export Point-shape coordinates to csv (X,Y)? – gisnside Sep 30 '17 at 21:12
  • Sorry, I think i was not clear above. I have point layer for that point i need point on stream which is near on stream layer(line layer) I have stream as line layer and I need X,Y co ordinates of point which is on stream and nearest. – sudhanshud Sep 30 '17 at 21:24
  • Run the tool : it will create (snap) the points on the closest stream. Afterwards, you just need to export the coordinates of the point that has been located by the tool. As long as you have a unique id to link both your source point and the generated point it will be ok. – gisnside Sep 30 '17 at 21:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.