]> granicus.if.org Git - postgis/commitdiff
Removed vector-space (geometry-based) variants of ST_Overlaps. Only
authorBborie Park <bkpark at ucdavis.edu>
Mon, 23 Jul 2012 17:49:24 +0000 (17:49 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Mon, 23 Jul 2012 17:49:24 +0000 (17:49 +0000)
raster-space versions remain.

git-svn-id: http://svn.osgeo.org/postgis/trunk@10090 b70326c6-7e19-0410-871a-916f4a2858ee

doc/reference_raster.xml
raster/rt_pg/rtpostgis.sql.in.c
raster/rt_pg/rtpostgis_drop.sql.in.c

index 1f550af1b18ebe308fb8617baa6747397aeeadce..834853b6449c2b9cf2dfb36d24db08ab45a414a2 100644 (file)
@@ -8961,12 +8961,6 @@ WHERE A.rid =2 ;
                                Return true if the raster spatially overlaps a separate raster or geometry. This means that the raster/raster or raster/geometry combinations intersect but one does not completely contain the other. 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.
                        </para>
 
-                       <note>
-                               <para>
-                                       Depending on the order that the raster and geometry is passed to ST_Overlaps(), the test will operate in either raster-space or geometry-space.  If ST_Overlaps(raster, ....), the test is in raster-space (the geometry is converted to a raster).  If ST_Overlaps(geometry, ...), the test is in geometry-space (the raster is converted to a set of pixel polygons).
-                               </para>
-                       </note>
-
                        <note>
                                <para>
                                        This operand will make use of any indexes that may be available on the geometries / rasters.
index 3f875fc3ac5a822c68f2d306e27ec00c718a06fe..e8c41f0f2b9ffd9821269c11b504ea31c88636ce 100644 (file)
@@ -3241,7 +3241,7 @@ CREATE OR REPLACE FUNCTION st_overlaps(rast1 raster, rast2 raster)
        COST 1000;
 
 -----------------------------------------------------------------------
--- ST_Overlaps(raster, geometry) in raster-space
+-- ST_Overlaps(raster, geometry)
 -----------------------------------------------------------------------
 
 CREATE OR REPLACE FUNCTION _st_overlaps(rast raster, geom geometry, nband integer DEFAULT NULL)
@@ -3283,44 +3283,13 @@ CREATE OR REPLACE FUNCTION st_overlaps(rast raster, nband integer, geom geometry
        COST 1000;
 
 -----------------------------------------------------------------------
--- ST_Overlaps(geometry, raster) in geometry-space
+-- ST_Overlaps(geometry, raster)
 -----------------------------------------------------------------------
 
--- This function can not be STRICT
-CREATE OR REPLACE FUNCTION _st_overlaps(geom geometry, rast raster, nband integer DEFAULT NULL)
-       RETURNS boolean AS $$
-       DECLARE
-               convexhull geometry;
-               hasnodata boolean := TRUE;
-               surface geometry;
-       BEGIN
-               convexhull := ST_ConvexHull(rast);
-               IF nband IS NOT NULL THEN
-                       SELECT CASE WHEN bmd.nodatavalue IS NULL THEN FALSE ELSE NULL END INTO hasnodata FROM ST_BandMetaData(rast, nband) AS bmd;
-               END IF;
-
-               IF ST_Overlaps(geom, convexhull) IS NOT TRUE THEN
-                       RETURN FALSE;
-               ELSEIF nband IS NULL OR hasnodata IS FALSE THEN
-                       RETURN TRUE;
-               END IF;
-
-               -- get band polygon
-               surface := ST_Polygon(rast, nband);
-
-               IF surface IS NOT NULL THEN
-                       RETURN ST_Overlaps(geom, surface);
-               END IF;
-
-               RETURN FALSE;
-       END;
-       $$ LANGUAGE 'plpgsql' IMMUTABLE
-       COST 1000;
-
 -- This function can not be STRICT
 CREATE OR REPLACE FUNCTION st_overlaps(geom geometry, rast raster, nband integer DEFAULT NULL)
        RETURNS boolean AS
-       $$ SELECT $1 && $2::geometry AND _st_overlaps($1, $2, $3); $$
+       $$ SELECT $1 && $2::geometry AND _st_overlaps($2, $1, $3); $$
        LANGUAGE 'sql' IMMUTABLE
        COST 1000;
 
index 66401f213dafe47426cbb9b5ff680b5d147cac08..43ed88b396456ea7dc360e73cb1d0db75b172dc0 100644 (file)
@@ -347,3 +347,6 @@ DROP FUNCTION IF EXISTS st_pixelaspolygons(raster, integer);
 
 -- function deprecated
 DROP FUNCTION IF EXISTS st_bandsurface(raster, integer);
+
+-- function deprecated
+DROP FUNCTION IF EXISTS _st_overlaps(geometry, raster, integer);