本文介绍了从postgis中的点周围的点创建多边形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个使用postgis 2.0的postgresql数据库和一个包含数千个点的表,我想创建一个最远点的多边形,这些多边形起源于特定的中心位置.我不知道如何做到这一点,任何想法都可以吗?
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??
推荐答案
过滤并汇总点,然后返回点的凸包.
Filter and aggregate the points, and return the convex hull of the points.
因此要选择mytable
中距id = 123距离为10的点,并返回封闭的多边形:
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)
这篇关于从postgis中的点周围的点创建多边形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!