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.
What's missing
Neither
ST_ConvexHullnor 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.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 itsST_Collect_Aggacceptsgeography 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.