creating a polygon from points around a point in postgis

[亡魂溺海] 提交于 2019-12-13 00:42:13

问题


I have a postgresql db using postgis 2.0 and a table of thousands of points, I would like create a polygon of the furthest points originating around a particular central location. I haven't got a clue how this would be done, any ideas anyone??


回答1:


Filter and aggregate the points, and return the convex hull of the points.

So to select the points in mytable that are within a distance of 10 from id=123, and return the enclosing polygon:

SELECT ST_ConvexHull(ST_Collect(A.geom))
FROM mytable A, mytable B
WHERE B.id=123 AND ST_DWithin(A.geom, B.geom, 10)


来源:https://stackoverflow.com/questions/14647361/creating-a-polygon-from-points-around-a-point-in-postgis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!