Calculating average distance between multiple points

Associate
Joined
23 Mar 2009
Posts
348
Location
Midlands
I have a Google Map with 300 place markers on that comprise of places around the UK (also have as KML).

I need to calculate the average distance between points (i.e. if you was at one point, on average, how far would you have to travel before you get to the next point).

Does anybody know how on earth I could do this?! (sorry if it's in the wrong forum!)
 
The only way I could think of doing it to measure the distance between one point to all 299 others, and then do it again and again. Add the milage together and divide by 300. Lengthy process though.
 
Why would you want to know this?

An average point distance tells you nothing useful as it will massively overestimate the actual distance needed to travel point to point.

But it'd be very easy if you know programming well enough to build an algorithm which does it for you in a loop (as long as it can read a kml file okay).

Unfortunately I suck at programming.
 
Last edited:
The only way I could think of doing it to measure the distance between one point to all 299 others, and then do it again and again. Add the milage together and divide by 300. Lengthy process though.
Well you wouldn't need to do all that to find what he wants in the OP.

For each point, work out which other point is closest to it and work out the distance between them. Average those distances to get your answer.
 
total distance/300?
Don't you know the overall distance from point 0 to 300 as google tells you that already, so why can't you just use the above method?
 
We're looking into doing a 'order online, collect in-store' and want to add a 'On average people only have to travel x miles to get to one of our storse!' selling point to it :)

I guess from above the working out the distance from 1->2 2->3 3->4, etc and then /300 would be good... but I really don't have the know how :( Was hoping there may have been a site out there that did it already but Google has failed me on this one :(
 
use AA route planer and map a round trip via all the points , you can add them all by clicking on the +via option when you enter the info. This will then calculate the full trip distance.

Take that divide / 300 and bobs your uncle
 
We're looking into doing a 'order online, collect in-store' and want to add a 'On average people only have to travel x miles to get to one of our storse!' selling point to it :)

I guess from above the working out the distance from 1->2 2->3 3->4, etc and then /300 would be good... but I really don't have the know how :( Was hoping there may have been a site out there that did it already but Google has failed me on this one :(

Then the average distance between multiple points is not what you need.

You're talking about travelling from an arbitrary point in Great Britain (I guess? Or just England?) to the nearest store, right? The distance between stores is utterly irrelevant to that, as you're talking about people travelling from their homes to your stores.

What you could do, is set a radius around each store and expand it until it collides with the next raidus along. Do that and repeat over the entire set until none of the circles overlap, then look around for any uncovered areas and calculate a rough average distance for that space to the nearest shop. Then take the average radius of the circles and the average of the uncovered spaces and work from there. However, this method doesn't account for population densities, because obviously there are more people in certain areas, where you presumably have more stores anyway, so this method won't account for the great reduction this has in average distance.

Your best bet is going to be to do this based on actual data. Take people's postcodes and tell them where their nearest store is, then when they make the collection flag it as a successful collection, calculate the distance travelled and log it. Repeat over a few thousand transactions and then calculate the average.
 
A piece of GIS software would do this easily. Something like ARCGIS, unfortunately you would need to buy it (reasonably expensive) and know how to do that (which can range from easy to OMGWTF difficult depending on whether there is an easy guide or you know how to use it).
 
Back
Top Bottom