答案 0 :(得分:0)
St_dumppoints
也会返回多边形环和点ID,因此您可以通过此ID获取和排序。您还可以使用join
而不是in
子句从多边形返回所有点,这样您就可以在点图层中找到缺失的点。
SELECT num_bornes,x,y, dptable.pointID
FROM point
RIGHT JOIN
(SELECT (dp).path[1] As ringID,
(dp).path[2] As pointID,
(dp).geom ptgeom
FROM (SELECT st_dumppoints(geom) dp
FROM polygon
WHERE id_polygon=1 ) a) dptable
ON ST_Equals(point.geom, dptable.ptgeom)
ORDER BY dptable.pointID;
答案 1 :(得分:0)
似乎它们在图片中是有序的。如果你只是按照
使用订单怎么办? select num_bornes,x,y
from point
where geom in (select (st_dumppoints(geom)).geom
from polygon
where id_polygon=1) order by num_bornes