All Products
Search
Document Center

PolarDB:ST_Perimeter2D

Last Updated:Mar 28, 2026

Calculates the 2D perimeter of a geometry. ST_Perimeter2D is an alias for ST_Perimeter.

Syntax

float ST_Perimeter2D(geometry geomA);

Parameters

ParameterDescription
geomAThe geometry object that you want to specify.

Examples

Calculate the 2D perimeter of a polygon. The polygon in this example has vertices at (0,0), (0,2), (2,2), and (2,0), forming a 2x2 square with a perimeter of 8 coordinate units.

SELECT ST_Perimeter2D('POLYGON((0 0,0 2,2 2,2 0,0 0))'::geometry);
 st_perimeter
--------------
            8
(1 row)