add function: spos and spbox, for create gist index.#6
add function: spos and spbox, for create gist index.#6hebl wants to merge 3 commits intoakorotkov:masterfrom
Conversation
|
Thank you for your request! Creating PgSphere objects from coordinates in degrees is certainly an important use case, especially for the virtual observatory community (to which I belong myself). However, I would prefer a more uniform naming, such as
The overhead of using plpgsql makes me at bit uneasy. Maybe an implementation in 'language sql' could be sufficiently efficient, but an implementation in C would have the additional benefit of sharing the same style with the rest of the PgSphere code base. |
|
@mnullmei +1 for implementation in C |
|
I have added functions: spoint_deg, sploy_deg, implementation in C. |
|
Hi again, The diff is large. I guess it has to do with your indentation settings. Could you fix that? |
|
@funbringer, New file: astro.h, astro.c, pgs_astro.sql.in and astro.md. |
|
I'm sorry, but I don't get it. What are you trying to say? You've changed 8 files, including polygon.c & polygon.h. Most of the changes are completely unnecessary due to incorrect indentation settings. |
|
@hebl Thank you for providing a C implementation. But due to public holidays over here, I will find time to look into it only by the end of next week. |
|
@mnullmei, @hebl, looks like this PR has stalled. Perhaps we should clean it up a little bit and merge it. Thoughts? |
Agreed, that would be actually my plan as well. One thing I still would like to add is a |
Add 2 functions:
spos(ra,dec): create a spoint from (ra,dec) in degree.spbox(ra_tl,dec_tl,ra_bl,dec_bl,ra_br,dec_br,ra_tr,dec_tr)in degree.Example:
CREATE INDEX some_tbl_idx_spos ON some.tbl USING GIST(spos(RA,Dec));CREATE INDEX some_tbl_idx_spbox ON some.tbl USING GIST(spbox(ra_tl,dec_tl,ra_bl,dec_bl,ra_br,dec_br,ra_tr,dec_tr));