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'.
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).
Note
If the surface-expression is an empty geometry (ST_IsEmpty()=1), then this method returns NULL.
The following example creates a multicurve and an example unit of measure (example_unit_halfmetre).
The ST_Length method finds the length of the geometry in this unit of measure, returning the value 6.0.
CREATE SPATIAL UNIT OF MEASURE IF NOT EXISTS "example_unit_halfmetre" TYPE LINEAR CONVERT USING .5;
SELECT NEW ST_MultiCurve(
NEW ST_LineString('LineString (0 0, 1 0)' ),
NEW ST_LineString('LineString (0 2, 2 2)' ) )
.ST_Length('example_unit_halfmetre');