4

How to extend lines to Bounding Box in QGIS as in the following image:

enter image description here
Figure 1: Lines

enter image description here
Figure 2: Lines extended to Bounding Box

Link to Shapefile of Bounding Box: https://drive.google.com/drive/folders/1jsJ8m2dG0DNwF1jepxpWzwfUVI5sVJJe?usp=sharing

Link to shapefile of lines: https://drive.google.com/drive/folders/1BQvrMiPillL5ubYsDHfEyoV9st12z0E9?usp=sharing

5

Use this expression with geometry generator or the Geometry by expression tool - the expression is adapted to the data you provided (layer name: 'Bounding Box', distance to extend the line: 65):

intersection (
    extend (
        $geometry,65,65
    ),
    geometry (
        get_feature_by_id(
            'Bounding Box',0
        )
    )
)

enter image description here

5

It may not be the most elegant way. However, you use "Extend line" to extend lines by the distance of the longest edge of the polygon.

enter image description here

The output looks like this and you can clip by Polygon with the "Intersection" tool.

enter image description here

And the output looks like this enter image description here

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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