1

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?

0

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.

  • In qgis >buffer with small distance and option "dissolve buffer results" left me with a shapefile of one element which isn't what I was looking for... – Johannes May 21 '14 at 20:09
  • GRASS did do it: v.dissolve input=build output=test column=building – Johannes May 21 '14 at 22:39
  • In QGIS, you can try Multipart to single part before creating the centroids. – AndreJ May 22 '14 at 3:52
0

Used the OSM Download Plugin

Used your coordinates

downloaded the .osm

Loaded this in to QGIS

Extracted 'Building = Yes'

Used the Vector > Geometry Tools > Polygon Centroids

You can delete unwanted centroids or clean up the data before creating the centroids all data has attribution.

enter image description here

  • That is exactly the way I did it, but as I want to use this procedure later for other data I can't manually clean up before or after creating the centroids (too many buildings). – Johannes May 21 '14 at 18:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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