Skip to content

gavinheavyside/geopostcoder

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

GeoPostCoder

Loading Code-Point Open data into your database

First order and download the Code Point Open files from the Ordnance Survey and unpack them locally. You should get a Data/CSV directory containing a file for each postcode prefix. In total there were about 1.68 million rows (Q1 2013).

Create your database and install PostGIS extensions (assuming Postgres 9.1+, PostGIS 2+, and sufficient DB privileges).

$ createdb geopostcoder
$ psql -c "CREATE EXTENSION postgis" geopostcoder

Then you can load the Code-Point Open data into your db:

$ cat /cpo-download/Data/CSV/*.csv | script/load_code_point_open -d <database>

Running a local server

copy config/database.yml.example to config/database.yml, and edit it to match your database name

Install the necessary gems by running bundle install, then start the server with thin start.

Point your browser at http://localhost:3000, and try out reverse geocoding some latitudes and longitudes to UK postcodes.

License

GeoPostCoder is released under the MIT License.

About

Reverse-geocode lat,lng to UK postcodes, using Ordnance Survey OpenData and PostGIS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published