-
Notifications
You must be signed in to change notification settings - Fork 15
Missing equality operator for type spoint? #101
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
Comments
|
Besides hash indexes on spoint, this enables "select distinct spoint from tbl" queries. Close postgrespro#101.
Would it similarly make sense to add hash opclasses for the other pgsphere types (strans, scircle, spoly)? Probably not as useful as spoint, but for the sake of completeness? |
It's (sort of) easy for the types that have canonical representations. scircle is doable, but spoly would need sorting the nodes, and I hear there's open issues with left- and right-handed spolys. That said, there's a possible minor problem even with spoints: the dreaded "signed zeros" might cause "equal" spoints to have representations differing in the sign. But that only applies to spoints where one coordinate is exactly zero, no idea how likely that is in practise. We might also force all zeros to be Which types would you be interested in? |
On Fri, Nov 03, 2023 at 12:25:40PM -0700, Christoph Berg wrote:
representations differing in the sign. But that only applies to
spoints where one coordinate is exactly zero, no idea how likely
that is in practise. We might also force all zeros to be `+0`
Regrettably, exactly zero happens a lot more often than one would
expect – not because nature had some unnatural preference, but
because points on coordinate axes are perennial favourites for tests,
artificial data, and the lot. And that's not *exclusively* lazyness,
since often it's a lot easier to figure out results manually when you
are on an axis.
So, if there's odd behaviour on the axes, that's probably harmless
for physics but potentially hazardous for development.
|
@df7cb asked:
Hard to say. I could see using an scircle hash opclass. I wonder if the error in issue #93 would be helped if there was a hash opclass for strans? Also, I'm ok with forcing all zeroes to be +0 in the spoint hash function if that "solves" any problems you foresee. |
Besides hash indexes on spoint, this enables "select distinct spoint from tbl" queries. Close postgrespro#101.
# select distinct spoint_deg(lon, lat) from sometable; ERROR: could not identify an equality operator for type spoint
I think this is a reasonable thing to do?
Should equality operators for the pgsphere types be added?
The text was updated successfully, but these errors were encountered: