ST_FORCECCW
Creates a standardized polygon from an existing one. defines standardized as the exterior being counterclockwise (CCW) and all holes being clockwise (CW) oriented. SyntaxSQL
Example
SQL
POLYGON((0 0,1 0,1 1,0 1,0 0))
ST_MAKEPOLYGON
Alias for ST_POLYGON.ST_POLYGON
Creates aPOLYGON.
ST_POLYGON(geo)
Creates aPOLYGON from the specified POINT, POINT array, LINESTRING, or POLYGON geography.
Syntax
SQL
Example
SQL
POLYGON((1 2,1 3,1 4,1 2))
ST_POLYGON(char) [#st_polygon-char]
Alias for ST_MAKEPOLYGON(char). Creates aPOLYGON from the specified CHAR representing a POLYGON in WKT format.
Syntax
SQL
Example
SQL
POLYGON((1 2,1 3,1 4,1 2))
ST_POLYGON(binary) [#st_polygon-binary]
Alias for ST_POLYGONFROMWKB(binary). Creates aPOLYGON from the specified BINARY. The BINARY value must represent a POLYGON in WKB format.
Syntax
SQL
Example
SQL
POLYGON((0 0,0 1,1 1,1 0,0 0))
ST_POLYGON(outer_ring, inner_rings)
Alias for ST_MAKEPOLYGON(outerRing, innerRings). Creates aPOLYGON from the specified outer ring (that must be either a POINT, POINT array, or LINESTRING) and the array of interior rings (closed lines).
The interior of the POLYGON is on the left when traveling around the exterior ring. The interior of a hole is on the right when traveling around a hole.
Syntax
SQL
Example
SQL
POLYGON((1.000000 2.000000), (1.000000 2.000000))
ST_POLYGONFROMWKB
Alias for ST_POLYGON(binary).ST_POLYGONFROMEWKT
Alias for the ST_POLYGON constructor. Creates aPOLYGON using an EWKT-formatted CHAR as an input argument.
Syntax
SQL
Example
SQL
POLYGON((1 2,1 3,1 4,1 2))
ST_POLYGONFROMGEOJSON
Creates aPOLYGON represented by the specified GeoJSON value as an input argument.
Syntax
SQL
Examples
In this example, the function produces an empty
POLYGON value from the GeoJSON representation.
SQL
POLYGON EMPTY
In this example, the function produces a POLYGON value from the GeoJSON representation.
SQL
POLYGON((1 1, 1 5, 5 5, 5 1))
ST_POLYGONFROMTEXT
Alias for ST_POLYGON(char).ST_WHOLEEARTH
Returns the database internal representation of the whole earth polygon. The ST_ENVELOPE function returns thisPOLYGON value, with the envelope set as the entire earth.
GIS specifications do not describe a canonical polygon for the whole earth, but this value serves as the Ocient-canonical polygon. The whole earth polygon is also equivalent to ST_POLYGON('POLYGON((0 0,0 0,0 0,0 0'))), which can have a separate meaning in other GIS implementations.
Syntax
SQL
SQL
POLYGON((0.0 0.0, 0.0 0.0, 0.0 0.0, 0.0 0.0))

