0

I have a very big polygonal layer (over 1 million objects). This layer contains a 'gid' column whose values uniquely identify each object. There is also a 'hierarchy_level_id' column: this string columns allowing to characterize the importance/priority level of each object: 1, 2A, 2B, 3A, 3B. My goal for this layer would be:

  • To perform a union process in the QGIS meaning: https://docs.qgis.org/3.40/fr/docs/user … html#union
  • In the result/output file, I want to create two new columns. The first column list the 'hierarchy_level_id' for each feature. And a second column would retrieve the maximum value of the 'hierarchy_level_id' for each feature.

In other words, for areas where there is one or more overlaps, I don't want that my union result contains as many identical features as there are features participating in this overlap. I want a single unique feature to be created per overlap/overlapping area.

How can I perform this process with QGIS? Should I use the QGIS Union process? Use the aggregate function? Or something else?

2
  • have you worked with qgis expressions before? Commented Jul 22 at 14:49
  • Thanks @Taras. I'm not a qgis expert. But i have already worked with qgis expressions sometimes. Commented Jul 22 at 15:06

1 Answer 1

1

enter image description here

Union the layer with itself, no overlay layer.

Aggregate the output, group by wkt geometry: geom_to_wkt(@geometry, precision:=1), maximum of "hierarchy_level_id"

enter image description here

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.