6

I have a road network in the form of a line, that I need split up into sections, if a polygon intercepts.

This is fairly straight forward, but I have several layers of polygons where I need the full extent of the line, if it is continuous across several polygon layers.

I've tried to illustrate this with a picture, what I need is basically all the lines marked with Red on the picture, to be a separate new line.

As the picture shows, sometimes only a green polygon intersects, but other times it's a green polygon followed by a purple, and then I need it to be a full line across the several polygons. What is the easiest way to achieve this in QGIS?

enter image description here

1 Answer 1

7

I would probably do the following:

  1. Merge all polygon layers:

    Vector > Data Management Tools > Merge vector layers
    
  2. Dissolve your merged layer:

    Vector > Geoprocessing Tools > Dissolve
    
  3. Clip your line layer with the merged polygon layer:

    Vector > Geoprocessing Tools > Clip
    
  4. Find the symmetrical difference of your clipped line layer:

    Vector > Geoprocessing Tools > Symmetrical difference
    
  5. Delete duplicate geometries of your symmetrically differenced line layer:

    Processing Toolbox > QGIS geoalgorithms > Vector general tools > Delete duplicate geometries
    

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.