Re: Finding nearby zip codes (or maybe area codes) programatically
- From: houghi <houghi@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 22 Dec 2008 00:11:42 +0100
Bill H wrote:
If interested, found a site that has another listing of zips, may be
newer. It also has the canadian postal codes on there also if you need
them. www.populardata.com
Thanks. For Belgium I made the latitude and longitude myself with data
from http://www.post.be/site/nl/postal_codes.html
I would have a list with just all the postal codes and then I would use
a small bash script to get the latitude and longitude:
From memory:
#!/bin/bash
.. ~/.password #This is where I keep the GOOGLE_API_KEY
for POSTCODE in `cat postcode.txt`
do
GOOGLE=`lynx -dump -accept_all_cookies \
"http://maps.google.com/maps/geo?q=${POSTCODE}+Belgium&output=csv&key=${GOOGLE_API_KEY}"`
LON=`echo $GOOGLE|awk -F, '{print $3}'`
LAT=`echo $GOOGLE|awk -F, '{print $4}'`
echo "$POSTCODE;$LON;$LAT >> PC_LONLAT.csv
done
With the codes given here, it would be much easier for a person to enter
his or her adress, get the latitude and logitude from that and see what
the closest several stores are.
The above should not be too dificult to translate to php.
Again with the google API, you could even show them on a map, so that
way the person can still decide which is the easiest to reach.
And then with the click on a button, get the route description to any of
them. Then one more click and you could download the iternerary for your
Tomtom (http://houghi.org/tomtom/)
houghi
--
Let's not be too tough on our own ignorance. It's the thing that makes
America great. If America weren't incomparably ignorant, how could we
have tolerated the last eight years? -- Frank Zappa, in 1988
.
- References:
- Finding nearby zip codes (or maybe area codes) programatically
- From: Anthony Papillion
- Re: Finding nearby zip codes (or maybe area codes) programatically
- From: Charles Polisher
- Re: Finding nearby zip codes (or maybe area codes) programatically
- From: Bill H
- Re: Finding nearby zip codes (or maybe area codes) programatically
- From: houghi
- Re: Finding nearby zip codes (or maybe area codes) programatically
- From: Bill H
- Re: Finding nearby zip codes (or maybe area codes) programatically
- From: houghi
- Re: Finding nearby zip codes (or maybe area codes) programatically
- From: sheldonlg
- Re: Finding nearby zip codes (or maybe area codes) programatically
- From: Bill H
- Re: Finding nearby zip codes (or maybe area codes) programatically
- From: The Natural Philosopher
- Re: Finding nearby zip codes (or maybe area codes) programatically
- From: Bill H
- Finding nearby zip codes (or maybe area codes) programatically
- Prev by Date: Re: Finding nearby zip codes (or maybe area codes) programatically
- Next by Date: Re: regEx question
- Previous by thread: Re: Finding nearby zip codes (or maybe area codes) programatically
- Next by thread: Re: Finding nearby zip codes (or maybe area codes) programatically
- Index(es):
Relevant Pages
|