6

I have two layers , line and point layer. I need to make a line layer which connects all points to nearest line features? Did someone make a plugin for qgis? This is very important tool which missing in qgis.

ArcView has this tool: http://www.jennessent.com/arcview/nearest_features.htm

15

As an alternative, you could:

  1. Use the Convert Lines to Points tool from:

    Processing Toolbox > SAGA > Shapes - Points > Convert Lines to Points

    (Add points over small distances. E.g. add a point every 1m if the overall line is 100m)

    Convert lines to points

  2. Use the Distance to nearest hub from:

    Processing Toolbox > QGIS geoalgorithms > Vector analysis tools > Distance to nearest hub

    (Set the parameters, using the output layer of the Convert Lines to Points tool as the Destination hubs layer and setting the Output shape type as Line to hub)

    Distance to nearest hub

  3. Final result should be a line layer which connects the original points layer with the original line layer (with line-converted points):

    Final result with points

    (without line-converted points):

    Final result without points

I used QGIS 2.12.3-Lyon.

  • 1
    @nagib - Awesome, glad it works :) – Joseph Feb 22 '16 at 13:36
  • I find plugin, network, it has better results, but does not make a new layer. – nagib Mar 3 '16 at 6:26
  • @nagib - Don't think I used that plugin before so not sure I could help much :) – Joseph Mar 3 '16 at 10:22
-1

If you find the point over the line, the shortest point, with the coordinate 3D (X,Y,Z) you need an algorithm to calc the position over the shortest line. You can using this tool https://github.com/rafaelduartenom/findpointonline. You need postgres to execute this tool and shapefiles.

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

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.