ST_MAKEPOLYGON
functionsupportedCore SQL functionsConstructs a GEOGRAPHY or GEOMETRY object that represents a Polygon without holes. The function uses the specified LineString as the outer loop. This function corrects the orientation of the loop to prevent the creation of Polygons that span more than half of the globe. In contrast, ST_MAKEPOLYGONORIENTED doesn’t attempt to correct the orientation of the loop.
Syntax
ST_MAKEPOLYGON( <geography_or_geometry_expression> )
Parameters
| Name | Required | Description |
|---|---|---|
geography_or_geometry_expression | required | A GEOGRAPHY or GEOMETRY object that represents a LineString in which the last point is the same as the first (i.e. a loop). |
Returns
The function returns a value of type GEOGRAPHY or GEOMETRY.
Usage notes
- The lines of the Polygon must form a loop. In other words, the last Point in the sequence of Points defining the LineString must be the same Point as the first Point in the sequence.
- ST_POLYGON is an alias for ST_MAKEPOLYGON.
- For GEOMETRY objects, the returned GEOMETRY object has the same SRID as the input.