Skip to main content

 

I have a layer with polylines that intersect with polygons where I use the method intersection (Spatial filter). I want to remove those lines where bigger parts of the line is outside than inside a polygon. How should I proceed?

BR

Does a polyline always intersect just a single polygon like the left figure? Or can a polyline intersect two or more polygons like the right figure?

intersections


I'd follow this process

  • Calculate the length of the lines
  • Store the geometry as an attribute
  • Clip the lines with the polygons
  • Calculate the length of the clipped lines inside the polygon
  • Test if that length is greater than 50%
  • Recreate the original geometry from the attribute stored in step 2

Capture


Reply