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

ST_ConvexHullAgg #464

Closed
wants to merge 2 commits into from
Closed

Conversation

pramsey
Copy link
Member

@pramsey pramsey commented Aug 19, 2019

As described in https://trac.osgeo.org/postgis/ticket/3770,
Take in a set of geometry and return convex full of full set.

@pramsey
Copy link
Member Author

pramsey commented Aug 19, 2019

☝️ @robe2

@pramsey
Copy link
Member Author

pramsey commented Aug 19, 2019

OK, ran some tests against this, and the performance is terrible (10x worse than st_convexhull(st_collect()). So the assumptions in the trac ticket

  • this might have less memory pressure, yes
  • this might be faster, no

/* Single point is always convex */
case POINTTYPE:
return LW_TRUE;

Copy link
Member

Choose a reason for hiding this comment

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

is TRIANGLE convex in context of this function?

LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL;

-- Availability: 3.0.0
CREATE AGGREGATE ST_ConvexHullAgg (geometry) (
Copy link
Member

Choose a reason for hiding this comment

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

Can the
final func be "ST_ConvexHull(geometry[])",
stype = internal (LWGEOM* geometrycollection),
sfunc = try{ append(LWGEOM) } except Out of Memory { ST_ConvexHull(LWGEOM), append(LWGEOM) },
serialfunc -> geometry_serialize(ST_ConvexHull(LWGEOM)),
deserialfunc -> gserialized parse?

This should make it catch up with ST_ConvexHull(ST_Collect()) speed.

@robe2
Copy link
Member

robe2 commented Oct 15, 2019

Should we give up on this as hopeless? Only real reason for having it is if it could be faster than ST_ConvexHull(ST_Collect(..)). If it can't then the extra keystrokes is not worth the addition of a new agg.

@robe2
Copy link
Member

robe2 commented Oct 23, 2019

I'm closing this one out as I think we decided it's hopeless

@robe2 robe2 closed this Oct 23, 2019
@pramsey pramsey deleted the svn-trunk-convexagg branch May 7, 2020 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants