[postgis-users] Raster Clipping vs Masking

Regina Obe lr at pcorp.us
Wed May 27 07:51:16 PDT 2020



I’m unclear what you want the outcome to be.  What’s wrong with ST_Clip if you want to clip the raster?  That is the most efficient way to clip a raster.




From: postgis-users [mailto:postgis-users-bounces at lists.osgeo.org] On Behalf Of Daniel Vignoles
Sent: Wednesday, May 27, 2020 10:36 AM
To: postgis-users at lists.osgeo.org
Subject: [postgis-users] Raster Clipping vs Masking



Hello Postgis-users, 


I'm looking to find out the most efficient method of clipping/masking a raster with a geometry in postgis. 



*	Multi-band raster

*	Geometry


*	​All pixels of all bands of the raster which intersect with the geometry

So far I have been using the ST_Clip(raster, geom) function.Do you know if there is a way to simply mask the raster with the geometry, rather than perform a clip operation? Would St_Intersection be more appropriate? I'd like to optimize this function as much as possible. Any thoughts/ideas? 


Thank you,


Daniel Vignoles


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20200527/7c93bf92/attachment.html>

More information about the postgis-users mailing list