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:

Taras
  • 32,823
  • 4
  • 66
  • 137

3 Answers3

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.

csk
  • 24,827
  • 3
  • 32
  • 70
  • 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 Jul 31 '18 at 14:54
  • 1
    Yep. That's the tradeoff with this method. – csk Jul 31 '18 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:

Taras
  • 32,823
  • 4
  • 66
  • 137
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

Taras
  • 32,823
  • 4
  • 66
  • 137