Calcul des distances entre chaque points d'un polygone (CTE)
Cette fois on veut la liste des distances entre tous les points composants un polygone
par exemple pour vérifier qu'il n'y a aucun point qui s'approche d'un autre à moins d'une certaine distance
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), points1 as (SELECT st_pointn(g,n) as p1, n as n1 FROM line,series), points2 as (SELECT st_pointn(g,n) as p2,n as n2 FROM line,series) SELECT n1,n2,st_distance(p1,p2) FROM points1,points2 WHERE n1 != n2 ORDER BY 3 ASC
Commentaires