X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id DD9D8D1B439 for ; Fri, 26 Dec 2003 23:42:46 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 59277-02 for ; Fri, 26 Dec 2003 19:41:59 -0400 (AST) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by svr1.postgresql.org (Postfix) with ESMTP id 6C5AED1B432 for ; Fri, 26 Dec 2003 19:41:56 -0400 (AST) Received: from andy2 (c-24-1-39-92.client.comcast.net[24.1.39.92]) by comcast.net (rwcrmhc12) with SMTP id <20031226234157014000q3ove>; Fri, 26 Dec 2003 23:41:57 +0000 From: "Andy Lewis" To: Subject: Radius of a zip code Date: Fri, 26 Dec 2003 17:42:08 -0600 Message-ID: <000b01c3cc09$e043fd70$0201a8c0@andy2> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000C_01C3CBD7.95A98D70" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=HTML_50_60 X-Spam-Level: X-Archive-Number: 200312/190 X-Sequence-Number: 16356 This is a multi-part message in MIME format. ------=_NextPart_000_000C_01C3CBD7.95A98D70 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello all, I was trying to find all zip codes within a given zip code or radius. I have map points and Latitude and Longitude in my zip table. I remember seeing a post or two referencing this but can't see to find it. I've tried the following with no luck: -- 20 Miles --select 20 * 360.0 / (7900.0 * atan2(1,1) * 4.0); select * from zip_code where map_loc @ circle(map_point('dallas','tx','75201'), .290105212724467 ) order by city Anyone that has this experience, can you validate this for correctness? Thanks in advance, Andy ------=_NextPart_000_000C_01C3CBD7.95A98D70 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Message
Hello=20 all,
 
I was try= ing to find=20 all zip codes within a given zip code or radius.
 
I have ma= p points=20 and Latitude and Longitude in my zip table.
 
I remembe= r=20 seeing a post or two referencing this but can't see to find=20 it.
 
I've trie= d the=20 following with no luck:
 
-- 20=20 Miles
--select = 20 * 360.0=20 / (7900.0 * atan2(1,1) * 4.0);
select * from zip_code where map_loc @=20 circle(map_point('dallas','tx','75201'), .290105212724467 ) order by=20 city
 
Anyone th= at has this=20 experience, can you validate this for correctness?
 
Thanks in= =20 advance,
 
Andy
------=_NextPart_000_000C_01C3CBD7.95A98D70--