Skip to main content
2 of 7
Answer extended
Taras
  • 34k
  • 4
  • 73
  • 148

Tested on QGIS 2.18

I can suggest using Virtual Layer through Layer > Add Layer > Add/Edit Virtual Layer...

Let's assume I have two layers, namely "lines_test" and "polygons"

Input

With using this query you may achieve the result you are looking for. Have I correctly understand you?

SELECT *
FROM polygons, lines_test
WHERE ST_Within(ST_StartPoint(lines_test.geometry), polygons.geometry) OR ST_Within(ST_EndPoint(lines_test.geometry), polygons.geometry)

Output


References:

Taras
  • 34k
  • 4
  • 73
  • 148