rarebit Posted May 23, 2008 Share Posted May 23, 2008 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 More sharing options...
jonsjava Posted May 23, 2008 Share Posted May 23, 2008 I have no idea, but I did find you This link. It may be the answer to your problem. Link to comment https://forums.phpfreaks.com/topic/106944-solved-uk-postcode-distances/#findComment-548146 Share on other sites More sharing options...
Barand Posted May 23, 2008 Share Posted May 23, 2008 if you have a database of UK postcodes with their lat and long coordinates you can calculate the distances. http://www.phpfreaks.com/forums/index.php/topic,166487.msg733106.html#msg733106 Link to comment https://forums.phpfreaks.com/topic/106944-solved-uk-postcode-distances/#findComment-548287 Share on other sites More sharing options...
rarebit Posted May 23, 2008 Author Share Posted May 23, 2008 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 Link to comment https://forums.phpfreaks.com/topic/106944-solved-uk-postcode-distances/#findComment-548322 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.