-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Spatial: Translate aggregate functions #13278
Comments
As this is being proposed for 6.0, would we build more generic support for arbitrary aggregate functions? There's #11850 but that seems to be about DbFunctions - do we need a separate issue to track provider aggregate functions? /cc @smitpatel |
This is being proposed for 6.0? 😕 |
Yeah, #22951... |
(a separate issue for tracking arbitrary non-DbFunction aggregate functions support may be a good idea regardless of 6.0, unless we just want to use #11850 to track that too) |
They are already supported. 🤷 |
Oh, nice! |
Specifically for plugins (NTS), note that we don't have an extension point for QueryableMethodTranslatingExpressionVisitor, which is needed if we want to support top-level invocations of aggregate functions (similar to Max/Sum/Average). |
@roji I added a table to the description in case you're feeling ambitious 😉 |
Ahahahaha I'm definitely in a very aggregate mood |
Submitted PR #28115 Some notes:
|
/cc @airbreather (In case you have any additional thoughts) |
Since these aggregate functions don't look like they're standardized in 06-104r4 like most other things tend to be*, not to mention how many decades these different tools have each been doing their own thing, I think some amount of unfaithfulness is to be expected when trying to translate between these same NTS calls and all of these different providers. *If there's another standard I don't know about that everybody else but NTS is following, I'm sure we can add something to our core library to help facilitate things like this. As long as the
Agreed: given that not all providers (no providers?) natively have the concept of "Envelope" as a distinct entity, this seems fairly wacky to implement and not-very-discoverable from the perspective of a user. If there's a real user appetite for this, I wouldn't mind adding something like an
Short version is, it's the (unique) smallest convex polygon that covers all of the input geometries. There are other ways to get smaller polygons (this one's my favorite), but those won't be convex (short version of "convex" is that you can pick any two points in the polygon, and the line segment between them is fully covered by the polygon). Another way to describe it is that it's the polygon that you would see if you stretched a rubber band around all the inputs and then let it "snap" around them all.
Correct. Or, at least, that was the intent of NetTopologySuite/NetTopologySuite@d826972, anyway :-) |
That would definitely help us out - we'd be able to translate that directly to its SQL equivalent (and I can imagnie it may even be useful in general to NTS users!).
Thanks for the explanation, am not at all a spatial guy :) And yeah, ConvexHull.Create fits our needs perfectly. |
Issue for addingEnvelopeCombiner.CombineAsGeometry to NTS: NetTopologySuite/NetTopologySuite#610 |
There are a handful of aggregate functions for spatial data. (Collect, Extent, Union, etc.)
It would be nice if we had a way to represent them in LINQ.
EnvelopeCombiner.Combine(geoms)The text was updated successfully, but these errors were encountered: