Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

hebl
Copy link

@hebl hebl commented Dec 18, 2017

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
Copy link

ghost commented Dec 18, 2017

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
Collaborator

@mnullmei +1 for implementation in C

@hebl
Copy link
Author

hebl commented Dec 21, 2017

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

@funbringer
Copy link
Collaborator

Hi again,

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

@hebl
Copy link
Author

hebl commented Dec 21, 2017

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

@funbringer
Copy link
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
Copy link

ghost commented Dec 21, 2017

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

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

@ghost
Copy link

ghost commented Jan 12, 2018

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