I have polygon features (like streets or fields) and a line feature over them. I want to have all the polygon features touched by the line in a separate layer. If I run clip or intersect it only outputs a line (as expected). But is there any way to actually do this automatically in QGIS?

I have all my layers and data saved in a PostgreSQL database.

  • 3
    Try a select by location or by expression then export selected feature
    – J.R
    Commented Mar 19 at 15:22

2 Answers 2


Use extract by location from Processing Toolbox > Vector Selection > Extract by location. In the Extract features from field, select your polygon layer from the dropdown menu. and in By comparing features from field, select your line layer. Choose one or more geometric predicate and then Run. This should give you a new layer with extracted features from the polygon layer.

enter image description here


One option is Extract by expression:

creates a new vector layer that only contains matching features from an input layer. The criteria for adding features to the resulting layer is based on a QGIS expression

I want to extract from nature (polygon layer) which intersects railroad (line layer):


enter image description here

Your Answer

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

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