Skip to main content

ST_MAKEPOLYGON

Introduced or updated: v1.2.413

Constructs a GEOMETRY object that represents a Polygon without holes. The function uses the specified LineString as the outer loop.

Syntax

ST_MAKEPOLYGON(<geometry>)

Aliases

Arguments

ArgumentsDescription
<geometry>The argument must be an expression of type GEOMETRY.

Return Type

Geometry.

Examples

SELECT
ST_MAKEPOLYGON(
ST_GEOMETRYFROMWKT(
'LINESTRING(0.0 0.0, 1.0 0.0, 1.0 2.0, 0.0 2.0, 0.0 0.0)'
)
) AS pipeline_polygon;

┌────────────────────────────────┐
│ pipeline_polygon │
├────────────────────────────────┤
POLYGON((0 0,1 0,1 2,0 2,0 0))
└────────────────────────────────┘
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today