Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
Calculates the perimeter of a surface in the specified units.
The units in which the length should be computed. Defaults to the unit of the spatial reference system. The unit name must
match the UNIT_NAME column of a row in the ST_UNITS_OF_MEASURE view where UNIT_TYPE is 'LINEAR'.
Returns the perimeter of the surface in the specified unit of measure.
The ST_Perimeter method returns the length of the perimeter of a surface in the units identified by the unit-name parameter. If the surface is empty, then NULL is returned.
If the surface contains Z values, these are not considered when computing the perimeter of the geometry.
The perimeter of a polygon includes the length of all rings (exterior and interior).
If the surface-expression is an empty geometry (ST_IsEmpty()=1), then this method returns NULL.
By default, ST_Perimeter uses the original format for a geometry, if it is available. Otherwise, the internal format is used.
For more information about internal and original formats, see STORAGE FORMAT clause, CREATE SPATIAL REFERENCE SYSTEM statement.
SQL/MM (ISO/IEC 13249-3: 2006)
The following example returns the result 18.
SELECT TREAT( Shape as ST_Surface ).ST_Perimeter()
FROM SpatialShapes WHERE ShapeID = 3
The following returns the perimeter of the poly_geometry column in miles from the fictional region table.
SELECT name, poly_geometry.ST_Perimeter( 'Statute Mile' )