I am currently working with QGIS 2.18 and I have two layers: one layer is filled with lines which represent streets. The second layer describes the location of sensors which are represented as points like in the image below:
Each point has its own attribute values like followed:
As you can see, the attribute edgeid is still empty and I want to fill it with the id of the nearest street. Each line in the street-line-layer has an edgeid as followed:
Now I will have to determine the street with the shortest distance to the point and store its id into the edgeid-attribut of my point. The distance between point and line should be calculated as illustrated (d=distance; AB is the street vector and P is the point):
I have already tried the Distancematrix in QGIS but it seems that it can only be done between points. And I do not want to convert the lines into points.
Another thing I tried was the v.distance()-algorithm (GRASS) but I couldn't get it to work. I tried the following configurations for executing the algorithm:
For your better understanding: The tiger:graph is the line-layer and the EVIS_Stat_Sensorik_... is the point-layer. I want to calculate the nearest line (or edge) for each point and write its id into the attribute "edgeid" of the point. Is this even possible with this function? As I am quite new to this tool, I do not really know how to debug this.
Is there any other possible way to do this?