开发者

How do i get a bounding polygon around points?

开发者 https://www.devze.com 2022-12-16 14:12 出处:网络
I have a table with thousands of addresses开发者_JAVA技巧 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?

I have a table with thousands of addresses开发者_JAVA技巧 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消