This topic describes the ST_BuildArea function. This function creates an areal geometry object formed by the constituent lines of the input geometry object.
Syntax
geometry ST_BuildArea(geometry a);
Parameters
Parameter | Description |
---|---|
a | The geometry object that you want to specify. |
Description
- This function supports LineString objects, MultiLineString objects, polygon objects, MultiPolygon objects, and GeometryCollection objects.
- This function assumes all inner geometry objects represent holes.
- This function returns a polygon object or MultiPolygon object. If the constituent lines of the input geometry object cannot form a polygon object, the ST_BuildArea function returns null.
Examples
Results returned by using the default parameter settings:
SELECT ST_AsText(ST_BuildArea('MultiLineString((0 0,0 1),(0 1,1 1),(1 1,0 0))'::geometry));
st_astext
----------------------------
POLYGON((0 0,0 1,1 1,0 0))
(1 row)