calcul distances entre point successif méthode avec CTE
variante même requête en utilisant les Command Table Expression
WITH line as (SELECT st_geometryn(st_boundary(geom),1) as g FROM bati_pol WHERE no_eca like '11330'), series as (SELECT generate_series(1,ST_NumPoints (g) ) as n FROM line) SELECT 'point '|| n,st_astext(st_pointn(g,n)), 'point '|| n+1,st_astext(st_pointn(g,n+1)), st_distance(st_pointn(g,n),st_pointn(g,n+1)) FROM line,series
Commentaires