[postgis-users] Postgis Raster determine exact hull

1 view
Skip to first unread message

Richard Huesken

unread,
Jan 10, 2022, 3:26:58 PM1/10/22
to postgi...@lists.osgeo.org
hi,

I'm using postgis 3.1 and I'm looking for the best way to obtain the exact hull of a raster (excluding the nodata points). The st_minconvexhull uses the MBR of the raster coverage, and is therefore quite fast. The result is however not as accurate as I require.

I constructed some sql that uses st_pixelaspolygons and then does a st_union. However, My typical raster has 256x256 points, and with several 100s of rasters this is quite slow.

Are there more clever (and faster!) ways to get the exact hull of a raster?

Thanks in advance,

Richard.

Marcin Mionskowski

unread,
Jan 11, 2022, 12:43:06 AM1/11/22
to PostGIS Users Discussion
Hi,
Try to reclassify the raster first so that all "non NA" values are equal (e.g. 1), then do ST_DumpAsPolygons.
Regards,
Marcin

_______________________________________________
postgis-users mailing list
postgi...@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users

Regina Obe

unread,
Jan 11, 2022, 2:02:53 AM1/11/22
to PostGIS Users Discussion

You could also try using ST_Polygon

 

It will treat all non NA as the same resulting in a polygon or multipolygon.

 

https://postgis.net/docs/RT_ST_Polygon.html

Reply all
Reply to author
Forward
0 new messages