Want to know the distance from 1 postcode to 1000 others

Soldato
Joined
31 May 2006
Posts
4,239
Location
127.0.0.1
Hi all

I have one post code which is my destination. And 1,000 others which are my sources. I want to know the distance between the destination post code and each of the source post codes. BUT!!! I need the distance to travel by road not as the crow flies. So it would give me:

N1 1AA to L1 1AA = 5.7miles
N7 2XX to L1 1AA = 12.8miles
etc.....

Any ideas?
 
For anyone wondering how I eventually did this, I took yhack's suggestion of using the url and pulling the value from between the div declaration.

I used a VBscript to loop through a SQL server table, providing the postcodes to search between, generate the required url and then fired off wget to download the resulting page. Then the VBScript stripped out the value from the downloaded webpage and populated the SQL server table with the distance.

The only problem I encountered was that after the 338th request in 6 minutes, Google blocked me! Lol. Obviously I needed to add a delay in. The block was removed after a few hours and I continued with a 30 second delay for each request.

Thanks to everyone who contributed a (sensible) solution ;)
 
Back
Top Bottom