[Talk-GB] Postcodes map

Dominic Hargreaves dom at earth.li
Wed Mar 28 17:18:47 BST 2007


On Wed, Mar 28, 2007 at 05:12:59PM +0100, Dave wrote:

> 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...
> :-)

This is awesome. If you need hosting for this do ask us
(webmaster at npemap.org.uk) or OSM (on dev.osm?). I'd love to have this
featured on the NPEmap web site.

Cheers,

Dominic.

-- 
Dominic Hargreaves | http://www.larted.org.uk/~dom/
PGP key 5178E2A5 from the.earth.li (keyserver,web,email)




More information about the Talk-GB mailing list