I would like to create one polygon including others polygons that has an ID < 16 .

enter image description here

The yellow polygons have ID < 16 and I would like to create a polygon like this: enter image description here

EDIT : I do not want to get a multipart polygon, but a singlepart polygon and fill the spaces in between.

Probably not a good idea, but polygons being always alligned by ascendant numbering ( 1 - 2 - 3 - 4 - ...) , a logics could be to join polygon ID 1 to the polygon ID 2, then the polygon ID 2 to the polygon ID 3, etc. by joinning the closest corners to the next ID polygon.

I've no idea how to accomplish this task, is there a way to automatize it?

EDIT : the aim is to have only one polygon at the end

  • I've edited my question in order to add a logics of numbering, I thought it could be helpfull?
    – zlikotp
    Commented Aug 6, 2022 at 0:29
  • and the answer of your question is yes, I need to keep only polygons that match with a condition depending of the value of the field
    – zlikotp
    Commented Aug 6, 2022 at 0:30
  • Crete a new field with an expression like this if("ID" < 16, -1, $id) this will set all the features with ID < 16 to -1 and any other values to the feature id (which is unique). Then dissolve by this new field.
    – Mayo
    Commented Aug 6, 2022 at 1:21
  • ok this could be the first step, but my need is to have 1 polygon that include all fields with ID < 16
    – zlikotp
    Commented Aug 6, 2022 at 7:32
  • 1
    What more do you need than what Mayos answer gives you? That will make a new layer with exactly what you asked for. Commented Aug 6, 2022 at 9:06

1 Answer 1

  1. Select by expression with the expression ID < 16

  2. Merge Selected Features

enter image description here

To further proceed to fill the space between the parts of the merged polygon to get a contiguous single-part polygon, you can use concave hull:

  1. Extract vertices (you might use this with Selected features only, then you can skip step 2 from above).

  2. Run Menu Processing > Toolbox > Concave Hull (alpha shapes) on the vertices layer. Set an appropriate value for Threshold - in my case, 0.14 produced the result shown below.

The pink polygon represents the output of Concave Hull (alpha shapes): enter image description here

  • thanks for this proposal but it merges the entities, but doesn't merge polygons. My aim is to have only 1 polygon at the end.
    – zlikotp
    Commented Aug 6, 2022 at 11:42
  • What do you mean by "entities"? The solution indeed creates just one (merged) polygon, so I'm not sure what the problem is.
    – Babel
    Commented Aug 6, 2022 at 11:43
  • When I open the "Attribut table" of this layer , there is only 1 row (1 entity), but visualy, I see several polygons. Is it more clear?
    – zlikotp
    Commented Aug 6, 2022 at 11:46
  • for exemple, when you look at the second screenshot I sent into the question, there is only 1 brown polygon
    – zlikotp
    Commented Aug 6, 2022 at 11:48
  • 1
    thanks, now I need to batch this function with condition, I'm going to create a new topic !
    – zlikotp
    Commented Aug 6, 2022 at 12:39

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.