Perl Monk, Perl Meditation | |
PerlMonks |
(boo)Re: Algorythym for searching closest neighborby boo_radley (Parson) |
on Apr 03, 2001 at 18:26 UTC ( [id://69315]=note: print w/replies, xml ) | Need Help?? |
As usual, investigating something relatively mundane yields some fascinating information. Any zip code database you come across in the next few months/years will probably be out of date -- zip codes are offically "mapped" by the census, and the Census Bureau hasn't completed last year's -- and it seems like the results of the survey are accurate to a county level. The post office, naturally has their own interface which you can automate through LWP trickery. They indicate that the longest their data will rot is 2 months If this is for big commercial use type work, maybe you wanna buy the TIGER/ZIP+4 database the USPS offer -- it cross-references ZIP code to geographic data. The odd thing is that every database ( including the unfortunately named MAGGOT) warns that any data you get from any source is probably inaccurate to a (varying) degree. Anyway, with the wide variety of possible ways to manipulate a ZIP code, here's one way to fulfill your original request : Although, after reading up on the subject, you may want to change this to a2a3 or a2aaa to reflect the state/county encoding in the ZIP.
In Section
Seekers of Perl Wisdom
|
|