4

I have a polygon layer with buildings for the area of the whole city.

Buildings_view_Input

My question is how to dissolve/aggregate/merge only those buildings, that are "neighbours", in the sense that they share at least one mutual wall or the distance between walls is miserable, e.g. roughly saying less than 0.5 m.

My desired result should look like

Buildings_view_Output

I have in mind several approaches which might be applied.

  1. In layer create a column with a unique number and then apply Vector > Geoprocessing Tools > Dissolve (by this unique number)

  2. With much manual work Select Feature by Freehand > Merge Selected Features

Unfortunately, in both cases, it requires tremendous manual work, therefore I would love to optimize the process.

For large-scale maps, it is definitely an advantage to have each building separately, nevertheless, when working with bigger scales, the appearance of too many buildings on a small piece of a map, makes it overcrowded, causing the "ruffling effect" and cartographic generalization is a strong necessity.

The following examples do not really suit my request:

4
  • 2
    try this. don´t forget to singlepart the end result.
    – geozelot
    Commented Jul 30, 2018 at 13:04
  • 1
    btw., if partially separated multipolygons are to be generalized into one, a convex hull might be a quicker solution, as dissolving will not 'fill the gaps'.
    – geozelot
    Commented Jul 30, 2018 at 13:28
  • @ThingumaBob, thanks for your reference, to a more or less relevant suggestion. However, it includes a part which I am trying to avoid, i.g. "...give each of your buffered polygons a unique ID." Can you recommend something else, please?
    – Taras
    Commented Jul 31, 2018 at 15:01
  • ThingumaBob, can you tell me please which Geometric Predicates should I chose for the Join attributes by location because this issue Documentation “Join Attributes by Location” QGIS 2.18 does not give me much information. Danke
    – Taras
    Commented Sep 7, 2018 at 10:41

3 Answers 3

4
  1. Add a 5m buffer, and choose the option to dissolve the result.
  2. Remove the buffer by running the buffer tool with a -5m value buffer distance (negative five meters).
  3. Then split multipart to singlepart.

If necessary, run a spatial join to get back individual building attributes.

2
  • 1
    @csk, I do not understand what do you mean by "Remove the buffer by running the buffer pool with a -5m value buffer distance (negative five meters).". If I apply it to my new buffer with 5m (positive value) then the result is quite "imprecise".
    – Taras
    Commented Jul 31, 2018 at 14:54
  • 1
    Yep. That's the tradeoff with this method.
    – csk
    Commented Jul 31, 2018 at 17:09
3

I have found a way that optimally fulfills my issue.

  1. Produce Buffers for each building set with Vector > Geoprocessing Tools > Fixed distance buffer

    • Buffer radius was 0.5m
    • The Dissolve option was enabled
  2. Perform a clip between the original layer with buildings and a new layer with buffers Vector > Geoprocessing Tools > Clip

  3. Split a new layer Split selected multi-part features into a single part

    Split selected multi-part features to a single part

    There is also a QGIS plugin called "Multipart Split" which could probably help.

  4. Transfer all attributes for each feature from the original layer to a new layer Vector > Data Management Tools > Clip

Additionally, the Filter... "Area" > 150 could be applied to reduce the number of buildings with the elimination by area, those that are smaller than enter image description here would be not visualized.

However, there is still some additional work left, because of the small distance between buildings (more than the radius) and inconsistent geometry of the original layer with buildings.

Thank you @csk and @ThingumaBob for your suggestions and inspiration.


References:

2

Since QGIS 3.26 (see the Changelog) the classical "Dissolve" geoalgorithm has an advanced parameter called 'Keep disjoint features separate'


The same result can be achieved with "Dissolve" geoalgorithm from the GDAL library.

Do not forget to tick the 'Produce one feature for each geometry in any kind of geometry collection in the source file'.


Input:
input

Ouput:
output

Not the answer you're looking for? Browse other questions tagged or ask your own question.