geography::ConvexHullAggregate
spatial aggregate ConvexHullAggregate
What changes
- Input
- spatial values of each group
- Output or change
- one geometry/geography per group
- Return type
- SQL Server return type: geography
Syntax at a glance
ConvexHullAggregate ( geography_operand )
Work example
Use geography.ConvexHullAggregate to compute one convex hull around a group of shapes.
Choose the report group and compare the hull with source outlines. Keep the geography type and SRID in the review.
Check your work The aggregate returns the convex hull around all three non-collinear points.
Practice SQL
Open in SQL FlowOpen the SQL for a walkthrough. Run the example in SQL Server to check its result.
SELECT geography::ConvexHullAggregate(v.shape).STGeometryType() AS hull_type, geography::ConvexHullAggregate(v.shape).STArea() AS hull_area_m2 FROM (VALUES (geography::Point(47.653, -122.360, 4326)), (geography::Point(47.649, -122.348, 4326)), (geography::Point(47.658, -122.348, 4326))) AS v(shape);
Open Microsoft Learn for full syntax, permissions, and details for your version.