I'm pretty new to QGIS and python in general. For my work I'm faced with a bit of a problem.
I got 100-m-segments of several streams and polygon-features of the surrounding substrate. The polygon features determine if sand, gravel or stones are the primary substrate in the stream segments. So I tried using a simple spatial join. If I do that however only the segments that are 100% inside a certain substrate are correctly joined. If a segment is overlapping with two substrates, then the bigger overlapping polygon (> 50%) should be used as the primary substrate.
Is there a plugin for QGIS (version 2.18) that can do this? Otherwise, how can I create a corresponding Python script?
I searched for hours and found similar problems only with two polygon features so I tried to modify a script but failed. (Percentage of polygon in one shapefile within polygon of another)