From: Bborie Park Date: Thu, 19 Jul 2012 18:18:00 +0000 (+0000) Subject: Minor documentation change regarding && operator and tweaked one X-Git-Tag: 2.1.0beta2~789 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bf85f1cdd75336049067d98832bf5d96886b2279;p=postgis Minor documentation change regarding && operator and tweaked one variant of st_intersects git-svn-id: http://svn.osgeo.org/postgis/trunk@10071 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference_raster.xml b/doc/reference_raster.xml index 49ed90262..62477e0d0 100644 --- a/doc/reference_raster.xml +++ b/doc/reference_raster.xml @@ -8557,11 +8557,11 @@ WHERE rid = 2; Raster Operators - + && - Returns TRUE if A's bounding box overlaps B's. + Returns TRUE if A's bounding box intersects B's bounding box. @@ -8587,7 +8587,7 @@ WHERE rid = 2; Description - The && operator returns TRUE if the bounding box of raster A overlaps the bounding box of raster B. + The && operator returns TRUE if the bounding box of raster A intersects the bounding box of raster B. This operand will make use of any indexes that may be available on the rasters. @@ -8597,10 +8597,10 @@ WHERE rid = 2; Examples - SELECT A.rid As a_rid, B.rid As b_rid, A.rast && B.rast As overlap + SELECT A.rid As a_rid, B.rid As b_rid, A.rast && B.rast As intersect FROM dummy_rast AS A CROSS JOIN dummy_rast AS B LIMIT 3; - a_rid | b_rid | overlap + a_rid | b_rid | intersect -------+-------+--------- 2 | 2 | t 2 | 3 | f diff --git a/raster/rt_pg/rtpostgis.sql.in.c b/raster/rt_pg/rtpostgis.sql.in.c index f6d038825..a2fb3e55c 100644 --- a/raster/rt_pg/rtpostgis.sql.in.c +++ b/raster/rt_pg/rtpostgis.sql.in.c @@ -3124,7 +3124,7 @@ 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 CASE WHEN $2 IS NULL OR $4 IS NULL THEN TRUE ELSE _st_intersects($1, $2, $3, $4) END $$ + AS $$ SELECT $1 && $3 AND CASE WHEN $2 IS NULL OR $4 IS NULL THEN st_intersects(st_convexhull($1), st_convexhull($3)) ELSE _st_intersects($1, $2, $3, $4) END $$ LANGUAGE 'sql' IMMUTABLE COST 1000;