Page 1 of 1

"Postcode" distances

Posted: Thu Jun 23, 2005 6:35 am
by CoderGoblin
Not sure where to post this so I thought I'd ask for ideas here..

We have a potential requirement to have a database (postgres) full of postcodes (including Latitude/Longditude etc) so distances between 2 postcodes can be calculated using basig trig. Every user of the site would have their "position" stored.

The question is how to store data efficiently to enable a user to see all "postcodes" within a certain radius yet allow scalability as to the number of users ? The "radius" would be modifiable by the user and needs to be calculated on a real time basis.

If anyone has any ideas I would appreciate it, although I will be investigating myself... Now where is Google :wink:

Posted: Thu Jun 23, 2005 2:15 pm
by senthilnayagam
If you can afford go for any geotargetting database, to build a comprehensive and accurate database is too cumbersome, for my company we are using geotargetting extensively for advertisements and fraud detection

you can test info sbout yourself with

http://www.geobytes.com/IpLocator.htm

Country Code
Country
Distance to Nearby Cities
Region Code
Region
City Code
City
CityId
Certainty
Latitude
Longitude
Capital City
TimeZone
Nationality Singular
Population
Nationality Plural
Is proxy
Currency

there are many service providers though , do a search with geotargetting or ip2country on you search engine you will get many offers

if you cannot buy or want to build one you can check some classes at
http://www.phpclasses.org/browse/class/39.html
the category is geography

Posted: Mon Jun 27, 2005 4:03 am
by CoderGoblin
Thanks for the tip. Will look into it.