In PostGIS, I want to calculate the length of different sides of a polygon. I know how to calculate a perimeter but how to calculate length side by side?
Perimeter is as a sum of side's length so I think PostGIS do this operation.
For example a basic polygon like this :
WITH data AS (
SELECT
1 AS gid,
'SRID=2154;POLYGON((0 1, 1 10, 20 30, 30 1, 0 1))'::geometry AS geom
)
SELECT
gid,
geom,
ST_Perimeter(geom) AS perimeter
FROM
data;
What is the length between A and B, B and C, C and D, D and A?