I was developing a plugin in which there is a polygon buffer and line file, now i want to to find all the line segments that are outside the buffer and inside the buffer. Is there anyway to find them using QGIS tools. I want to save the line segment for every time it is outside and inside. I am attaching a pic for better clarity.

In the image below, i want the ones in red circle as different color, for example purple and black color and the one in blue circle as different color, maybe magenta color, and i want to do this with all the line polygons in the shapefile.

Can you help me if you have an idea?

enter image description here

  • 1
    If you also want to ask about PostGIS and/or PyQGIS then I think that is best done in separate questions, and in those I think you should include your code attempts.
    – PolyGeo
    Jun 5, 2021 at 5:47
  • For now, I just want to know the tools that i can use to complete this task. Jun 5, 2021 at 6:37
  • 2
    There is no tool. You can use clip vector for inside lines. Better way intersect line with buffer and select which lines are within and inverse selection which lines are out of buffer.
    – nagib
    Jun 5, 2021 at 7:22
  • how does the inverse selection work can i please know? Jun 5, 2021 at 17:41
  • you need to carry out intersections to make the line segments of interest
    – BJW
    Jun 5, 2021 at 22:47


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.

Browse other questions tagged or ask your own question.