TransWikia.com

Changing default parameters of "Merge Selected Entities" in QGIS 2.18

Geographic Information Systems Asked by RClov on December 11, 2020

I am using QGIS 2.18, and I am looking for a way to change default values of the Merge Selected Entities algorithm.

To make it short, I have in my shape file buildings that are divided in several small parts (whereas it should not), and I would like to merge those part to get back a single building. However, one of my attributes is the height, and the default value of the merging algorithm is to pick one height among the merged entity, whereas I would like it to be always the maximum (I have quite a lot of buildings to fuse and I would like to avoid changing parameters every time I need to merge entities). Is there a way to change this through some files?

One Answer

I honestly do not know how to change the way software works. Instead, I'd suggest to add a new field which represents the maximum height of each building.

QGIS 2.18 has aggregate functions and one of the functions maximum() is useful for this case.

Below is a small test example:

  • Orange building (bldg_id is 1001) and Green building (bldg_id is 1234).
  • Each of Orange and Green buildings is composed of three parts.

enter image description here

Create a new field with an expression maximum("height", group_by:= "bldg_id")

enter image description here

Then the new field (max_H in this example) will represent the tallest height of the building parts.

enter image description here

After merging, just use this newly created field (e.g. max_H here).

enter image description here

Answered by Kazuhito on December 11, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP