altecsole Posted June 11, 2019 Posted June 11, 2019 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.
FishCustard Posted June 11, 2019 Posted June 11, 2019 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. 1
TechMonkey Posted June 11, 2019 Posted June 11, 2019 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.
Marci Posted June 11, 2019 Posted June 11, 2019 https://www.mapdevelopers.com/ would be able to code up a solution for you if you're not able to write your own in PHP / Javascript using Google Maps APIs (fairly straightforward _if_ you know PHP & JS). 1
cw222 Posted June 11, 2019 Posted June 11, 2019 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! 1
altecsole Posted June 11, 2019 Author Posted June 11, 2019 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. 1
FishCustard Posted June 13, 2019 Posted June 13, 2019 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 1
altecsole Posted June 13, 2019 Author Posted June 13, 2019 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. 1
altecsole Posted June 14, 2019 Author Posted June 14, 2019 Are you using the Haversine formula? If so, what radius are you using for the Earth?
FishCustard Posted June 14, 2019 Posted June 14, 2019 I'm using GeoPy's great circle calculation. I could probably have an option to switch between great circle and geodesic. 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now