The purpose of map generalisation is to represent spatial data in a way that makes it possible to effectively view the data at scales smaller than that for which it was originally intended. In the case of the Ordnance Survey’s MasterMap product you have data at an incredibly fine level of spatial resolution, which is ideally viewed at a scale of approximately 1:1000 give or take 500. When you are reliant on MasterMap, but need to create map of a wider area you are faced with the challenge of generalising data so that it can be ably understood, this means reducing the complexity of components of the spatial data, for instance smoothing wiggly lines, or transforming complicated polygons into simpler ones, as well as aggregating an abundance of small features into larger ones. Such interventions are necessary because it is increasingly difficult to resolve fine detail as map scale decreases, leading to complex shapes appearing messy and disordered when visualised at smaller scales that that which they were intended for. The actual scale of a map gives us an insight into the types of objects that it is possible to resolve at different scales; at a scale of 1:1000 a physical distance of 100cm represents 1km, at 1:10000 and 1:100000 the distance of 1km is covered by 10cm and 1cm respectively. If we conservatively suggest that we can resolve features that are 5mm across, then at 1:1000; 1:10000; and 1:100000, the smallest real world objects that can be represented are 5m, 50m, and 500m respectively. These distances equate to real world objects such as large cars and trucks (c. 5m in length), Olympic-sized swimming pools and office buildings (50m), whilst a distance of 500m is twice the span of Tower Bridge. Evidently, there are significant difference in what constitutes appropriate detail at each of these scales.

I’ve been dealing with one such problem recently, involving the representation of MasterMap building outlines at a scale of 1:10000, somewhat smaller that the 1:1000ish that it was intended for. In order to create an effective map I did needed to generalise the building outlines, however, unfortunately I don’t have access to ESRI’s ArcGIS “simplify building” tool due to licensing restrictions, so I had to come up with another solution. Initially I attempted the classic line generalisation procedure – the Douglas-Peucker algorithm, which simplifies by reducing the number of points in a curve subject to some pre-specified threshold value. However, buildings are strong geometric shapes, often rectangular and orthogonal, so an algorithm such as the Douglas-Peucker can have the effect of disrupting the geometric regularity of building outlines, removing corners etc. What is required is a polygon simplification algorithm that preserves orthogonality, however I couldn’t find anything that did this whilst being accessible, instead I had to come up with a procedure to approximate a generalisation of the building polygons by another methods. The image below reveals the result, which I think is successful enough to use.

In the image above, A is the raw data, and B is the generalised data. I experimented with a few approaches, but the one I assessed as being the best was to position an enclosing rectangle around each building polygon, so that the area of the enclosing rectangle was minimised, and subsequently buffer the result to close any small gaps, choosing to dissolve as well in order to further reduce the complexity. Subsequently I removed the particularly small buildings. The generalisation is more in evidence in the image below, in which A and B are the same as before.

I am reasonably pleased with the result, which was achieved after a little trial and error. Whilst technical approaches to orthogonal simplification exist I can’t imagine them being much more effective at this scale, although perhaps at smaller scales they would be more appropriate as they can create meaningful aggregations of building based upon characteristics such as nearest-neighbour distance.

December 22nd, 2011

byMichal MigurskiCan you say more about the enclosing rectangles? Are they oriented north-south, or with respect to the building? How do you decide which polygons to merge together? Looks great!

January 4th, 2012

byDaniel LewisThe enclosing rectangles are orientated so that they have the smallest possible area in completely covering each individual building polygon – this means that the rectangle should account for buildings which are not north-south or east-west in orientation, as it rotates the rectangle for best fit. The merge here is a little rudimentary, I apply a small buffering operation – enough to fill any small gaps between houses, but not enough to cross a road (really a matter of a metre or two) and then dissolve, or merge, the polygons that subsequently overlap. As many of the houses in the area are terraced, the complexity of long buildings with many subdivisions is simplified. As noted, there are sophisticated algorithms to do this – orthogonal simplification – but I didn’t really have access to them, since this slightly cobbled together procedure!