Builds an areal geometry from the constituent lines of the input geometry.
Syntax
geometry ST_BuildArea(geometry a);Parameters
| Parameter | Description |
|---|---|
| a | The input geometry whose constituent lines are used to build the area. |
Description
Accepts LineString, MultiLineString, Polygon, MultiPolygon, and GeometryCollection geometries.
Treats all inner geometry objects as holes.
Returns a Polygon or MultiPolygon. Returns null if the constituent lines of the input geometry cannot form a polygon.
Examples
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)该文章对您有帮助吗?