Jump to content

Recommended Posts

Posted

As part of our admission process, we want to start to take into account the distance from our school. This must be 'as the crow flies' and should be as accurate as possible. I've found several sites on the Internet where you can put in postcodes and it will calculate the distance between. However, we can have as many as 400 applications to process so some automated way of doing this would be ideal.

 

Apparently, our LEA (Cumbria) has a Data Map service that can do this for us. However, we also take admissions from Lancashire and North Yorkshire so we need some way of calculating those ourselves. Does anybody do this already and, if so, have any advice?

 

Many thanks.

Posted

How are you with Python scripting?

 

Have a look at these: https://stackoverflow.com/questions/44176381/calculate-road-travel-distance-between-postcodes-zipcodes-python

 

The first one will do it for you but uses the Google Maps APIs (which you may have to pay for now, I can't recall). The second just converts postcodes into lat/long, from there you could use the Haversine formula (not perfect but good enough for this) to calculate the distance.

  • Thanks 1
Posted
Not a lot of help sorry but I remember our Admissions lady produced a map of our families in Google Maps by importing a CSV of postcodes. I wonder if you would then be able to analyse that or export the distances? Sorry to be vague but I didn't have any part of this so not even sure the method.
Posted

Not sure of how helpful this is or not (someone might have an actual solution, unfortunately I don't have the code anymore)! Wrote something similar for a estate agent project in university.

 

I used the google maps Geocoding API to convert address into a lat long. (there are websites that can do this with hundreds of addresses, or you can make your own solution)

 

I used the Haversine Formula(sp?) to calculate the distance. I know its compatible with excel.

 

EDIT : Some people got there a lot quicker!

  • Thanks 1
Posted
How are you with Python scripting?

 

Have a look at these: https://stackoverflow.com/questions/44176381/calculate-road-travel-distance-between-postcodes-zipcodes-python

 

The first one will do it for you but uses the Google Maps APIs (which you may have to pay for now, I can't recall). The second just converts postcodes into lat/long, from there you could use the Haversine formula (not perfect but good enough for this) to calculate the distance.

 

Many thanks, that looks like a great place to start - much appreciated.

  • Thanks 1
Posted
If you're interested, I got bored and so wrote a little web tool that does this. You can feed it a "central" postcode and a bunch of ones to test against. It even dumps the output in CSV format if you want for easy copy-paste to Excel.

 

http://serenity.uk.net:8080/postcodes

 

Many thanks. I'm working on a Powershell script to calculate distances from Post Codes so this will be useful to check my results. Cheers.

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...