[postgis-users] st_intersects threw an error

strk strk at keybit.net
Tue Mar 9 04:01:00 PST 2010


On Tue, Mar 09, 2010 at 12:50:09PM +0100, Leonid Khaylov wrote:
> Hello!
> 
>  
> 
> I'm experiencing a problem with function st_intersects (currently
> installed PostGIS 1.4). Our software makes a lot of db queries which are
> using st_intersects (actually it should be running a week or more) and
> after some number of queries we get "st_intersects threw an error"
> problem. We were able to get around this problem as after the error is
> thrown we disconnect from the db and connect to it again retrying the
> same query. It works. But the problem we're experiencing now is more
> difficult - we get these errors more often with time. Apparently, on the
> 4th day of simulation we get those errors each 3 minutes and it is
> almost not possible to finish the simulation.
> 
> Any ideas on how can we get around it? Any patches?

Most of the times that error is due to topologicall-invalid geometries
being passed to st_intersects. You may first of all check that (ST_isValid).

Now, a separate issue is that ST_isValid may give you false positive (sic)
unless you install current development version of GEOS.

So my advice is: install GEOS development version, check your geometries
with ST_isValid, clean them up if any invalidity is found.

Also note that upgrading GEOS will give you improved robustness and speed.
Finally, consider also upgrading postgis (1.5.1 is about to be released).

--strk;

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



More information about the postgis-users mailing list