2

In QGIS 3.22.5 I would need to measure the distance in meters between two vertices on a linear shapefile. This linear shapefile is a transect that has a vertex on the shoreline.

How do I measure the distance between this latter vertex and another point along the transect in which the transect intersects a polygonal shapefile?

enter image description here

0

1 Answer 1

2

I suppose the point on the shore is the start-point of the line. To create the line from here until the crosspoint with the green polygon and measure the length of this line, use this expression:

length(
    make_line (
        start_point($geometry),
        intersection (
            $geometry, 
            boundary(
                overlay_intersects('green', $geometry)[0]
            )
        )
    )
)

Replace green in line 7 by the name of your polygon layer. If the point on the shore is the end-point of the line, replace start_point in line 3 of the expression by end_point.

Red line, created based on the expression above, is that part of the black line from the start point until the crossing point with the polygon's boundary:

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.