I have two polyline layers in QGIS containing information on a network and I need to transfer some attributes from the second layer to the master layer. Unfortunately their geometries are not equal, meaning, the polylines in the different layers usually do not sit in the same place, mostly a few meters apart, neither are they of the same length. That is why a common spatial join does not work, as far as I found out.
My try was to build buffers "around" the polylines of the master layer and then join certain / all attributes from the second one. But here the problem is, that at the nodes between network links I, of course, get overlapping buffers an so mostly at least 2 links of the second layer lie (at least a bit) in one buffer from the master layer.
In the left picture (a) you see the initial situation: the links on the left side (pink and bright blue) are from the master layer, the links on the right (blue and green) from the second layer. The right picture (b) shows the buffers representing the links from the master layer and again the two links from the second layer. Each of the two links lies (at least with some portion) within both buffers.
I was not able to find out, how the algorithms of the several join functions I used, chose one of the the two possible links to reference to the buffers.
What I am looking for is a function in which I can set, that (only) the link (from second layer) with the best / biggest "coverage" within a buffer of the master layer is referenced and its attributes are transferred.
Does anybody know, how I could manage to do this?