[Phpug] PHP & DB Design Questions
John Handelaar
john at userfrenzy.com
Tue Dec 18 20:58:14 GMT 2007
On Dec 18, 2007 7:57 PM, AJ McKee <aj.mckee at druid-dns.com> wrote:
> The second issue I have is in relation to Locations and addresses.
> Without going into too much detail, a person in france has an object and
> want to register it on my site. So they add the location, say something
> like, Rue Someplace, Place Du Here, Paris, 019222, France. Thats grand,
> but now I have a user in Ireland, whom adds an object with the address,
> 109 Some Street, Cork, Ireland.
>
> Selecting the country is easy enough to do. However what happens if I
> want to search of objects close to a location, ie, show me all objects
> in Cork, then show me all objects in Place Du Here, in Paris
>
> What is the most effective way of desiging my DB for this type of
> stuff? Anyone got experience on this stuff. I presume the easist thing
> to so is start my search backwards, Street, District, City Region type.
> but I am wondering if that is effective?
>
> Anyone got advice.
Geocode 'em. Google and Yahoo can both parse either of your examples
now (Yahoo's better for Ireland). Store the X & Y pairs, calculate proximity
by doing sums. Or by using spatial DB extensions.
jhj
More information about the Phpug
mailing list