Jump to content

[SOLVED] UK Postcode Distances


rarebit

Recommended Posts

Hi, i'm looking into doing a module for a CMS which needs to check distances based upon postcodes (in the UK). I found this, which I implemented and sempt to get strange results, so I used this function (which is actually basically the same) and also checked some GPS data here. But I still get the same results, being:

Sheffiled (S1) -> London (SE1) is 93.827627581918 miles

Sheffiled (S1) -> Leeds (LS1) is 5.4432310738348 miles

but:

Sheffiled (S8) -> Leeds (LS1) is 4.8989079690129 miles

and S8 is on the other side of the city (further away)... *** This could be an indicator to the issue!

 

r

 

 

P.S. I'm not wanting to use the Google Maps API!

Link to comment
https://forums.phpfreaks.com/topic/106944-solved-uk-postcode-distances/
Share on other sites

Cheers Barand, after realising my 'latitudes' were all defaulted it works like a treat, just how I was going to amend it too, the other version even works now.

 

That one you referenced jonsjava doesn't give the required php (prolly can use ref's above) and also has a great big copyright on it...

 

Solution found which will make for a great bank holiday weekend, cheers for the help guy's!

 

 

Rob

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.