Write a search with "surrounding town" facility?

Discussion in 'PHP' started by Danny, Mar 16, 2007.

  1. #1
    I was wondering if anyone could help me with some pointers on how to write a search with "surrounding town/suburb" search.

    I have a database list of all towns and their postal codes (for australia) and was wondering if there is someway to leverage this?


    Kind regards
    Dan
     
    Danny, Mar 16, 2007 IP
  2. php_daemon

    php_daemon Active Member

    Messages:
    34
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    95
    #2
    Create a table to store the ids of surrounding towns for every town. The rest is straightforward from there.
     
    php_daemon, Mar 16, 2007 IP
  3. Danny

    Danny Active Member

    Messages:
    732
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    78
    #3
    it isnt that simple, with 6 states in a land mass the same size as the US you are talking literally hundreds of thousands of towns.

    But I did find a little gem called the BSPnumber and BSPName which gives the locality, or basic region, more so the council for that area which may encompass about 15 towns. I plan on using this, otherwise the other way I could go if there is a logical arrangement (there isnt for all) I can do a query that takes the postal code for that suburb and then subtracts say 3 and adds 3 to its number and that will give me the suburb plus 6 surrounding suburbs.

    Does that make sense?
     
    Danny, Mar 16, 2007 IP
  4. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Danny: I don't know what your database looks like, but I wonder if it's possible to get the same data with latitude / longitude coordinates? Even if you could somehow map data from one source to another, you could then just use those values for comparison.
     
    TwistMyArm, Mar 16, 2007 IP