Re: Zip Code Proximity

From: Andy Lewis <alewis(at)recruitersonline(dot)com>
To: Jeff Hoffmann <jeff(at)propertykey(dot)com>
Cc: pgsql-general(at)HUB(dot)ORG
Subject: Re: Zip Code Proximity
Date: 2000-05-18 18:02:41
Message-ID: Pine.LNX.4.20.0005181258230.6117-100000@mail.recruitersonline.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 18 May 2000, Jeff Hoffmann wrote:

> Andy Lewis wrote:
> >
> > Actually I was thinking more on the lines of:
> >
> > select location from test where location @ '((31.6283,93.6347), 1.39)'::circle;
> >
>
> that works just great, assuming that you can accurately calculate the
> radius of the circle that you're searching for.
>

I'll already have the mileage from an html form and the initial
zip. Should work just fine. It doesn't have to be exact just close.

> > If Zylks, LA (lat/lon = 32.9696,93.9801) is also in the DB.
> > The above query should select Zylks since 1.39 * 62.1 = 86 miles approx.
> > 86 miles is about correct for those two zip codes.
> >
> > Wouldn't this be much easier?
>
> to me, the big question is how you're calculating the radius & if you're
> taking into account the curvature of the earth so that 62.1 changes in
> different parts of the country. if you've taken that into
> consideration, great. it's probably going to be ok to flatten the earth
> for an area that size, though.
>

I don't plan on using anymore than a 100 miles, so that should work ok,
I'd think.

> > Is the data type POINT index-able?
> >
>
> unfortunately, not in a really useful way for you. plus, the optimizer
> probably wouldn't use the index any. it's a small data set, something
> around 35k-40k records, right?
>

I'm not sure how many records are in the zip code DB that I currently
have, shouldn't be much more than that though.

Andy

In response to

Browse pgsql-general by date

  From Date Subject
Next Message The Hermit Hacker 2000-05-18 18:08:56 Re: The New Slashdot Setup (includes MySql server)
Previous Message Benjamin Adida 2000-05-18 17:42:13 Re: The New Slashdot Setup (includes MySql server)