Skip to content

Add Geography support for ST_ConvexHull and the geometry-collecting aggregate #3176

Description

@jiayuasu

What's missing

Neither ST_ConvexHull nor the aggregate that feeds it (ST_Collect / ST_Collect_Agg /
ST_Union_Agg) accepts geography, so a grouped hull cannot be computed on the sphere.

-- wanted
SELECT ST_Area(ST_ConvexHull(ST_Collect(ARRAY_AGG(geog)))) FROM ... GROUP BY ...;  -- m^2

Why

Together these block the geography form of SpatialBench Q5, which takes the convex hull of
each customer's monthly dropoff locations and reports its area. Under geography the hull is
built from geodesic edges and the area is in m², so the number means something; the planar
version reports square degrees.

Reference

SedonaDB implements ST_ConvexHull(geography) -> geography, and its ST_Collect_Agg accepts
geography as well (undocumented there — apache/sedona-db#1087), so the combination works
end to end today and can serve as a reference.

Part of #2830.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions