[Talk-GB] Postcodes map

Dave osm.list at randomjunk.co.uk
Wed Mar 28 17:12:59 BST 2007


Hi All,

I've made a slippy map showing postcode areas:
http://beerwarmer.randomjunk.co.uk/osm/postcodes/

The data comes from the current list at NPE maps ( http://www.npemap.org/ ).
I've got it overlaying the mapnik layer from OSM at the moment.

It's currently rendered down to level 11, and level 12 in places.
The black lines are the boundaries of the first letters (eg: SW). The blue
lines are for the first part of the post code (eg: SW15). And the thin green
lines are the first number of the second part (eg: SW15 2)

If anyone is interested, it's a python script that generates shapefiles,
which are then rendered using mapnik and the generate_tiles.py script that
OSM uses.
The script works by:
 - feeding in the post code points into a voronoi diagram generator
 - extracting edges from the diagram where post code boundaries meet
 - forming polylines from these edges, and writing them to a shapefile

There's a couple of bugs at the moment:
 - post codes on the coast may have missing edges
 - the post code boundaries need clipping to the coastline
 - I think there are some degenerate cases, or incomplete post codes which
cause things to go a little wrong.

There might be a whole lot easier way of doing this: in which case please
let me know!

I'll post the code on the site when I've cleaned it up a little.

Dave

PS: it's just an ADSL connection so don't expect it to go very quickly...
:-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/talk-gb/attachments/20070328/45f4842d/attachment-0001.html>


More information about the Talk-GB mailing list