2

I have multiple (50) layers representing rivers and creeks which are polylines. However, they are broken into line segments so each river/creek layer might have 30 or so features within it.

I know how to select and merge features within 1 layer but is there a way in QGIS to do this as a batch process with all 50 layers?

Otherwise, I have to manually go through and merge each line layer separately.

Perhaps someones know of a script to perform this. The process for 1 layer is:

  • open layer for editing
  • open attribute table
  • select all in table
  • merge selected features
  • close and save

Essentially I need to run these 5 processes on each of the 50 layers?

Taras
35.8k5 gold badges77 silver badges151 bronze badges
asked Jan 8, 2020 at 4:03
1
  • 2
    Do your creeks have attributes like name, order, perennial etc that need to be kept? Merge is a term that is used for combining feature classes into a single one, the term which it sounds like you're after is dissolve, read more gis.stackexchange.com/questions/173446/… It might sound like nit-picking to suggest a different term but you will find searching for 'merge' gives different results to searching for 'dissolve'. Are you hoping to automate this with pyqgis? Commented Jan 8, 2020 at 4:09

1 Answer 1

3

Have a look at the dissolve tool. It dissolves/merges all features of a layer into a single multi-feature, or dissolves based on an attribute, e.g. the name of the rivers (no need for 50 separate layers next time).

As with most tools, you may start batch editing at the bottom left. When filling in the layers into the batch dialogue, make sure to select all of them, they'll be added at the bottom. No need to select a layer separately for each row.

answered Jan 8, 2020 at 8:14
2
  • 1
    After batch-dissolving, you can use the merge vector layers tool to combine the dissolved streams into a single file. Commented Jan 8, 2020 at 17:13
  • Awsome thats exactly the tool I neede csk!! Thank you Commented Jan 9, 2020 at 0:55

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.