Re: Finding nearby zip codes (or maybe area codes) programatically



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
.



Relevant Pages

  • Re: Advanced post code matching
    ... associated with UK Postal Codes. ... given their latitude and longitude coordinates. ... that the dot product of two unit vectors gives the cosine of the angle ... cosine of a sum trig identity is applied. ...
    (comp.databases.ms-access)
  • Re: Latitude, Longitude, and Radius
    ... > I've got a database with Zip codes. ... This also includes the latitude ... > and longitude values stored as singles (lat 42.17444, ... it will also display all other zip codes within a 25 mile ...
    (microsoft.public.vb.general.discussion)
  • Re: Geographic Proximity by Zip Code?
    ... ZIP+4 codes to Census Bureau data, ... Convert miles into latitude and longitude differentials. ... $lon1 -- longitude of point 1 in radians ...
    (alt.php)
  • Re: Latitude, Longitude, and Radius
    ... > I've got a database with Zip codes. ... This also includes the latitude and ... > all other zip codes within a 25 mile radius. ...
    (microsoft.public.vb.general.discussion)
  • Re: Chuck Norris: Complete Moron
    ... his life for America of all time I'm sure Ike beats him out, ... I never besmerched John McCain. ... Maybe I'm just weak, and he's strong, but I wouldn't trust ME to ... him to have the launch codes. ...
    (rec.gambling.poker)