"Postcode" distances

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

"Postcode" distances

Post 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:
User avatar
senthilnayagam
Forum Newbie
Posts: 17
Joined: Wed Jun 08, 2005 5:36 am
Location: Bangalore

Post 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
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

Thanks for the tip. Will look into it.
Post Reply