Skip to content

add function: spos and spbox, for create gist index. - #6

Open
hebl wants to merge 3 commits into
akorotkov:masterfrom
hebl:idxfunc
Open

add function: spos and spbox, for create gist index.#6
hebl wants to merge 3 commits into
akorotkov:masterfrom
hebl:idxfunc

Conversation

@hebl

@hebl hebl commented Dec 18, 2017

Copy link
Copy Markdown

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));

@ghost ghost added the enhancement label Dec 18, 2017
@ghost ghost self-assigned this Dec 18, 2017
@ghost

ghost commented Dec 18, 2017

Copy link
Copy Markdown

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.
Thoughts?

@funbringer

Copy link
Copy Markdown
Collaborator

@mnullmei +1 for implementation in C

@hebl

hebl commented Dec 21, 2017

Copy link
Copy Markdown
Author

I have added functions: spoint_deg, sploy_deg, implementation in C.

@funbringer

Copy link
Copy Markdown
Collaborator

Hi again,

The diff is large. I guess it has to do with your indentation settings. Could you fix that?

@hebl

hebl commented Dec 21, 2017

Copy link
Copy Markdown
Author

@funbringer, New file: astro.h, astro.c, pgs_astro.sql.in and astro.md.

@funbringer

Copy link
Copy Markdown
Collaborator

@hebl,

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.

@ghost

ghost commented Dec 21, 2017

Copy link
Copy Markdown

@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.

@funbringer

Copy link
Copy Markdown
Collaborator

@mnullmei, @hebl, looks like this PR has stalled. Perhaps we should clean it up a little bit and merge it. Thoughts?

@ghost

ghost commented Jan 12, 2018

Copy link
Copy Markdown

Perhaps we should clean it up a little bit and merge it.

Agreed, that would be actually my plan as well.

One thing I still would like to add is a VARIADIC overload of spoly_deg(), as hinted above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants