]> granicus.if.org Git - postgis/commitdiff
Added conditional check to ST_Intersects(raster, int, raster, int) to deal with STRIC...
authorBborie Park <bkpark at ucdavis.edu>
Mon, 9 Jan 2012 19:02:49 +0000 (19:02 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Mon, 9 Jan 2012 19:02:49 +0000 (19:02 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@8728 b70326c6-7e19-0410-871a-916f4a2858ee

raster/rt_pg/rtpostgis.sql.in.c

index 7ff10a57fcfc8df3f0eb12453823ec544fe904ba..6b13c401aea055ff9e4e124403330ecfbbca98b8 100644 (file)
@@ -2970,10 +2970,11 @@ CREATE OR REPLACE FUNCTION _st_intersects(rast1 raster, nband1 integer, rast2 ra
 
 CREATE OR REPLACE FUNCTION st_intersects(rast1 raster, nband1 integer, rast2 raster, nband2 integer)
        RETURNS boolean
-       AS $$ SELECT $1 && $3 AND _st_intersects($1, $2, $3, $4) $$
+       AS $$ SELECT $1 && $3 AND CASE WHEN $2 IS NULL OR $4 IS NULL THEN TRUE ELSE _st_intersects($1, $2, $3, $4) END $$
        LANGUAGE 'SQL' IMMUTABLE
        COST 1000;
 
+
 CREATE OR REPLACE FUNCTION st_intersects(rast1 raster, rast2 raster)
        RETURNS boolean
        AS $$ SELECT $1 && $2 AND _st_intersects($1, 1, $2, 1) $$