Given a GEOGRAPHY column, returns a GEOGRAPHY object that represents the combined set of points that are in at least one of the shapes represented by the objects in the column (that is, the union of the shapes).
ST_UNION_AGG( <geography_column> )
Copy
Arguments¶geography_column
A GEOGRAPHY column.
The function returns a value of type GEOGRAPHY.
Examples¶Create a table with a GEOMETRY column and insert data:
CREATE OR REPLACE TABLE st_union_agg_demo_table (g GEOGRAPHY); INSERT INTO st_union_agg_demo_table VALUES ('POINT(1 1)'), ('POINT(0 1)'), ('LINESTRING(0 0, 0 1)'), ('LINESTRING(0 0, 0 2)'), ('POLYGON((10 10, 11 11, 11 10, 10 10))'), ('POLYGON((10 10, 11 11, 11 10, 10 10))');
Copy
Use the ST_UNION_AGG function to return a GEOGRAPHY object that represents the combined set of points that are in at least one of the shapes represented by the objects in the GEOGRAPHY column:
ALTER SESSION SET GEOGRAPHY_OUTPUT_FORMAT = 'WKT'; SELECT ST_UNION_AGG(g) AS union_of_shapes FROM st_union_agg_demo_table;
Copy
+-------------------------------------------------------------------------------------------+ | UNION_OF_SHAPES | |-------------------------------------------------------------------------------------------| | GEOMETRYCOLLECTION(POINT(1 1),LINESTRING(0 0,0 1,0 2),POLYGON((11 10,11 11,10 10,11 10))) | +-------------------------------------------------------------------------------------------+
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4