0

Is it possible to split lines into parts and give a minimal distance for the parts to be split?

I have a layer with rivers, some of them are one object, even if they are hundreds of kilometers away from each other. How can I split them into dedicated lines?

If I use the tool parts-to-single, the lines will be split into small segments. I want to say: split if the parts are >50km away from other parts, to get single, but complete lines for each river.

0

1 Answer 1

2

Starting data :

  • rivers layer with a unique identifier river_id to identify each objects, each grouped segments of rivers

Processing :

  1. Do a buffer on rivers, not dissolved, with a distance of 50 km / 2 so 25 km. If you want strictly >, you can do a buffer of 24.9999 km

  2. Your buffer_25km has a river_id, so dissolve this layer and select as Dissolve field river_id.

  3. Apply on the new buffer_25km_dissolved a Multipart to Singleparts

  4. Create an unique field on the single_buffer_25km_dissolved to identify each patch buffer_id updated with $id

  5. Apply on rivers a Multipart to Singleparts

  6. Create a new field (integer) on single_rivers and retrieve the buffer_id data into this field by location or overlap_within( expression

  7. Dissolve single_rivers and select as Dissolve field river_id and buffer_id

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.