Jump to content

Sorting Users for Proximity via Postcode


Guest

Recommended Posts

Hi guys,

 

            never posted here before so not sure what part of the forum to put this question in. Basically I'm developing a community site which involves customers sorting through other users who are near them based on distance in miles, Now I have implemented this database and script -

 

http://www.sloomedia.com/php_postcode_script.php

 

But what I want to know is the theory behind converting this approach, which takes 2 postcodes and finds a distance (ive already converted from KM to miles as i'm making a UK site) to something that'll sort through all users and find users who are close to you, just like autotrader.co.uk does. Thing is , I can't fathom the theory behind it - surely i'd have to query every entry in the postcode database (2823 entries), checking distance between the postcode of the user and every other.. of course this is a ludicrous approach (right?!) as it'd be appallingly server intensive. So whats the solution, and how does autotrader do it do you think?

 

Any help with this conundrum much appreciated!

 

 

              Cheers!

 

                        Will G

 

http://www.willgoldstone.com

Hey thanks for your reply, but as you'll see from my original message ,  I already have distance calculation working fine - i'm looking to convert this to an approach that'll find people by their postcode when a user specifies their own, like autotrader.co.uk, or ebay i guess.. please re-read! cheers

 

Will

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.