5

I have a polygon which represents a water catchment. I also have a polygon that represents a national boundary. I would like to cut out a line that represents only the part of the catchment boundary that goes across the country. In GIS terms, this means I would like to cut out a line from a polygon between two points that I define. I would like the right hand part of the green polygon extracted as a line.

enter image description here

Can anyone direct me to a tool that would allow me to do this simply please? I haven't managed to find a toolbox or tool or plugin that seems to do this.

2 Answers 2

4

Manually, you can do it with the tools of the snapping tools bar. First, you have to activate snapping and choosing "advanced configuration" like below The option "Enable tracing" will made the job with only two (or many three) mouse-clik. enter image description here

enter image description here

4
  • Thanks for this. However, I am struggling somewhat to get the line to trace all the points in between. I am snapping at various vertices, but it doesn't automatically create the line for all the vertices in between. Does that make sense? Commented Jul 13, 2021 at 9:57
  • Normally, yes it must automatically create the line for all the vertices in between. In the exemple I made only one click to define the start point and one click for the end of the line. The tools enable tracing follow the border. Do you have activated/checked the two polygons in the "projet snapping Settings" and then choose "vertex, Segment"? Commented Jul 13, 2021 at 11:31
  • 2
    @MichaelHammond snapping tends to get tricky when there are too many vertices available - try deactivating unnecessary layers and/or zooming in.
    – Erik
    Commented Jul 13, 2021 at 13:50
  • Thanks, this solved my problem. Thanks for the help Commented Jul 13, 2021 at 14:44
4

If you have a country- and a catchment-polygon, you can use QGIS expressions with Geometry generator or Geometry by expression to create the part of the catchment's boundary inside the country. Use this expression (replace 'country' with the name of your country-layer):

intersection (
    boundary ($geometry), 
    geometry (
        get_feature_by_id (
            'country', 
            1
)))

Screenshot: the expression in action, here with Geometry generator. It creates the red line (blue catchment; orange: country): 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.