Reputation: 53
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??
Upvotes: 1
Views: 1257
Reputation: 43622
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)
Upvotes: 2