Re: [SQL] Radius of a zip code

2004-01-04 Thread Randolf Richardson
"[EMAIL PROTECTED] (Tom Lane)" wrote in comp.databases.postgresql.sql: [sNip] > I'm guessing that the big problem is that you didn't measure longitude > and latitude in identical units in your table, so your "circle" isn't > real circular, and the smaller problem is that "miles" converts to > "deg

Re: [SQL] Radius of a zip code

2003-12-27 Thread Tom Lane
Bruno Wolff III <[EMAIL PROTECTED]> writes: > Michael Fuhr <[EMAIL PROTECTED]> wrote: >> Maybe you've already figured it out, but LOAD should allow you to reload >> a .so file without having to restart the backend. > I didn't write that. It came from the person(s) who worked on earthdistance > b

Re: [SQL] Radius of a zip code

2003-12-27 Thread Andy Lewis
Thanks All for your suggestions, I have enough information to construct what I need. -Original Message- From: Michael Fuhr [mailto:[EMAIL PROTECTED] Sent: Friday, December 26, 2003 8:43 PM To: Andy Lewis Cc: [EMAIL PROTECTED] Subject: Re: [SQL] Radius of a zip code On Fri, Dec 26, 2003

Re: [SQL] Radius of a zip code

2003-12-27 Thread Bruno Wolff III
On Fri, Dec 26, 2003 at 22:19:52 -0700, Michael Fuhr <[EMAIL PROTECTED]> wrote: > > Incidentally, I see the following in README.earthdistance: > > A note on testing C extensions - it seems not enough to drop a function > and re-create it - if I change a function, I have to stop and restart

Re: [SQL] Radius of a zip code

2003-12-26 Thread Michael Fuhr
On Fri, Dec 26, 2003 at 10:34:04PM -0600, Bruno Wolff III wrote: > On Fri, Dec 26, 2003 at 19:42:44 -0700, > Michael Fuhr <[EMAIL PROTECTED]> wrote: > > > > I have several databases with lat/lon coordinates and frequently make > > "show me all records within a certain distance of this point" que

Re: [SQL] Radius of a zip code

2003-12-26 Thread Bruno Wolff III
On Fri, Dec 26, 2003 at 19:42:44 -0700, Michael Fuhr <[EMAIL PROTECTED]> wrote: > > I have several databases with lat/lon coordinates and frequently make > "show me all records within a certain distance of this point" queries. > I wrote a haversine() function that uses the Haversine Formula to >

Re: [SQL] Radius of a zip code

2003-12-26 Thread Joe Conway
Michael Fuhr wrote: I wrote a haversine() function that uses the Haversine Formula to calculate the great circle distance between two points on a sphere (assuming the earth is a perfect sphere is accurate enough for my uses). Here's a web site with related info: http://www.census.gov/cgi-bin/geo/gi

Re: [SQL] Radius of a zip code

2003-12-26 Thread Michael Fuhr
On Fri, Dec 26, 2003 at 05:42:08PM -0600, Andy Lewis wrote: > 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. The code in con

Re: [SQL] Radius of a zip code

2003-12-26 Thread Tom Lane
"Andy Lewis" <[EMAIL PROTECTED]> writes: > I was trying to find all zip codes within a given zip code or radius. I think there are canned solutions for this available in PostGIS --- have you looked at that? > I've tried the following with no luck: > -- 20 Miles > --select 20 * 360.0 / (7900.0 *

[SQL] Radius of a zip code

2003-12-26 Thread Andy Lewis
Title: Message 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 M