I have two shapes of lines: one A with exploded red lines, the other B with closed black lines.
In a virtual layer I want to select the yellow ones (A) i.e. those having only 2 points in common with B.
I try to find a way to count the number of intersections between 2 lines without success.
Or maybe there is a better way to do it.
@JGH There is something weird when I work with my data. I can't get the result you show on your screenshot. When I run the query to get the same result as you:
SELECT poly.*
FROM input1 as poly, input2 AS ouverture
WHERE st_intersects(poly.geometry, ouverture.geometry)
AND st_dimension(st_intersection(poly.geometry, ouverture.geometry)) = 0
Then the result is the red lines :
The green polygons (poly) have only 4 nodes and topology is correct with black lines. It runs from a model so green polygon file converted to lines is not visible.
The strangest are the two red lines at the bottom which are the opposite of the expected result.
@Taras : result is empty.
EDIT : sample of data
shp and comments inside.