POLYGON is a shape with a closed exterior that is made up of lines. Polygons can also contain holes. Polygons are often used to represent areas such as countries, states, or municipalities.
The coordinates of each Point and line that make up the Polygon are translated according to the current (denoted by an ) to determine what the point “is”, or what it “means” relative to the (if any) in the data set.
You can also store a “ with the following additional dimensions:
- A third dimension coordinate
Z(Z). - A measure coordinate
M(M). - Both a third dimension and a measure coordinate (
ZM).
Z and M dimensions can be accessed or modified using a number of , including:
ST_ZST_MST_AffineST_ZmflagST_MakePointST_MakePointMST_Force3DST_Force3DZST_Force3DMST_Force4DST_SnapST_SnapToGridST_RotateZST_AddMeasure
- The Z/M dimension is not index accelerated when using spatial predicates.
- Some spatial functions ignore the Z/M dimension, with transformations discarding the Z/M value.
Examples
Well known text
A Polygon can be created from SQL by calling thest_geomfromtext function on a LineString definition expressed in the format as shown below.
Polygons with holes
To represent a polygon with holes in , add one or more additional lists of coordinates that define the boundaries of the holes as shown below:Using a SQL function
You can also use thest_makepolygon function on a LineString that defines the outer boundary of the Polygon, e.g.:

