3

I'm drawing lines in a map that represent cables in underground pipes. Sometimes there are multiple cables going through the same pipe, so I'd like to draw each cable as a different line, but want it to be represented/rendered as separate lines having some offset and ideally even being differently colored. Have tried multiple approaches with symbology and geometry generator, but haven't really had a success. The main goal is to do it via rendering/display and not have to manually set different offset value to each line or draw parallel lines myself. Is this even possible in QGIS?

Let's say three separate cables are coming towards the manhole from the left, one cable goes up, two goes down:

cables going through same path

I want them to be displayed something like this to visually represent their actual paths:

offset lines

5
  • 1
    are the three incoming cables features in the same layer, or are they in different layers?
    – Llaves
    Sep 27 '20 at 0:32
  • they are in the same layer. And there sometimes are up to 5-6 such overlapping lines. I found this gis.stackexchange.com/questions/239129/… approach to be very near to what I actually need.
    – squirrely
    Sep 27 '20 at 18:55
  • 3
    Does this answer your question? Shifting display of overlapping lines in QGIS?
    – Simbamangu
    Sep 28 '20 at 16:19
  • In contrast to the already linked answer you want do get rid of the angled beginnings and just get parallel lines as in your "target" image?
    – til_b
    Oct 2 '20 at 11:51
  • Parallel only would be enough. GreyHippo's approach is interesting. Too bad it involves manual data input for each line. It would be great if you only added an overlapping line and it'd get immediately offset.
    – squirrely
    Oct 5 '20 at 19:59
3

You can create a categorized symbology for the cables based on an attribute that has the number of cables. For the line styles that have more than one cable, add a new simple line and adjust the offset value. I used 1 millimeter between lines. The problem you may run into is that the junction points may be two small to coverup the ends of the line

line style

map

toc

categorized

3
  • If there's no existing attribute showing the number of overlapping cables/lines, how would you create one?
    – Llaves
    Sep 28 '20 at 19:31
  • You would need to create a new field and fill in the data manually for each feature
    – GreyHippo
    Sep 29 '20 at 2:04
  • I used to do it something like this before. But when you need to put lots of lines and have to input all that data, you immediatelly start looking for some more elegant way. I'd prefer to just draw an overlapping line and offseting was done automatically no matter how many lines are put. I'd also like to have continous lines that actually represent single cable end to end. In your proposed way, I'd have to split it into parts at places where line count changes (for example where cables go different ways). But then I could just disable snapping and draw every line with wanted offset..
    – squirrely
    Oct 5 '20 at 20:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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