NPE Maps Addon
I’ve written a little utility using the NPE Maps data, a great project designed to geocode the UK. I needed it for something experimental, but I’m happy to share my utility.
The idea of the utility is to take each of the records that is in the NPE Maps outward + 1st inward database and create a "crow flies" distance between them, allowing for fast lookup in a database.
It does this by reading them all, then comparing them to each other, and doing a little of the old pythagorus theorem to come up the distance. The output is comma separated values of outer postcode 1, 1st inner postcode 1, outer postcode 2, 1st inner postcode 2, distance (in miles).
To run the program, download and save the NPE maps file, then run:-
python buildcrowsfly.py inputfilename outputfilename
Be warned… the output file is huge (something over 1GB).
Once you’ve got the file, you can import it into a database (I used SQL DTS for my input). The code’s there, and you can use it how you wish. If you make some changes, please be generous and pass them back.
Download buildcrowsfly.py
—–
Discussion Area - Leave a Comment