3

In QGIS I am trying to calculate the distance from a point layer to a polyline layer for the n nearest polylines. I have figured out how to calculate this distance to the centroid of the polylines using the point to hub tool, but I need the distance to the edge of the closest polylines - not centroids. I can calculate the nearest polyline by dumping the polylines to nodes and calculating to nearest point, but that method falls apart for the n nearest calculation.

Any thoughts?

2

You can use the NNJoin plugin to calculate the distance between points and its nearest line. You can download the plugin via Plugins > Manage and Install Plugins....

It is recommended, however, to not use this plugin on large datasets containing lines as it does not use a spatial index for lines.

  • This doesn't solve the problem for me unfortunately. I am not trying to join the nearest line I am trying to join the N nearest lines. The nearest neighbor is easy in QGIS, but I need the 5 nearest neighbors. – Chris Moris Oct 14 '14 at 17:29

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.