I am trying to extract building footprints from a raster map (as shown in the example below). Please note that the maps are out of copyright, have been scanned and georectified by a library and have been provided to me for exactly this purpose.
So far I have been using the NYPL Map-Vectorizer which works by first adjusting the brightness/contrast of the image, then setting a colour threshold to extract a black and white image, which in turn is processed using gdal_polygonize.py (followed by some simplification and removal of roads).
The issue is that this gives polygons of the inside of the building. Terrace buildings end up with a gap between them.
How can I post-process to remove the gap between the terrace buildings? Is there an altogether better method for extracting building footprints from this map?
Note: Solutions need to be able to run as a script. I'm able to test proposed techniques in QGIS.
Best Answer
For rough build up areas:
For the example image the result processed by python script looks like this:
Some graphics and CAD software has good tools to convert technical drawings lines to polylines and can be scriptable but it is far from perfect and needs much additional manual work:
At the end for these kind of tasks if you need good quality vector polygons you need to do that manually.