pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andy Lewis <jumboc@comcast.net>
To: pgsql-sql@postgresql.org
Subject: Radius of a zip code
Date: Fri, 26 Dec 2003 17:42:08 -0600
Message-ID: <000b01c3cc09$e043fd70$0201a8c0@andy2> (raw)

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

view thread (10+ messages)  latest in thread

Message-ID: <000b01c3cc09$e043fd70$0201a8c0@andy2>
Permalink:  ../000b01c3cc09$e043fd70$0201a8c0@andy2/
Also on:    postgresql.org/message-id/000b01c3cc09$e043fd70$0201a8c0@andy2

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: jumboc@comcast.net
  Subject: Re: Radius of a zip code
  In-Reply-To: <000b01c3cc09$e043fd70$0201a8c0@andy2>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox