Benjamin Pflugmann wrote:
>
> Hi.
>
> On Wed, Nov 14, 2001 at 10:02:54AM -0500, [EMAIL PROTECTED] wrote:
> > Currently, I am using the following query:
> >
> > SELECT DISTINCT o.szZipCode FROM tblZips z,tblZips o WHERE
> > z.szZipCode=$szZip AND (3956 * (2 *
> > ASIN(SQRT(POWER(SIN(((z.dblLat-o.
Hi.
On Wed, Nov 14, 2001 at 10:02:54AM -0500, [EMAIL PROTECTED] wrote:
> Currently, I am using the following query:
>
> SELECT DISTINCT o.szZipCode FROM tblZips z,tblZips o WHERE
> z.szZipCode=$szZip AND (3956 * (2 *
> ASIN(SQRT(POWER(SIN(((z.dblLat-o.dblLat)*0.017453293)/2),2) +
> COS(z.dblLat*
Adam Nelson writes:
> [...] POWER(SIN(((z.dblLon-o.dblLon)*0.017453293)/2),2) < $iRadius
>
> This runs rather slowly over the 76 thousand zip codes in the US.
>
> 2) Compute the max/min latitude/longitude and then query on that range
> (proximity becomes a square, but that's not a big deal
Currently, I am using the following query:
SELECT DISTINCT o.szZipCode FROM tblZips z,tblZips o WHERE
z.szZipCode=$szZip AND (3956 * (2 *
ASIN(SQRT(POWER(SIN(((z.dblLat-o.dblLat)*0.017453293)/2),2) +
COS(z.dblLat*0.017453293) * COS(o.dblLat*0.017453293) *
POWER(SIN(((z.dblLon-o.dblLon)*0.01745329