Postcodes in Polygon: A Thing I Made

Last week Simon Whitehouse at Digital Birmingham wondered aloud whether anybody had used the Ordnance Survey’s Code-Point Open postcode data to create a mapping tool where a user could draw a polygon and produce a list of all the postcodes in that polygon.

I was inspired by Simon’s post to have a go at this problem, building on some previous work I’d done with the Google Maps API and point data. The result is this Postcodes in Polygon demonstration tool now on my website:

http://www.owenboswarva.com/postcodes/

The Code-Point Open postcode data set is available under the OS OpenData Licence, which is basically the Open Government Licence with additional attribution statements. This means anyone can download the data and use it for free for both personal and commercial purposes.

I’ve also open-sourced the JavaScript that I wrote for this project, so anyone is welcome to re-use it.  It would be nice to see an implementation based on the Ordnance Survey’s own OpenSpace API, for example.