ST_MAKEPOLYGONORIENTED
functionsupportedCore SQL functionsConstructs a GEOGRAPHY object that represents a Polygon without holes. The function uses the specified LineString as the outer loop. This function does not attempt to correct the orientation of the loop, thus allowing for the creation of Polygons that span more than half of the globe. In contrast, ST_MAKEPOLYGON inverts the orientation of those large shapes.
Syntax
ST_MAKEPOLYGONORIENTED( <geography_expression> )
Parameters
| Name | Required | Description |
|---|---|---|
geography_expression | required | A GEOGRAPHY 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.
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.
- As you follow along the loop, the inside of the Polygon should be on the left, and the outside of the Polygon should be on the right.