A zip code database provides a means to calculate the distance between a person and an event to within a few miles, and return the results by distance from. Nowhere on the net exists an effective sorting of gamer events by this measure - EN World will have the first and I guarantee once built it will be heavily used enough that you won't want to look through all the possible events.Morrus said:Why use zip or postal codes? Couldn't an equally eddective system be written just using the divisions we have in the Gamers seeking Gamers forum? After all, I don't imagine there will be all that many events.
Here's a free one for the UK: http://www.easypeasy.com/guides/article.php?article=64Michael Morris said:A zip code database must be installed for each country. That database must contain a latitude and longitude entry for each zipcode. The SQL query then uses a trig function to find all entries within X miles by joining the user or event table to the zip code table.
I need to get a prototype working with just one type of postal code first. After that I will expand to using a country code to determine which postal code table to search on. Canadian postal code tables do exist, indeed most countries publish databases like this. Finding free ones aren't easy and free ones aren't usually as accurate. I've seen pay ones run as high a $1000. For EN World I will be using such a db since it's the same one I install for clients at work.
Oh yeah, I meant to say that I was just posting it for future use, not that I was expecting you to do it nowMichael Morris said:Ok, I'll bookmark that and come back to it. I must first get it working for one before I do multiples.
Miles for the UK, too. Even though we are metric with virtually everything else, we all still think in miles when it comes to travel distances (all signs are in miles, and car speedometers are in MPH).BTW, depending on the formulae I use I can have the results returned in miles or kilometers. I suppose I should put a preference switch in there - defaulting to miles for the US and kilometers for everyone else.
Michael Morris said:BTW, depending on the formulae I use I can have the results returned in miles or kilometers. I suppose I should put a preference switch in there - defaulting to miles for the US and kilometers for everyone else.