Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

81 lines (57 sloc) 3.76 KB


A tech demo built on top of Play Framework 2.0 that imports the CodePoint Open UK postcode dataset and offers a Geocoding RESTful API and a map.

Prerequisites: MongoDB and Play Framework 2.0.


Edit conf/application.conf and point it to a MongoDB installation, and execute

play run

Then put the CodePoint Open CSVs (scroll halfway down, 20mb) in the codepointopen directory.

After they are processed, they will be moved to the codepointopen/done directory.

Then visit http://localhost:9000/ and you should see the welcome screen. Visit http://localhost:9000/servermetrics for server metrics.


GET http://localhost:9000/latlng/POSTCODE to geocode a UK postcode. Response will be JSON:


Deploy to Cloud Foundry

This project includes a manifest.yml file that can be used to push the app to Cloud Foundry.

The value of "mem" in the manifest may be need to be adjusted depending on how much data you place in the codepointopen directory. Rough tests showed 1.4G used for files ab.csv-de.csv.

play -Dconfig.file=conf/cloud.conf clean pdist  (not a typo, pdist is a new task to include codepointopen files in the dist)
vmc push



Licensed under the WTFPL.

This data contains Ordnance Survey data © Crown copyright and database right 2011. Code-Point Open contains Royal Mail data © Royal Mail copyright and database right 2011. Code-Point Open and ONSPD contains National Statistics data © Crown copyright and database right 2011.

OS data may be used under the terms of the OS OpenData licence.


  • Fix distance calculation, Morphia does't do geoNear yet (grmbl)
  • Add add a map using Leaflet displaying all UK postcodes (need to think how to dynamically add layers depending on zoom level)


Welcome Page Map

Jump to Line
Something went wrong with that request. Please try again.