[postgis-users] Problem by using raster function ST_Clip

Sandro Santilli strk at keybit.net
Sat Apr 2 10:58:45 PDT 2016

On Fri, Apr 01, 2016 at 12:41:37PM +0200, Michael Werner Maur wrote:
> Hello,
> I am using Postgis Raster in POSTGIS 2.1.5 on PostgreSQL 9.4.5 on Ubuntu 15.04
> 32-bit system.
> I using ST_Clip to clip a huge number of GeoTiff Files by the geometry field of
> another POSTGIS table. In most cases it works real good. Here my  an example for
> the request I use:
> SELECT ST_Clip(a.rast, ST_Buffer(b.geom, 1.7)) AS clip_rast, a.rid, b.id_bplan
> FROM raster_tab a LEFT JOIN umringe_tab b ON a_filename = b.datei_bez;
> In some cases I got the folowing problem. Database message is the following :
> ERROR: out of memory
> DETAIL: Failed on request of size 149598040.
> CONTEXT: PL/pgSQL function ST_Clip(....) line8 at RETURN

> Is there anybody having any idea to solve or to avoid the problem ?

Try to separate the ST_Clip from the ST_Buffer operation, and
see if one or the other, in isolation, raise the problem.

For example you could create a temporary table with the result of
ST_Buffer and then use the temporary table for the clip operation.


  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html

More information about the postgis-users mailing list