Re: Making small bits of code available
От | Bruce Momjian |
---|---|
Тема | Re: Making small bits of code available |
Дата | |
Msg-id | 200209071405.g87E5E117838@candle.pha.pa.us обсуждение исходный текст |
Ответ на | Re: Making small bits of code available (Bruno Wolff III <bruno@wolff.to>) |
Ответы |
Re: Making small bits of code available
|
Список | pgsql-general |
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@candle.pha.pa.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@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073
В списке pgsql-general по дате отправления: