[GIS] How to get a set of all buildings of an OpenStreetMap section in form of single points / Multiple polygons as one point

centroidsopenstreetmaposm2pgsqlpostgisqgis

The objective is to get a set of all buildings of an OpenStreetMap section in form of single points in a shapefile.

  1. I downloaded the section from OSM.
  2. Imported the section into QGIS (and later imported it into a PostGIS db using osm2pgsql)
  3. To transform the polygons (representing buildings) into points I used the Polygon Centroids function

Unfortunately some of the buildings are represented by multiple polygons subsequently I did get multiple points for one building which I is not what I wanted.

Searching the web I found out that these polygons should be multipolygons but neither QGIS nor osm2pgsql does import these relations so that I could merge the polygons of a building

Any ideas how I could get single point list of the buildings?

Best Answer

You can create a very small buffer around your polygons and dissolve all, before creating the centroids.

This would also unite buildings that share a common wall.

Related Question