ST_Aggr_ConvexHull

NoteNote:

ST_Geometry for Oracle only

Definition

ST_Aggr_ConvexHull creates a single geometry that is a convex hull of a geometry that resulted from a union of all input geometries. In effect, ST_Aggr_ConvexHull is equivalent to ST_ConvexHull(ST_Aggr_Union(geometries)).

Syntax

sde.st_aggr_convexhull (g1 sde.st_geometry)

Return type

ST_Geometry

Example

The example creates a service_territories table and executes a SELECT statement that aggregates all the geometries, thereby generating an ST_Geometry representing the convex hull of the union of all the shapes.

CREATE TABLE service_territories 
 (ID integer, UNITS, number, SHAPE sde.st_geometry);

INSERT INTO service_territories (id, shape) VALUES (
1, 
1250, 
sde.st_polygon ('polygon ((20 30, 30 30, 30 40, 20 40, 20 30))', 0)
);
 
INSERT INTO service_territories (id, shape) VALUES (
2, 
875, 
sde.st_polygon ('polygon ((30 30, 30 50, 50 50, 50 30, 30 30))', 0)
);
 
INSERT INTO service_territories (id, shape) VALUES (
3, 
1700, 
sde.st_polygon ('polygon ((40 40, 40 60, 60 60, 60 40, 40 40))', 0)
);

SELECT sde.st_astext(sde.st_aggr_convexhull(shape)) CONVEX_HULL
FROM service_territories 
WHERE units >= 1000;

CONVEX_HULL

POLYGON  (( 20.00000000 40.00000000, 20.00000000 30.00000000, 30.00000000 30.00000000, 
60.00000000 40.00000000, 60.00000000 60.00000000, 40.00000000 60.00000000, 20.00000000 40.00000000))
6/19/2015