I have two shapefiles: 'Lines' and 'Base-line'. One attribute inside 'Base-line' is the number of 'Lines' features overlapping that specific 'Base-line' feature. It basically represents the number of tubes inside the main pipeline.
A 'Lines' feature can be overlapped to a chain of many consecutive 'Base-line' features.
I need to fill the attribute in the 'Base-line' features after I trace all the 'Lines' over the already traced 'Base-line'.
The total number of 'Lines' overlapping the specific 'Base-line' will then be used by a Virtual layer to create and display labels for each 'Base-line'.
Both shapefiles share a common key representing the coordinates of the geometry.
I tried using something like
aggregate(layer:='LINES_9e784a1c_48d8_4510_a6a5_20967c6dff6c', aggregate:='concatenate', expression:=count("KEY"), concatenator:='', filter:=intersects($geometry,geometry(@parent)) )
But I think it would only work if the 'Lines' features have already been traced before the 'Base-line' (which is not possible). Any suggestions?
Example: there are 3 BASE_LINE features. Two LINE features are overlapping the first and then they proceed in different directions to overlap different BASE_LINE features.
This is what I get using
array_length(overlay_crosses( 'CAVI', $id))
Where CAVI are the LINES.