]> granicus.if.org Git - postgis/commitdiff
Removed all raster/geometry variants of ST_Intersects, ST_Overlaps,
authorBborie Park <bkpark at ucdavis.edu>
Mon, 23 Jul 2012 17:49:38 +0000 (17:49 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Mon, 23 Jul 2012 17:49:38 +0000 (17:49 +0000)
ST_Touches and ST_Contains.

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

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

diff --git a/NEWS b/NEWS
index 5aaca14c23fd4d87b9609d9a33ff9632b5d11d13..3c629c1971c5e6a7a4be54802df155f04ee87bd4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,12 @@
 PostGIS 2.1.0
 2013/MM/DD
 
+* Important / Breaking Changes  *
+
+  - ST_Intersects(raster, geometry) and ST_Intersects(geometry, raster)
+    has been removed.  Use ST_Intersects(ST_Polygon(raster), geometry)
+    instead.
+
 * New Features *
 
   - ST_DelaunayTriangles (Sandro Santilli / Vizzuality)
@@ -8,8 +14,9 @@ PostGIS 2.1.0
   - ST_PixelAsPoint, ST_PixelAsPoints (Bborie Park / UC Davis)
   - ST_PixelAsCentroid, ST_PixelAsCentroids (Bborie Park / UC Davis)
   - ST_Raster2WorldCoord, ST_World2RasterCoord (Bborie Park / UC Davis)
-  - Additional raster/raster and raster/geometry spatial relationship
-    functions (ST_Overlaps, ST_Touches) (Bborie Park / UC Davis)
+  - Additional raster/raster spatial relationship functions
+    (ST_Overlaps, ST_Touches, ST_Contains)
+    (Bborie Park / UC Davis)
   - #1643, Tiger Geocoder - Tiger 2011 loader (Regina Obe / Paragon Corporation) 
     Funded by Hunter Systems Group
   - GEOMETRYCOLLECTION support for ST_MakeValid (Sandro Santilli / Vizzuality)
index 07f992ef8ef48fd5079f47f93d7d7259839c5bbb..4cf3f643d7c2e197a176da3ddb63a807be86738f 100644 (file)
@@ -8726,7 +8726,7 @@ a_rid | b_rid | overleft
                <refnamediv>
                        <refname>ST_Intersects</refname>
 
-                       <refpurpose>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.</refpurpose>
+                       <refpurpose>Return true if raster rastA spatially intersects raster rastB. 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.</refpurpose>
                  </refnamediv>
 
                  <refsynopsisdiv>
@@ -8764,54 +8764,6 @@ a_rid | b_rid | overleft
                                        </paramdef>
                          </funcprototype>
 
-                               <funcprototype>
-                                       <funcdef>boolean <function>ST_Intersects</function></funcdef>
-                                       <paramdef>
-                                         <type>raster </type>
-                                         <parameter>rast</parameter>
-                                       </paramdef>
-                                       <paramdef>
-                                         <type>integer </type>
-                                         <parameter>nband</parameter>
-                                       </paramdef>
-                                       <paramdef>
-                                         <type>geometry </type>
-                                         <parameter>geommin</parameter>
-                                       </paramdef>
-                         </funcprototype>
-
-                               <funcprototype>
-                                       <funcdef>boolean <function>ST_Intersects</function></funcdef>
-                                       <paramdef>
-                                         <type>raster </type>
-                                         <parameter>rast</parameter>
-                                       </paramdef>
-                                       <paramdef>
-                                         <type>geometry </type>
-                                         <parameter>geommin</parameter>
-                                       </paramdef>
-                                       <paramdef choice='opt'>
-                                         <type>integer </type>
-                                         <parameter>nband=NULL</parameter>
-                                       </paramdef>
-                         </funcprototype>
-
-                         <funcprototype>
-                                       <funcdef>boolean <function>ST_Intersects</function></funcdef>
-                                       <paramdef>
-                                         <type>geometry </type>
-                                         <parameter>geommin</parameter>
-                                       </paramdef>
-                                       <paramdef>
-                                         <type>raster </type>
-                                         <parameter>rast</parameter>
-                                       </paramdef>
-                                       <paramdef choice='opt'>
-                                         <type>integer </type>
-                                         <parameter>nband=NULL</parameter>
-                                       </paramdef>
-                         </funcprototype>
-
                        </funcsynopsis>
                  </refsynopsisdiv>
 
@@ -8819,39 +8771,33 @@ a_rid | b_rid | overleft
                        <title>Description</title>
 
                        <para>
-                               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.
+                               Return true if raster rastA spatially intersects raster rastB. 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_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 rasters.
                                </para>
                        </note>
-                       <note>
+                               
+                       <para>
+                               Enhanced: 2.0.0 support raster/raster intersects was introduced.
+                       </para>
+
+                       <warning>
                                <para>
-                                       This operand will make use of any indexes that may be available on the geometries / rasters.
+                                       Changed: The ST_Intersects(raster, geometry) and ST_Intersects(geometry, raster) variants present before PostGIS 2.1.0 have been removed.  Use ST_Intersects(ST_Polygon(raster), geometry) instead.
                                </para>
-                       </note>
-                               
-                       <para>Enhanced: 2.0.0 support raster/raster intersects was introduced.</para>
+                       </warning>
+
                  </refsection>
 
                  <refsection>
                        <title>Examples</title>
 
-                       <programlisting>SELECT A.rid, g.gid , ST_Intersects(A.rast, g.geom) As inter
-FROM dummy_rast AS A CROSS JOIN 
-       (VALUES (1, ST_Point(3427928, 5793243.85) ) ,
-               (2, ST_GeomFromText('LINESTRING(3427927.85 5793243.75,3427927.8 5793243.75,3427927.8 5793243.8)') ),
-               (3, ST_GeomFromText('LINESTRING(1 2, 3 4)') )
-               ) As g(gid,geom)
-WHERE A.rid =2 ;
-
- rid | gid | inter
------+-----+-------
-   2 |   1 | t
-   2 |   2 | t
-   2 |   3 | f
-</programlisting>
+                       <programlisting>
+-- needs a new example
+                       </programlisting>
                  </refsection> 
                        <refsection>
                                <title>See Also</title>
@@ -8865,7 +8811,7 @@ WHERE A.rid =2 ;
                <refnamediv>
                        <refname>ST_Overlaps</refname>
                        <refpurpose>
-                               Return true if the raster spatially overlaps 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.
+                               Return true if raster rastA spatially overlaps raster rastB. 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.
                        </refpurpose>
                </refnamediv>
 
@@ -8903,54 +8849,6 @@ WHERE A.rid =2 ;
                                        </paramdef>
                                </funcprototype>
 
-                               <funcprototype>
-                                       <funcdef>boolean <function>ST_Overlaps</function></funcdef>
-                                       <paramdef>
-                                               <type>raster </type>
-                                               <parameter>rast</parameter>
-                                       </paramdef>
-                                       <paramdef>
-                                               <type>integer </type>
-                                               <parameter>nband</parameter>
-                                       </paramdef>
-                                       <paramdef>
-                                               <type>geometry </type>
-                                               <parameter>geommin</parameter>
-                                       </paramdef>
-                               </funcprototype>
-
-                               <funcprototype>
-                                       <funcdef>boolean <function>ST_Overlaps</function></funcdef>
-                                       <paramdef>
-                                               <type>raster </type>
-                                               <parameter>rast</parameter>
-                                       </paramdef>
-                                       <paramdef>
-                                               <type>geometry </type>
-                                               <parameter>geommin</parameter>
-                                       </paramdef>
-                                       <paramdef choice='opt'>
-                                               <type>integer </type>
-                                               <parameter>nband=NULL</parameter>
-                                       </paramdef>
-                               </funcprototype>
-
-                               <funcprototype>
-                                       <funcdef>boolean <function>ST_Overlaps</function></funcdef>
-                                       <paramdef>
-                                               <type>geometry </type>
-                                               <parameter>geommin</parameter>
-                                       </paramdef>
-                                       <paramdef>
-                                               <type>raster </type>
-                                               <parameter>rast</parameter>
-                                       </paramdef>
-                                       <paramdef choice='opt'>
-                                               <type>integer </type>
-                                               <parameter>nband=NULL</parameter>
-                                       </paramdef>
-                               </funcprototype>
-
                        </funcsynopsis>
                </refsynopsisdiv>
 
@@ -8958,12 +8856,12 @@ WHERE A.rid =2 ;
                        <title>Description</title>
 
                        <para>
-                               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.
+                               Return true if raster rastA spatially overlaps raster rastB. This means that rastA and rastB 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>
-                                       This operand will make use of any indexes that may be available on the geometries / rasters.
+                                       This operand will make use of any indexes that may be available on the rasters.
                                </para>
                        </note>
                                
@@ -8989,7 +8887,7 @@ WHERE A.rid =2 ;
                <refnamediv>
                        <refname>ST_Touches</refname>
                        <refpurpose>
-                               Return true if the raster spatially touch 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.
+                               Return true if raster rastA spatially touch raster rastB. 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.
                        </refpurpose>
                </refnamediv>
 
@@ -9027,54 +8925,6 @@ WHERE A.rid =2 ;
                                        </paramdef>
                                </funcprototype>
 
-                               <funcprototype>
-                                       <funcdef>boolean <function>ST_Touches</function></funcdef>
-                                       <paramdef>
-                                               <type>raster </type>
-                                               <parameter>rast</parameter>
-                                       </paramdef>
-                                       <paramdef>
-                                               <type>integer </type>
-                                               <parameter>nband</parameter>
-                                       </paramdef>
-                                       <paramdef>
-                                               <type>geometry </type>
-                                               <parameter>geommin</parameter>
-                                       </paramdef>
-                               </funcprototype>
-
-                               <funcprototype>
-                                       <funcdef>boolean <function>ST_Touches</function></funcdef>
-                                       <paramdef>
-                                               <type>raster </type>
-                                               <parameter>rast</parameter>
-                                       </paramdef>
-                                       <paramdef>
-                                               <type>geometry </type>
-                                               <parameter>geommin</parameter>
-                                       </paramdef>
-                                       <paramdef choice='opt'>
-                                               <type>integer </type>
-                                               <parameter>nband=NULL</parameter>
-                                       </paramdef>
-                               </funcprototype>
-
-                               <funcprototype>
-                                       <funcdef>boolean <function>ST_Touches</function></funcdef>
-                                       <paramdef>
-                                               <type>geometry </type>
-                                               <parameter>geommin</parameter>
-                                       </paramdef>
-                                       <paramdef>
-                                               <type>raster </type>
-                                               <parameter>rast</parameter>
-                                       </paramdef>
-                                       <paramdef choice='opt'>
-                                               <type>integer </type>
-                                               <parameter>nband=NULL</parameter>
-                                       </paramdef>
-                               </funcprototype>
-
                        </funcsynopsis>
                </refsynopsisdiv>
 
@@ -9082,12 +8932,12 @@ WHERE A.rid =2 ;
                        <title>Description</title>
 
                        <para>
-                               Return true if the raster spatially touches a separate raster or geometry. This means that the raster/raster or raster/geometry combinations have at least one point in common but their interiors do not intersect. 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.
+                               Return true if raster rastA spatially touches raster rastB. This means that rastA and rastB have at least one point in common but their interiors do not intersect. 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>
-                                       This operand will make use of any indexes that may be available on the geometries / rasters.
+                                       This operand will make use of any indexes that may be available on the rasters.
                                </para>
                        </note>
                                
index 58155d82087c2fd855adc691355ed040fbf96103..a2c84dde379fb2097dfea942427838ddd66ca748 100644 (file)
@@ -3049,7 +3049,7 @@ CREATE OPERATOR && (
     );
 
 -----------------------------------------------------------------------
--- Raster/(Raster|Geometry) Spatial Relationship
+-- Raster/Raster Spatial Relationship
 -----------------------------------------------------------------------
 
 -----------------------------------------------------------------------
@@ -3134,90 +3134,6 @@ CREATE OR REPLACE FUNCTION st_intersects(rast1 raster, rast2 raster)
        LANGUAGE 'sql' IMMUTABLE
        COST 1000;
 
------------------------------------------------------------------------
--- ST_Intersects(raster, geometry) in raster-space
------------------------------------------------------------------------
-
-CREATE OR REPLACE FUNCTION _st_intersects(rast raster, geom geometry, nband integer DEFAULT NULL)
-       RETURNS boolean
-       AS $$
-       DECLARE
-               gr raster;
-               scale double precision;
-       BEGIN
-               IF ST_Intersects(geom, ST_ConvexHull(rast)) IS NOT TRUE THEN
-                       RETURN FALSE;
-               ELSEIF nband IS NULL THEN
-                       RETURN TRUE;
-               END IF;
-
-               -- scale is set to 1/100th of raster for granularity
-               SELECT least(scalex, scaley) / 100. INTO scale FROM ST_Metadata(rast);
-               gr := _st_asraster(geom, scale, scale);
-               IF gr IS NULL THEN
-                       RAISE EXCEPTION 'Unable to convert geometry to a raster';
-                       RETURN FALSE;
-               END IF;
-
-               RETURN ST_Intersects(rast, nband, gr, 1);
-       END;
-       $$ LANGUAGE 'plpgsql' IMMUTABLE
-       COST 1000;
-
-CREATE OR REPLACE FUNCTION st_intersects(rast raster, geom geometry, nband integer DEFAULT NULL)
-       RETURNS boolean
-       AS $$ SELECT $1::geometry && $2 AND _st_intersects($1, $2, $3) $$
-       LANGUAGE 'sql' IMMUTABLE
-       COST 1000;
-
-CREATE OR REPLACE FUNCTION st_intersects(rast raster, nband integer, geom geometry)
-       RETURNS boolean
-       AS $$ SELECT $1::geometry && $3 AND _st_intersects($1, $3, $2) $$
-       LANGUAGE 'sql' IMMUTABLE
-       COST 1000;
-
------------------------------------------------------------------------
--- ST_Intersects(geometry, raster) in geometry-space
------------------------------------------------------------------------
-
--- This function can not be STRICT
-CREATE OR REPLACE FUNCTION _st_intersects(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_Intersects(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_Intersects(geom, surface);
-               END IF;
-
-               RETURN FALSE;
-       END;
-       $$ LANGUAGE 'plpgsql' IMMUTABLE
-       COST 1000;
-
--- This function can not be STRICT
-CREATE OR REPLACE FUNCTION st_intersects(geom geometry, rast raster, nband integer DEFAULT NULL)
-       RETURNS boolean AS
-       $$ SELECT $1 && $2::geometry AND _st_intersects($1, $2, $3); $$
-       LANGUAGE 'sql' IMMUTABLE
-       COST 1000;
-
 -----------------------------------------------------------------------
 -- ST_Overlaps(raster, raster)
 -----------------------------------------------------------------------
@@ -3240,59 +3156,6 @@ CREATE OR REPLACE FUNCTION st_overlaps(rast1 raster, rast2 raster)
        LANGUAGE 'sql' IMMUTABLE
        COST 1000;
 
------------------------------------------------------------------------
--- ST_Overlaps(raster, geometry)
------------------------------------------------------------------------
-
-CREATE OR REPLACE FUNCTION _st_overlaps(rast raster, geom geometry, nband integer DEFAULT NULL)
-       RETURNS boolean
-       AS $$
-       DECLARE
-               gr raster;
-               scale double precision;
-       BEGIN
-               IF ST_Overlaps(geom, ST_ConvexHull(rast)) IS NOT TRUE THEN
-                       RETURN FALSE;
-               ELSEIF nband IS NULL THEN
-                       RETURN TRUE;
-               END IF;
-
-               -- scale is set to 1/100th of raster for granularity
-               SELECT least(scalex, scaley) / 100. INTO scale FROM ST_Metadata(rast);
-               gr := _st_asraster(geom, scale, scale);
-               IF gr IS NULL THEN
-                       RAISE EXCEPTION 'Unable to convert geometry to a raster';
-                       RETURN FALSE;
-               END IF;
-
-               RETURN ST_Overlaps(rast, nband, gr, 1);
-       END;
-       $$ LANGUAGE 'plpgsql' IMMUTABLE
-       COST 1000;
-
-CREATE OR REPLACE FUNCTION st_overlaps(rast raster, geom geometry, nband integer DEFAULT NULL)
-       RETURNS boolean
-       AS $$ SELECT $1::geometry && $2 AND _st_overlaps($1, $2, $3) $$
-       LANGUAGE 'sql' IMMUTABLE
-       COST 1000;
-
-CREATE OR REPLACE FUNCTION st_overlaps(rast raster, nband integer, geom geometry)
-       RETURNS boolean
-       AS $$ SELECT $1::geometry && $3 AND _st_overlaps($1, $3, $2) $$
-       LANGUAGE 'sql' IMMUTABLE
-       COST 1000;
-
------------------------------------------------------------------------
--- 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
-       $$ SELECT $1 && $2::geometry AND _st_overlaps($2, $1, $3); $$
-       LANGUAGE 'sql' IMMUTABLE
-       COST 1000;
-
 -----------------------------------------------------------------------
 -- ST_Touches(raster, raster)
 -----------------------------------------------------------------------
@@ -3315,59 +3178,6 @@ CREATE OR REPLACE FUNCTION st_touches(rast1 raster, rast2 raster)
        LANGUAGE 'sql' IMMUTABLE
        COST 1000;
 
------------------------------------------------------------------------
--- ST_Touches(raster, geometry)
------------------------------------------------------------------------
-
-CREATE OR REPLACE FUNCTION _st_touches(rast raster, geom geometry, nband integer DEFAULT NULL)
-       RETURNS boolean
-       AS $$
-       DECLARE
-               gr raster;
-               scale double precision;
-       BEGIN
-               IF ST_Touches(geom, ST_ConvexHull(rast)) IS NOT TRUE THEN
-                       RETURN FALSE;
-               ELSEIF nband IS NULL THEN
-                       RETURN TRUE;
-               END IF;
-
-               -- scale is set to 1/100th of raster for granularity
-               SELECT least(scalex, scaley) / 100. INTO scale FROM ST_Metadata(rast);
-               gr := _st_asraster(geom, scale, scale);
-               IF gr IS NULL THEN
-                       RAISE EXCEPTION 'Unable to convert geometry to a raster';
-                       RETURN FALSE;
-               END IF;
-
-               RETURN ST_Touches(rast, nband, gr, 1);
-       END;
-       $$ LANGUAGE 'plpgsql' IMMUTABLE
-       COST 1000;
-
-CREATE OR REPLACE FUNCTION st_touches(rast raster, geom geometry, nband integer DEFAULT NULL)
-       RETURNS boolean
-       AS $$ SELECT $1::geometry && $2 AND _st_touches($1, $2, $3) $$
-       LANGUAGE 'sql' IMMUTABLE
-       COST 1000;
-
-CREATE OR REPLACE FUNCTION st_touches(rast raster, nband integer, geom geometry)
-       RETURNS boolean
-       AS $$ SELECT $1::geometry && $3 AND _st_touches($1, $3, $2) $$
-       LANGUAGE 'sql' IMMUTABLE
-       COST 1000;
-
------------------------------------------------------------------------
--- ST_Touches(geometry, raster)
------------------------------------------------------------------------
-
--- This function can not be STRICT
-CREATE OR REPLACE FUNCTION st_touches(geom geometry, rast raster, nband integer DEFAULT NULL)
-       RETURNS boolean AS
-       $$ SELECT $1 && $2::geometry AND _st_touches($2, $1, $3); $$
-       LANGUAGE 'sql' IMMUTABLE
-       COST 1000;
-
 -----------------------------------------------------------------------
 -- ST_Contains(raster, raster)
 -----------------------------------------------------------------------
@@ -3390,85 +3200,6 @@ CREATE OR REPLACE FUNCTION st_contains(rast1 raster, rast2 raster)
        LANGUAGE 'sql' IMMUTABLE
        COST 1000;
 
------------------------------------------------------------------------
--- ST_Contains(raster, geometry)
------------------------------------------------------------------------
-
-CREATE OR REPLACE FUNCTION _st_contains(rast raster, geom geometry, nband integer DEFAULT NULL)
-       RETURNS boolean
-       AS $$
-       DECLARE
-               gr raster;
-               scale double precision;
-       BEGIN
-               IF ST_Contains(ST_ConvexHull(rast), geom) IS NOT TRUE THEN
-                       RETURN FALSE;
-               ELSEIF nband IS NULL THEN
-                       RETURN TRUE;
-               END IF;
-
-               -- scale is set to 1/100th of raster for granularity
-               SELECT least(scalex, scaley) / 100. INTO scale FROM ST_Metadata(rast);
-               gr := _st_asraster(geom, scale, scale);
-               IF gr IS NULL THEN
-                       RAISE EXCEPTION 'Unable to convert geometry to a raster';
-                       RETURN FALSE;
-               END IF;
-
-               RETURN ST_Contains(rast, nband, gr, 1);
-       END;
-       $$ LANGUAGE 'plpgsql' IMMUTABLE
-       COST 1000;
-
-CREATE OR REPLACE FUNCTION st_contains(rast raster, geom geometry, nband integer DEFAULT NULL)
-       RETURNS boolean
-       AS $$ SELECT $1::geometry && $2 AND _st_contains($1, $2, $3) $$
-       LANGUAGE 'sql' IMMUTABLE
-       COST 1000;
-
-CREATE OR REPLACE FUNCTION st_contains(rast raster, nband integer, geom geometry)
-       RETURNS boolean
-       AS $$ SELECT $1::geometry && $3 AND _st_contains($1, $3, $2) $$
-       LANGUAGE 'sql' IMMUTABLE
-       COST 1000;
-
------------------------------------------------------------------------
--- ST_Contains(geometry, raster)
------------------------------------------------------------------------
-
--- This function can not be STRICT
-CREATE OR REPLACE FUNCTION _st_contains(geom geometry, rast raster, nband integer DEFAULT NULL)
-       RETURNS boolean AS $$
-       DECLARE
-               gr raster;
-               scale double precision;
-       BEGIN
-               IF ST_Contains(geom, ST_ConvexHull(rast)) IS NOT TRUE THEN
-                       RETURN FALSE;
-               ELSEIF nband IS NULL THEN
-                       RETURN TRUE;
-               END IF;
-
-               -- scale is set to 1/100th of raster for granularity
-               SELECT least(scalex, scaley) / 100. INTO scale FROM ST_Metadata(rast);
-               gr := _st_asraster(geom, scale, scale);
-               IF gr IS NULL THEN
-                       RAISE EXCEPTION 'Unable to convert geometry to a raster';
-                       RETURN FALSE;
-               END IF;
-
-               RETURN ST_Contains(gr, 1, rast, nband);
-       END;
-       $$ LANGUAGE 'plpgsql' IMMUTABLE
-       COST 1000;
-
--- This function can not be STRICT
-CREATE OR REPLACE FUNCTION st_contains(geom geometry, rast raster, nband integer DEFAULT NULL)
-       RETURNS boolean AS
-       $$ SELECT $1 && $2::geometry AND _st_contains($1, $2, $3); $$
-       LANGUAGE 'sql' IMMUTABLE
-       COST 1000;
-
 -----------------------------------------------------------------------
 -- ST_Intersection(geometry, raster) in geometry-space
 -----------------------------------------------------------------------
index cfda3c57ca4fd3005d920aea74c08133cb61d4da..a9d7f6b6c1a1afe4719488b289f4b4a441366d9c 100644 (file)
@@ -292,6 +292,7 @@ CREATE OR REPLACE FUNCTION _drop_st_samealignment()
        $$ LANGUAGE 'plpgsql' VOLATILE;
 SELECT _drop_st_samealignment();
 DROP FUNCTION _drop_st_samealignment();
+
 DROP FUNCTION IF EXISTS _st_intersects(raster, integer, raster, integer);
 DROP FUNCTION IF EXISTS st_intersects(raster, integer, raster, integer);
 DROP FUNCTION IF EXISTS st_intersects(raster, raster);
@@ -348,8 +349,30 @@ DROP FUNCTION IF EXISTS st_pixelaspolygons(raster, integer);
 -- function deprecated
 DROP FUNCTION IF EXISTS st_bandsurface(raster, integer);
 
--- function deprecated
+-- function no longer exists
+DROP FUNCTION IF EXISTS st_intersects(raster, integer, geometry);
+DROP FUNCTION IF EXISTS st_intersects(raster, geometry, integer);
+DROP FUNCTION IF EXISTS st_intersects(geometry, raster, integer);
+DROP FUNCTION IF EXISTS _st_intersects(raster, geometry, integer);
+DROP FUNCTION IF EXISTS _st_intersects(geometry, raster, integer);
+
+-- function no longer exists
+DROP FUNCTION IF EXISTS st_overlaps(geometry, raster, integer);
+DROP FUNCTION IF EXISTS st_overlaps(raster, integer, geometry);
+DROP FUNCTION IF EXISTS st_overlaps(raster, geometry, integer);
+DROP FUNCTION IF EXISTS _st_overlaps(raster, geometry, integer);
 DROP FUNCTION IF EXISTS _st_overlaps(geometry, raster, integer);
 
--- function deprecated
+-- function no longer exists
+DROP FUNCTION IF EXISTS st_touches(geometry, raster, integer);
+DROP FUNCTION IF EXISTS st_touches(raster, geometry, integer);
+DROP FUNCTION IF EXISTS st_touches(raster, integer, geometry);
 DROP FUNCTION IF EXISTS _st_touches(geometry, raster, integer);
+DROP FUNCTION IF EXISTS _st_touches(raster, geometry, integer);
+
+-- function no longer exists
+DROP FUNCTION IF EXISTS st_contains(raster, geometry, integer);
+DROP FUNCTION IF EXISTS st_contains(raster, integer, geometry);
+DROP FUNCTION IF EXISTS st_contains(geometry, raster, integer);
+DROP FUNCTION IF EXISTS _st_contains(raster, geometry, integer);
+DROP FUNCTION IF EXISTS _st_contains(geometry, raster, integer);