I have a table with thousands of addresses as points.
Is there a function in postgis that will allow me to get a bounding polygon around these points and return it as a polygon?
update I am looking for a more complex polygon than just a bounding rectangle
It may be not 100% clear from your question what you mean as more bounding polygon. It may be understood as
minimum bounding rectangle (also known as MBR or envelope) for which you can use ST_Envelope, ST_Box2D or ST_Extent,
as s a minimum geometry which encloses all points within given geometry, a convex envelope and in this case you can use ST_ConvexHull or even ST_ExteriorRing if your input would be a polygon,
As Pimin pointed in the comments below, ST_ConcaveHull is another option worth to consider, available since PostGIS 2.0.0.
ST_Extent provides an aggregate function that returns a bounding box that bounds a set of geometries.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With