4

I've had a request recently to generate a map which includes UK Postcode districts, ie aggregations of postcodes based on the first section of the code (NW2, B1, E11 etc.).

From what I've read, these aren't available freely (Postcode Shape Files for the UK).

Is there a way of scripting aggregation of boundaries in either QGIS (or possibly R)? I've done this sort of aggregation before using MapBasic but no longer use MapInfo (plus it gave really messy boundaries).

I'm thinking I may use Voronoi regions rather than the actual postcode boundaries as this will be easier in terms of file handling (my postcode shapefiles are split across lots of files so easier just to run Voronoi on the OS Codepoint data set, plus I imagine this will give cleaner, if less accurate, boundaries)

Tumbledown
  • 1,683
  • 3
  • 20
  • 30
  • this API will give you UK postal unit level boundaries(ZE1 0AE) which does voronoi already.., district(NW2) and sector, for example, ZE10 check out www.boundaries-io.com – Jeryl Cook Aug 19 '17 at 17:08

2 Answers2

2

if you are using postgis (SPIT plugin) with qgis, you can use ST_ConcaveHull function for aggregation of boundaries.

i hope it helps you...

urcm
  • 22,533
  • 4
  • 57
  • 109
2

Thanks to Aragon but I found a simpler solution. I ended up using the dissolve function in QGIS. I didn't realise it was possible to do this based on a grouping value. It took a long time to process but got the job done with minimal effort. Definitely a case where learning the correct terminology probably would have gotten me to the answer faster.

As a side note, it turns out the same technique (dissolved Voronoi regions) was used to generate the postcode district maps on Wikipedia. The only downside is that some clean up is needed on the resulting polygons.

Tumbledown
  • 1,683
  • 3
  • 20
  • 30