Monday, 5 October 2015

Get attribute from touching line layer (QGIS)


I have two line layers. The features of both are touching each. Now I would like to label one of the line layers with the attributes of the touching layer.


The case: In the one layer are drain's (green) and in the other one are cables (red). The cables are inside the drain (digitized with snapping to the drains). Now I need the drain-id (green labels) labeled on every cable.


enter image description here


I have to use shape files! So I thought to use the aggregate function of QGIS...



Answer



You can use RefFunctions Plugin together with this expression:


 geomintersects('drain','drainid')

'drain' is the targetlayername and 'drainid' the targetfieldname you want to get.



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...