From 24cb97b001576ecf57edbd2509115cda47cd424c Mon Sep 17 00:00:00 2001 From: Bborie Park Date: Mon, 18 Jun 2012 22:48:11 +0000 Subject: [PATCH] Behavior is consistent across ST_Intersects(raster, ...) variants. Synced docs of ST_Intersects to actual behavior. Ticket is #1870. git-svn-id: http://svn.osgeo.org/postgis/trunk@9946 b70326c6-7e19-0410-871a-916f4a2858ee --- doc/reference_raster.xml | 150 +++++++++++++++++++------------- raster/rt_pg/rtpostgis.sql.in.c | 2 +- 2 files changed, 89 insertions(+), 63 deletions(-) diff --git a/doc/reference_raster.xml b/doc/reference_raster.xml index c6045fe68..22581fdfc 100644 --- a/doc/reference_raster.xml +++ b/doc/reference_raster.xml @@ -8394,85 +8394,111 @@ a_rid | b_rid | overleft ST_Intersects - If band numbers are omitted only considers convex hull of raster. Returns true only if rast pixel in a band with non-nodata band value intersects - with a geometry/raster. + Return true if the raster spatially intersects a separate raster or geometry. If the band number is not provided (or set to NULL), only the convex hull of the raster is considered in the test. If the band number is provided, only those pixels with value (not NODATA) are considered in the test. + - boolean ST_Intersects - - raster - rast - - - integer - band - - - geometry - geommin - + boolean ST_Intersects + + raster + rasta + + + integer + nbanda + + + raster + rastb + + + integer + nbandb + - - - boolean ST_Intersects - - geometry - geommin - - - raster - rast - - - integer - nband=NULL - + + + boolean ST_Intersects + + raster + rasta + + + raster + rastb + - - - boolean ST_Intersects - - raster - rasta - - - raster - rastb - + + + boolean ST_Intersects + + raster + rast + + + integer + nband + + + geometry + geommin + + + + + boolean ST_Intersects + + raster + rast + + + geometry + geommin + + + integer + nband=NULL + - boolean ST_Intersects - - raster - rasta - - - integer - nbanda - - - raster - rastb - - - integer - nbandb=1 - + boolean ST_Intersects + + geometry + geommin + + + raster + rast + + + integer + nband=NULL + + Description - Returns true if the geometry intersects with the raster. Nodata values are taken into account so that if the geometry intersects only with nodata values, the function returns false. If no band is specified band 1 is assumed. - For the case of raster/geometry and geometry/raster. ST_Intersects(raster,nband,geometry) is done in raster space (e.g. the geometry is converted to a raster before tested), ST_Intersects(geometry, raster)is done in geometry space -- raster is converted to geometry before checked. - This operand will make use of any indexes that may be available on the - geometries / rasters. + + Return true if the raster spatially intersects a separate raster or geometry. If the band number is not provided (or set to NULL), only the convex hull of the raster is considered in the test. If the band number is provided, only those pixels with value (not NODATA) are considered in the test. + + + + Depending on the order that the raster and geometry is passed to ST_Intersects(), the test will operate in either raster-space or geometry-space. If ST_Intersects(raster, ....), the test is in raster-space (the geometry is converted to a raster). If ST_Intersects(geometry, ...), the test is in geometry-space (the raster is converted to a set of pixel polygons). + + + + + This operand will make use of any indexes that may be available on the geometries / rasters. + + Enhanced: 2.0.0 support raster/raster intersects was introduced. diff --git a/raster/rt_pg/rtpostgis.sql.in.c b/raster/rt_pg/rtpostgis.sql.in.c index 9b604ca9b..f252128f8 100644 --- a/raster/rt_pg/rtpostgis.sql.in.c +++ b/raster/rt_pg/rtpostgis.sql.in.c @@ -2972,7 +2972,7 @@ CREATE OR REPLACE FUNCTION st_intersects(rast1 raster, nband1 integer, rast2 ras CREATE OR REPLACE FUNCTION st_intersects(rast1 raster, rast2 raster) RETURNS boolean - AS $$ SELECT $1 && $2 AND _st_intersects($1, 1, $2, 1) $$ + AS $$ SELECT st_intersects($1, NULL::integer, $2, NULL::integer) $$ LANGUAGE 'sql' IMMUTABLE COST 1000; -- 2.40.0