Skip to content

Add MOC vs. other geometries casts #6

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

Merged
merged 6 commits into from
May 24, 2023

Conversation

msdemlei
Copy link
Contributor

@msdemlei msdemlei commented Dec 9, 2021

This PR will enable search conditions such as scircle <@ moc. It is implemented as syntactic sugar, turning this, in effect, into smoc(max_order(moc), scircle) <@ moc.

While this has several drawbacks against a strict implementation of contains and overlap between spherical geometries and mocs – most notably, it will be a lot slower when comparing a constant geometry against moc-valued columns, because the conversion will be re-done in every row –, implementing these exact operations is at least hard.

For casual users, I argue, this will provide non-surprising behaviour.

This PR also bumps the version to 1.2.1. Piggyback on it rides a brief hacking guide I came up with while writing this.

in contains and intersects constraints.

I'm also adding a little file on how to hack pg_sphere; yes, that's
mainly repeating stuff from the pg docs, but I guess it'll help
a few folks; it would have helped me.
I hadn't done this before because the warnings spoiled the regression
expectation.  I'm now shutting those up for while I'm doing the dropping.
@msdemlei
Copy link
Contributor Author

Can I bump this? The CI failures, I think, are unrelated to the PR, as pgsphere probably doesn't work with 9.x anyway (or does it? And if so, is there a strong case to not drop 9.x support?).

I give you this isn't perfect and rather certainly won't be terribly fast, but then it will help for tables in the ~1e4 rows range, such as rr.stc_spatial in future RegTAP (the VO registry discovery protocol, https://github.com/ivoa-std/RegTAP).

@msdemlei
Copy link
Contributor Author

Since it'd be great to have these operators for RegTAP 1.2, https://ivoa.net/documents/RegTAP/20220519/, can I nag again about this? I realise we'll not win beauty contests with this, but I'd say it's reasonably harmless and cheap while giving a rather real benefit...

Copy link

@gmantele gmantele left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems all right to me.
It passes all CI for Postgres 10 and more.

@vitcpp vitcpp self-assigned this May 24, 2023
@vitcpp vitcpp merged commit 432b098 into postgrespro:master May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants