8

I have a shapefile that contain bus lines. You can see a screenshot below:

enter image description here

I would like to visualize the lines in a more understandable way since there are a lot of overlapping sections.

I have tried to experiment with the offset of the lines.

enter image description here

However, this is a bit tricky since new overlapping sections are created.

Do you have a better recommendation? My goal is just to present them in a more understandable and clear way.

1
  • 1
    If that is all your data maybe you can manually digitize a transit map
    – BERA
    Feb 28, 2022 at 9:40

1 Answer 1

6

You can use the "Geometry Generator" to create additional lines where several lines overlap. I have 3 lines in 3 colors with an attribute no with values 1, 2 and 3. The lines are exploded.

I start with the red line (no 1) and create an additional symbol layer for each line that shares the same segments. Create an expression that only returns those segments from lines 2 and 3 that overlap, then apply an offset to that line and style it accordingly (color).

I used this expression to get the segments of line 2 that overlap line 1:

if (
    no=1,
    overlay_equals(
        @layer, 
        $geometry, 
        filter:=no=2
    )[0],
    ''
)

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.