From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Bruno Wolff III <bruno(at)wolff(dot)to> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Making small bits of code available |
Date: | 2002-09-07 14:05:14 |
Message-ID: | 200209071405.g87E5E117838@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-hackers |
What would be really valuable would be to add your routines to
/contrib/earthdistance. Is that possible?
---------------------------------------------------------------------------
Bruno Wolff III wrote:
> On Fri, Sep 06, 2002 at 09:58:00 -0400,
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:
> >
> > /contrib/earthdistance already exists. Is this new functionality?
>
> This works with cube instead of point. If you use point hold latitude and
> longitude you have to worry about whether you will have data near 180
> degrees of longitude or near the poles. This may not be a problem if
> your data is mostly on one continent.
>
> The script I have is most grant calls for the cube functions. Since cube
> needs to be installed as postgres (or other super user), most likely
> you want to grant execute to public on the provided functions. (I don't
> know if you need to do this for ones just used be the gist stuff.)
>
> The stuff people might want to see are a few sql functions for getting
> to and from latitude and longitude and cube (as domain earth) and some
> functions related to getting the size of boxes to use for searching for
> points within a great circle distance of a specified point.
>
> If 5K isn't too much I could post it to the list and it will get archived
> and people that are interested can find it with google and can take what they
> want from the code.
>
> This stuff isn't packaged up neatly for a contrib with a regression test
> and all. Probably people who use this will want to tinker with it before
> using it themselves.
>
> The function prototypes extracted from the file are:
> create function earth() returns float8 language 'sql' immutable as
> create function sec_to_gc(float8) returns float8 language 'sql'
> create function gc_to_sec(float8) returns float8 language 'sql'
> create function ll_to_earth(float8, float8) returns earth language 'sql'
> create function latitude(earth) returns float8 language 'sql'
> create function longitude(earth) returns float8 language 'sql'
> create function earth_distance(earth, earth) returns float8 language 'sql'
> create function earth_box(earth, float8) returns cube language 'sql'
>
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
From | Date | Subject | |
---|---|---|---|
Next Message | Joel Rodrigues | 2002-09-07 14:06:15 | Unable to locate type name '? in catalog ERROR |
Previous Message | Jean-Christian Imbeault | 2002-09-07 13:36:47 | SQL: how to find if a table exists? |
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2002-09-07 14:07:19 | Re: [JDBC] problem with new autocommit config parameter and |
Previous Message | snpe | 2002-09-07 12:59:31 | Re: [JDBC] problem with new autocommit config parameter and jdbc |