[postgis-users] Geom/Rast Intersection St9bad_alloc

Sandro Santilli strk at keybit.net
Tue Apr 24 02:57:34 PDT 2012


On Tue, Apr 24, 2012 at 02:50:37AM -0700, JamesH wrote:
> Hi all,
> 
> I am attempting to intersect a thermal raster TIFF with a MasterMap
> shapefile.
> 
> Both sets of data are stored in my database successfully and the query I am
> running is:
> SELECT gid, ST_Intersection(geom, rast, 1)
> FROM clip_build, nclheat
> WHERE ST_Intersects(rast, geom)
> 
> The raster file is quite large so takes a few hours to run, but it returned
> an error message that I don't fully understand (below)
> NOTICE:  Ring Self-intersection at or near point 425485.0638371231
> 567560.21788342111
> CONTEXT:  PL/pgSQL function "st_intersection" line 10 at RETURN QUERY
> NOTICE:  LWGEOM_GEOS_buildArea() threw an error: St9bad_alloc
> CONTEXT:  PL/pgSQL function "st_intersection" line 10 at RETURN QUERY
> ERROR:  St9bad_alloc
> CONTEXT:  PL/pgSQL function "st_intersection" line 10 at RETURN QUERY
> 
> Can anyone explain how to solve the Ring self-intersection problem or what
> St9Bad_alloc is?

St9Bad_alloc means the process run out of memory.
There may be a memory leak or uncareful use in
ST_Intersection(raster,geometry).
Try restricting the scope of your queries, using
subsets from clip_build and nclheat and storing the
results in a temporary table.

Shall you find a single pair of inputs consistently triggering the problem
it'll be easier to deal with.

--strk; 

  ,------o-. 
  |   __/  |    Delivering high quality PostGIS 2.0 !
  |  / 2.0 |    http://strk.keybit.net - http://vizzuality.com
  `-o------'




More information about the postgis-users mailing list