]> granicus.if.org Git - postgis/commitdiff
Combined the gist spatial relationship tests into
authorBborie Park <bkpark at ucdavis.edu>
Thu, 18 Oct 2012 23:52:45 +0000 (23:52 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Thu, 18 Oct 2012 23:52:45 +0000 (23:52 +0000)
rt_gist_relationships

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

27 files changed:
raster/test/regress/Makefile.in
raster/test/regress/rt_above.sql [deleted file]
raster/test/regress/rt_above_expected [deleted file]
raster/test/regress/rt_below.sql [deleted file]
raster/test/regress/rt_below_expected [deleted file]
raster/test/regress/rt_contain.sql [deleted file]
raster/test/regress/rt_contain_expected [deleted file]
raster/test/regress/rt_contained.sql [deleted file]
raster/test/regress/rt_contained_expected [deleted file]
raster/test/regress/rt_gist_relationships.sql [new file with mode: 0644]
raster/test/regress/rt_gist_relationships_expected [new file with mode: 0644]
raster/test/regress/rt_left.sql [deleted file]
raster/test/regress/rt_left_expected [deleted file]
raster/test/regress/rt_overabove.sql [deleted file]
raster/test/regress/rt_overabove_expected [deleted file]
raster/test/regress/rt_overbelow.sql [deleted file]
raster/test/regress/rt_overbelow_expected [deleted file]
raster/test/regress/rt_overlap.sql [deleted file]
raster/test/regress/rt_overlap_expected [deleted file]
raster/test/regress/rt_overleft.sql [deleted file]
raster/test/regress/rt_overleft_expected [deleted file]
raster/test/regress/rt_overright.sql [deleted file]
raster/test/regress/rt_overright_expected [deleted file]
raster/test/regress/rt_right.sql [deleted file]
raster/test/regress/rt_right_expected [deleted file]
raster/test/regress/rt_same.sql [deleted file]
raster/test/regress/rt_same_expected [deleted file]

index d55cd046a39def15cab4f902c73c33c9d03ba294..f13f32d84e69e31f276609237caa46e3208a8b61 100644 (file)
@@ -106,21 +106,8 @@ TEST_MAPALGEBRA = \
        rt_4ma \
        rt_setvalues_geomval
 
-TEST_GIST = \
-       rt_above \
-       rt_below \
-       rt_contained \
-       rt_contain \
-       rt_left \
-       rt_overabove \
-       rt_overbelow \
-       rt_overlap \
-       rt_overleft \
-       rt_overright \
-       rt_right \
-       rt_same 
-
 TEST_SREL = \
+       rt_gist_relationships \
        rt_intersects \
        rt_samealignment \
        rt_geos_relationships
@@ -136,7 +123,7 @@ TEST_LOADER = \
        loader/Tiled10x10Copy
 
 TESTS = $(TEST_FIRST) $(TEST_METADATA) $(TEST_IO) $(TEST_BASIC_FUNC) \
-               $(TEST_PROPS) $(TEST_GIST) $(TEST_BANDPROPS) \
+               $(TEST_PROPS) $(TEST_BANDPROPS) \
                $(TEST_UTILITY) $(TEST_MAPALGEBRA) $(TEST_SREL) \
                $(TEST_BUGS) \
                $(TEST_LOADER)
diff --git a/raster/test/regress/rt_above.sql b/raster/test/regress/rt_above.sql
deleted file mode 100644 (file)
index ad26462..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
------------------------------------------------------------------------
--- $Id$
---
--- Copyright (c) 2009 Sandro Santilli <strk@keybit.net>
---
--- This is free software; you can redistribute and/or modify it under
--- the terms of the GNU General Public Licence. See the COPYING file.
------------------------------------------------------------------------
-
-CREATE TYPE tile AS (x int, y int, tile raster);
-CREATE OR REPLACE FUNCTION makegrid (int, int, box2d, int, int)
-    RETURNS SETOF tile
-AS
-'
-DECLARE
-    gridCols alias for $1;
-    gridRows alias for $2;
-    extent alias for $3;
-    tileWidth alias for $4;
-    tileHeight alias for $5;
-    rec tile;
-    scalex float8;
-    scaley float8;
-    ipx float8;
-    ipy float8;
-BEGIN
-       
-    -- compute some sizes
-    -- each tile extent width is extent.width / gridRows
-    scalex = ((ST_xmax(extent)-ST_xmin(extent))/gridCols)/tileWidth;
-    scaley = ((ST_ymax(extent)-ST_ymin(extent))/gridRows)/tileHeight;
-
-    FOR y IN 0..gridRows-1 LOOP
-        ipy = y*scaley + ST_ymin(extent);
-        FOR x IN 0..gridCols-1 LOOP
-            ipx = x*scalex + ST_xmin(extent);
-            rec.x = x;
-            rec.y = y;
-            rec.tile = st_MakeEmptyRaster(tileWidth, tileHeight, ipx, ipy,
-                                          scalex, scaley, 0, 0);
-            RETURN NEXT rec;
-        END LOOP;
-    END LOOP;
-
-    RETURN;
-END;
-'
-LANGUAGE 'plpgsql';
-
-CREATE TABLE rt_gist_grid_test AS 
-    SELECT * FROM makegrid(10, 10, 'BOX(-100 -100, 100 100)', 1, 1);
-
-CREATE TABLE rt_gist_query_test AS
-    SELECT * from makegrid(3, 3, 'BOX(-100 -100, 100 100)', 1, 1);
-
------------------------------------------------------------------------
--- raster_above
------------------------------------------------------------------------
-SELECT 'raster_above(X, query(1,1))' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND raster_above(a.tile, b.tile);
-
------------------------------------------------------------------------
--- Test |>> above
------------------------------------------------------------------------
-
-SELECT 'X |>> query(1,1)' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND a.tile |>> b.tile;
-
-DROP FUNCTION makegrid(integer,integer,box2d,integer,integer);
-DROP table rt_gist_grid_test;
-DROP table rt_gist_query_test;
-DROP type tile;
diff --git a/raster/test/regress/rt_above_expected b/raster/test/regress/rt_above_expected
deleted file mode 100644 (file)
index dec00ff..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-raster_above(X, query(1,1))|30|0|9|7|9|BOX(-100 40,100 100)
-X |>> query(1,1)|30|0|9|7|9|BOX(-100 40,100 100)
diff --git a/raster/test/regress/rt_below.sql b/raster/test/regress/rt_below.sql
deleted file mode 100644 (file)
index c64f43c..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
------------------------------------------------------------------------
--- $Id$
---
--- Copyright (c) 2009 Sandro Santilli <strk@keybit.net>
---
--- This is free software; you can redistribute and/or modify it under
--- the terms of the GNU General Public Licence. See the COPYING file.
------------------------------------------------------------------------
-
-CREATE TYPE tile AS (x int, y int, tile raster);
-CREATE OR REPLACE FUNCTION makegrid (int, int, box2d, int, int)
-    RETURNS SETOF tile
-AS
-'
-DECLARE
-    gridCols alias for $1;
-    gridRows alias for $2;
-    extent alias for $3;
-    tileWidth alias for $4;
-    tileHeight alias for $5;
-    rec tile;
-    scalex float8;
-    scaley float8;
-    ipx float8;
-    ipy float8;
-BEGIN
-       
-    -- compute some sizes
-    -- each tile extent width is extent.width / gridRows
-    scalex = ((ST_xmax(extent)-ST_xmin(extent))/gridCols)/tileWidth;
-    scaley = ((ST_ymax(extent)-ST_ymin(extent))/gridRows)/tileHeight;
-
-    FOR y IN 0..gridRows-1 LOOP
-        ipy = y*scaley + ST_ymin(extent);
-        FOR x IN 0..gridCols-1 LOOP
-            ipx = x*scalex + ST_xmin(extent);
-            rec.x = x;
-            rec.y = y;
-            rec.tile = st_MakeEmptyRaster(tileWidth, tileHeight, ipx, ipy,
-                                          scalex, scaley, 0, 0);
-            RETURN NEXT rec;
-        END LOOP;
-    END LOOP;
-
-    RETURN;
-END;
-'
-LANGUAGE 'plpgsql';
-
-CREATE TABLE rt_gist_grid_test AS 
-    SELECT * FROM makegrid(10, 10, 'BOX(-100 -100, 100 100)', 1, 1);
-
-CREATE TABLE rt_gist_query_test AS
-    SELECT * from makegrid(3, 3, 'BOX(-100 -100, 100 100)', 1, 1);
-
--------------------------------------------------------------------
--- raster_below
------------------------------------------------------------------------
-
-SELECT 'raster_below(X, query(1,1))' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND raster_below(a.tile, b.tile);
-
------------------------------------------------------------------------
--- Test <<| operator (below)
------------------------------------------------------------------------
-
-SELECT 'X <<| query(1,1)' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND a.tile <<| b.tile;
-
-DROP FUNCTION makegrid(integer,integer,box2d,integer,integer);
-DROP table rt_gist_grid_test;
-DROP table rt_gist_query_test;
-DROP type tile;
diff --git a/raster/test/regress/rt_below_expected b/raster/test/regress/rt_below_expected
deleted file mode 100644 (file)
index 8df2740..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-raster_below(X, query(1,1))|30|0|9|0|2|BOX(-100 -100,100 -40)
-X <<| query(1,1)|30|0|9|0|2|BOX(-100 -100,100 -40)
diff --git a/raster/test/regress/rt_contain.sql b/raster/test/regress/rt_contain.sql
deleted file mode 100644 (file)
index db7eb76..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
------------------------------------------------------------------------
--- $Id$
---
--- Copyright (c) 2009 Sandro Santilli <strk@keybit.net>
---
--- This is free software; you can redistribute and/or modify it under
--- the terms of the GNU General Public Licence. See the COPYING file.
------------------------------------------------------------------------
-
-CREATE TYPE tile AS (x int, y int, tile raster);
-CREATE OR REPLACE FUNCTION makegrid (int, int, box2d, int, int)
-    RETURNS SETOF tile
-AS
-'
-DECLARE
-    gridCols alias for $1;
-    gridRows alias for $2;
-    extent alias for $3;
-    tileWidth alias for $4;
-    tileHeight alias for $5;
-    rec tile;
-    scalex float8;
-    scaley float8;
-    ipx float8;
-    ipy float8;
-BEGIN
-       
-    -- compute some sizes
-    -- each tile extent width is extent.width / gridRows
-    scalex = ((ST_xmax(extent)-ST_xmin(extent))/gridCols)/tileWidth;
-    scaley = ((ST_ymax(extent)-ST_ymin(extent))/gridRows)/tileHeight;
-
-    FOR y IN 0..gridRows-1 LOOP
-        ipy = y*scaley + ST_ymin(extent);
-        FOR x IN 0..gridCols-1 LOOP
-            ipx = x*scalex + ST_xmin(extent);
-            rec.x = x;
-            rec.y = y;
-            rec.tile = st_MakeEmptyRaster(tileWidth, tileHeight, ipx, ipy,
-                                          scalex, scaley, 0, 0);
-            RETURN NEXT rec;
-        END LOOP;
-    END LOOP;
-
-    RETURN;
-END;
-'
-LANGUAGE 'plpgsql';
-
-CREATE TABLE rt_gist_grid_test AS 
-    SELECT * FROM makegrid(10, 10, 'BOX(-100 -100, 100 100)', 1, 1);
-
-CREATE TABLE rt_gist_query_test AS
-    SELECT * from makegrid(3, 3, 'BOX(-100 -100, 100 100)', 1, 1);
-
--------------------------------------------------------------------
--- raster_contain
------------------------------------------------------------------------
-
-SELECT 'raster_contain(query(1,1), X)' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND raster_contain(b.tile, a.tile);
-
--------------------------------------------------------------------
--- raster_geometry_contain
------------------------------------------------------------------------
-
-SELECT 'raster_geometry_contain(query(1,1), X)' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND raster_geometry_contain(b.tile, a.tile::geometry);
-
--------------------------------------------------------------------
--- geometry_raster_contain
------------------------------------------------------------------------
-
-SELECT 'geometry_raster_contain(query(1,1), X)' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND geometry_raster_contain(b.tile::geometry, a.tile);
-
------------------------------------------------------------------------
--- Test ~ operator (raster contains raster)
------------------------------------------------------------------------
-
-SELECT 'query(1,1) ~ X' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND b.tile ~ a.tile;
-
------------------------------------------------------------------------
--- Test ~ operator (raster contains geometry)
------------------------------------------------------------------------
-
-SELECT 'query(1,1) ~ X' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND b.tile ~ a.tile::geometry;
-
------------------------------------------------------------------------
--- Test ~ operator (geometry contains raster )
------------------------------------------------------------------------
-
-SELECT 'query(1,1) ~ X' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND b.tile::geometry ~ a.tile;
-
-DROP FUNCTION makegrid(integer,integer,box2d,integer,integer);
-DROP table rt_gist_grid_test;
-DROP table rt_gist_query_test;
-DROP type tile;
diff --git a/raster/test/regress/rt_contain_expected b/raster/test/regress/rt_contain_expected
deleted file mode 100644 (file)
index 697b93d..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-raster_contain(query(1,1), X)|4|4|5|4|5|BOX(-20 -20,20 20)
-raster_geometry_contain(query(1,1), X)|4|4|5|4|5|BOX(-20 -20,20 20)
-geometry_raster_contain(query(1,1), X)|4|4|5|4|5|BOX(-20 -20,20 20)
-query(1,1) ~ X|4|4|5|4|5|BOX(-20 -20,20 20)
-query(1,1) ~ X|4|4|5|4|5|BOX(-20 -20,20 20)
-query(1,1) ~ X|4|4|5|4|5|BOX(-20 -20,20 20)
diff --git a/raster/test/regress/rt_contained.sql b/raster/test/regress/rt_contained.sql
deleted file mode 100644 (file)
index 9a282f0..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
------------------------------------------------------------------------
--- $Id$
---
--- Copyright (c) 2009 Sandro Santilli <strk@keybit.net>
---
--- This is free software; you can redistribute and/or modify it under
--- the terms of the GNU General Public Licence. See the COPYING file.
------------------------------------------------------------------------
-
-CREATE TYPE tile AS (x int, y int, tile raster);
-CREATE OR REPLACE FUNCTION makegrid (int, int, box2d, int, int)
-    RETURNS SETOF tile
-AS
-'
-DECLARE
-    gridCols alias for $1;
-    gridRows alias for $2;
-    extent alias for $3;
-    tileWidth alias for $4;
-    tileHeight alias for $5;
-    rec tile;
-    scalex float8;
-    scaley float8;
-    ipx float8;
-    ipy float8;
-BEGIN
-       
-    -- compute some sizes
-    -- each tile extent width is extent.width / gridRows
-    scalex = ((ST_xmax(extent)-ST_xmin(extent))/gridCols)/tileWidth;
-    scaley = ((ST_ymax(extent)-ST_ymin(extent))/gridRows)/tileHeight;
-
-    FOR y IN 0..gridRows-1 LOOP
-        ipy = y*scaley + ST_ymin(extent);
-        FOR x IN 0..gridCols-1 LOOP
-            ipx = x*scalex + ST_xmin(extent);
-            rec.x = x;
-            rec.y = y;
-            rec.tile = st_MakeEmptyRaster(tileWidth, tileHeight, ipx, ipy,
-                                          scalex, scaley, 0, 0);
-            RETURN NEXT rec;
-        END LOOP;
-    END LOOP;
-
-    RETURN;
-END;
-'
-LANGUAGE 'plpgsql';
-
-CREATE TABLE rt_gist_grid_test AS 
-    SELECT * FROM makegrid(10, 10, 'BOX(-100 -100, 100 100)', 1, 1);
-
-CREATE TABLE rt_gist_query_test AS
-    SELECT * from makegrid(3, 3, 'BOX(-100 -100, 100 100)', 1, 1);
-
--------------------------------------------------------------------
--- raster_contained
------------------------------------------------------------------------
-
-SELECT 'raster_contained(X, query(1,1))' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND raster_contained(a.tile, b.tile);
-
------------------------------------------------------------------------
--- Test @ operator (contained by)
------------------------------------------------------------------------
-
-SELECT 'X @ query(1,1)' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND a.tile @ b.tile;
-
-DROP FUNCTION makegrid(integer,integer,box2d,integer,integer);
-DROP table rt_gist_grid_test;
-DROP table rt_gist_query_test;
-DROP type tile;
diff --git a/raster/test/regress/rt_contained_expected b/raster/test/regress/rt_contained_expected
deleted file mode 100644 (file)
index b2a7f2f..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-raster_contained(X, query(1,1))|4|4|5|4|5|BOX(-20 -20,20 20)
-X @ query(1,1)|4|4|5|4|5|BOX(-20 -20,20 20)
diff --git a/raster/test/regress/rt_gist_relationships.sql b/raster/test/regress/rt_gist_relationships.sql
new file mode 100644 (file)
index 0000000..979db06
--- /dev/null
@@ -0,0 +1,559 @@
+-----------------------------------------------------------------------
+-- $Id$
+--
+-- Copyright (c) 2009 Sandro Santilli <strk@keybit.net>
+--
+-- This is free software; you can redistribute and/or modify it under
+-- the terms of the GNU General Public Licence. See the COPYING file.
+-----------------------------------------------------------------------
+
+CREATE TYPE tile AS (x int, y int, tile raster);
+CREATE OR REPLACE FUNCTION makegrid (int, int, box2d, int, int)
+    RETURNS SETOF tile
+AS
+'
+DECLARE
+    gridCols alias for $1;
+    gridRows alias for $2;
+    extent alias for $3;
+    tileWidth alias for $4;
+    tileHeight alias for $5;
+    rec tile;
+    scalex float8;
+    scaley float8;
+    ipx float8;
+    ipy float8;
+BEGIN
+       
+    -- compute some sizes
+    -- each tile extent width is extent.width / gridRows
+    scalex = ((ST_xmax(extent)-ST_xmin(extent))/gridCols)/tileWidth;
+    scaley = ((ST_ymax(extent)-ST_ymin(extent))/gridRows)/tileHeight;
+
+    FOR y IN 0..gridRows-1 LOOP
+        ipy = y*scaley + ST_ymin(extent);
+        FOR x IN 0..gridCols-1 LOOP
+            ipx = x*scalex + ST_xmin(extent);
+            rec.x = x;
+            rec.y = y;
+            rec.tile = st_MakeEmptyRaster(tileWidth, tileHeight, ipx, ipy,
+                                          scalex, scaley, 0, 0);
+            RETURN NEXT rec;
+        END LOOP;
+    END LOOP;
+
+    RETURN;
+END;
+'
+LANGUAGE 'plpgsql';
+
+CREATE TABLE rt_gist_grid_test AS 
+    SELECT * FROM makegrid(10, 10, 'BOX(-100 -100, 100 100)', 1, 1);
+
+CREATE TABLE rt_gist_query_test AS
+    SELECT * from makegrid(3, 3, 'BOX(-100 -100, 100 100)', 1, 1);
+
+-----------------------------------------------------------------------
+-- raster_above
+-----------------------------------------------------------------------
+SELECT 'raster_above(X, query(1,1))' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND raster_above(a.tile, b.tile);
+
+-----------------------------------------------------------------------
+-- Test |>> above
+-----------------------------------------------------------------------
+
+SELECT 'X |>> query(1,1)' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND a.tile |>> b.tile;
+
+-----------------------------------------------------------------------
+-- raster_below
+-----------------------------------------------------------------------
+
+SELECT 'raster_below(X, query(1,1))' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND raster_below(a.tile, b.tile);
+
+-----------------------------------------------------------------------
+-- Test <<| operator (below)
+-----------------------------------------------------------------------
+
+SELECT 'X <<| query(1,1)' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND a.tile <<| b.tile;
+
+-----------------------------------------------------------------------
+-- raster_contained
+-----------------------------------------------------------------------
+
+SELECT 'raster_contained(X, query(1,1))' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND raster_contained(a.tile, b.tile);
+
+-----------------------------------------------------------------------
+-- Test @ operator (contained by)
+-----------------------------------------------------------------------
+
+SELECT 'X @ query(1,1)' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND a.tile @ b.tile;
+
+-----------------------------------------------------------------------
+-- raster_contain
+-----------------------------------------------------------------------
+
+SELECT 'raster_contain(query(1,1), X)' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND raster_contain(b.tile, a.tile);
+
+-----------------------------------------------------------------------
+-- raster_geometry_contain
+-----------------------------------------------------------------------
+
+SELECT 'raster_geometry_contain(query(1,1), X)' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND raster_geometry_contain(b.tile, a.tile::geometry);
+
+-----------------------------------------------------------------------
+-- geometry_raster_contain
+-----------------------------------------------------------------------
+
+SELECT 'geometry_raster_contain(query(1,1), X)' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND geometry_raster_contain(b.tile::geometry, a.tile);
+
+-----------------------------------------------------------------------
+-- Test ~ operator (raster contains raster)
+-----------------------------------------------------------------------
+
+SELECT 'query(1,1) ~ X' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND b.tile ~ a.tile;
+
+-----------------------------------------------------------------------
+-- Test ~ operator (raster contains geometry)
+-----------------------------------------------------------------------
+
+SELECT 'query(1,1) ~ X' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND b.tile ~ a.tile::geometry;
+
+-----------------------------------------------------------------------
+-- Test ~ operator (geometry contains raster )
+-----------------------------------------------------------------------
+
+SELECT 'query(1,1) ~ X' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND b.tile::geometry ~ a.tile;
+
+-----------------------------------------------------------------------
+-- raster_left
+-----------------------------------------------------------------------
+
+SELECT 'raster_left(X, query(1,1))' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND raster_left(a.tile, b.tile);
+
+-----------------------------------------------------------------------
+-- Test << operator (left)
+-----------------------------------------------------------------------
+
+SELECT 'X << query(1,1)' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND a.tile << b.tile;
+
+-----------------------------------------------------------------------
+-- raster_overabove
+-----------------------------------------------------------------------
+
+SELECT 'raster_overabove(X, query(1,1))' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND raster_overabove(a.tile, b.tile);
+
+-----------------------------------------------------------------------
+-- Test |&> operator (overabove)
+-----------------------------------------------------------------------
+
+SELECT 'X |&> query(1,1)' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND a.tile |&> b.tile;
+
+-----------------------------------------------------------------------
+-- raster_overbelow
+-----------------------------------------------------------------------
+
+SELECT 'raster_overbelow(X, query(1,1))' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND raster_overbelow(a.tile, b.tile);
+
+-----------------------------------------------------------------------
+-- Test &<| operator (overbelow)
+-----------------------------------------------------------------------
+
+SELECT 'X &<| query(1,1)' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND a.tile &<| b.tile;
+
+-----------------------------------------------------------------------
+-- raster_overlap
+-----------------------------------------------------------------------
+
+SELECT 'raster_overlap(X, query(1,1))' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND raster_overlap(a.tile, b.tile);
+
+-----------------------------------------------------------------------
+-- raster_geometry_overlap
+-----------------------------------------------------------------------
+
+SELECT 'raster_geometry_overlap(X, query(1,1))' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND raster_geometry_overlap(a.tile, b.tile::geometry);
+
+-----------------------------------------------------------------------
+-- geometry_raster_overlap
+-----------------------------------------------------------------------
+
+SELECT 'geometry_raster_overlap(X, query(1,1))' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND geometry_raster_overlap(a.tile::geometry, b.tile);
+
+-----------------------------------------------------------------------
+-- Test && operator (overlap)
+-----------------------------------------------------------------------
+
+SELECT 'X && query(1,1)' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND a.tile && b.tile;
+
+-----------------------------------------------------------------------
+-- Test && operator (raster overlap geometry)
+-----------------------------------------------------------------------
+
+SELECT 'X && query(1,1)' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND a.tile && b.tile::geometry;
+
+-----------------------------------------------------------------------
+-- Test && operator (geometry overlap raster)
+-----------------------------------------------------------------------
+
+SELECT 'X && query(1,1)' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND a.tile::geometry && b.tile;
+
+-----------------------------------------------------------------------
+-- raster_overleft
+-----------------------------------------------------------------------
+
+SELECT 'raster_overleft(X, query(1,1))' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND raster_overleft(a.tile, b.tile);
+
+-----------------------------------------------------------------------
+-- Test &< operator (overleft)
+-----------------------------------------------------------------------
+
+SELECT 'X &< query(1,1)' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND a.tile &< b.tile;
+
+-----------------------------------------------------------------------
+-- raster_overright
+-----------------------------------------------------------------------
+SELECT 'raster_overright(X, query(1,1))' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND raster_overright(a.tile, b.tile);
+
+-----------------------------------------------------------------------
+-- Test &> operator (overright)
+-----------------------------------------------------------------------
+
+SELECT 'X &> query(1,1)' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND a.tile &> b.tile;
+
+-----------------------------------------------------------------------
+-- raster_right
+-----------------------------------------------------------------------
+
+SELECT 'raster_right(X, query(1,1))' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND raster_right(a.tile, b.tile);
+
+-----------------------------------------------------------------------
+-- Test >> operator (right)
+-----------------------------------------------------------------------
+
+SELECT 'X >> query(1,1)' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND a.tile >> b.tile;
+
+-----------------------------------------------------------------------
+-- raster_same
+-----------------------------------------------------------------------
+
+SELECT 'raster_same(X, query(1,1))' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND raster_same(a.tile, b.tile);
+
+SELECT 'raster_same(X, query(7,7))' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_grid_test b
+WHERE b.x = 7 and b.y = 7
+    AND raster_same(a.tile, b.tile);
+
+-----------------------------------------------------------------------
+-- Test ~= operator (same)
+-----------------------------------------------------------------------
+
+SELECT 'X ~= query(1,1)' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_query_test b
+WHERE b.x = 1 and b.y = 1
+    AND a.tile ~= b.tile;
+
+SELECT 'X ~= tile(7,7)' as op,
+        count(a.y),
+        min(a.x) as xmin,
+        max(a.x) as xmax,
+        min(a.y) as ymin,
+        max(a.y) as ymax,
+        st_extent(a.tile::geometry)
+FROM rt_gist_grid_test a, rt_gist_grid_test b
+WHERE b.x = 7 and b.y = 7
+    AND a.tile ~= b.tile;
+
+DROP FUNCTION makegrid(integer,integer,box2d,integer,integer);
+DROP table rt_gist_grid_test;
+DROP table rt_gist_query_test;
+DROP type tile;
diff --git a/raster/test/regress/rt_gist_relationships_expected b/raster/test/regress/rt_gist_relationships_expected
new file mode 100644 (file)
index 0000000..79abfca
--- /dev/null
@@ -0,0 +1,34 @@
+raster_above(X, query(1,1))|30|0|9|7|9|BOX(-100 40,100 100)
+X |>> query(1,1)|30|0|9|7|9|BOX(-100 40,100 100)
+raster_below(X, query(1,1))|30|0|9|0|2|BOX(-100 -100,100 -40)
+X <<| query(1,1)|30|0|9|0|2|BOX(-100 -100,100 -40)
+raster_contained(X, query(1,1))|4|4|5|4|5|BOX(-20 -20,20 20)
+X @ query(1,1)|4|4|5|4|5|BOX(-20 -20,20 20)
+raster_contain(query(1,1), X)|4|4|5|4|5|BOX(-20 -20,20 20)
+raster_geometry_contain(query(1,1), X)|4|4|5|4|5|BOX(-20 -20,20 20)
+geometry_raster_contain(query(1,1), X)|4|4|5|4|5|BOX(-20 -20,20 20)
+query(1,1) ~ X|4|4|5|4|5|BOX(-20 -20,20 20)
+query(1,1) ~ X|4|4|5|4|5|BOX(-20 -20,20 20)
+query(1,1) ~ X|4|4|5|4|5|BOX(-20 -20,20 20)
+raster_left(X, query(1,1))|30|0|2|0|9|BOX(-100 -100,-40 100)
+X << query(1,1)|30|0|2|0|9|BOX(-100 -100,-40 100)
+raster_overabove(X, query(1,1))|60|0|9|4|9|BOX(-100 -20,100 100)
+X |&> query(1,1)|60|0|9|4|9|BOX(-100 -20,100 100)
+raster_overbelow(X, query(1,1))|60|0|9|0|5|BOX(-100 -100,100 20)
+X &<| query(1,1)|60|0|9|0|5|BOX(-100 -100,100 20)
+raster_overlap(X, query(1,1))|16|3|6|3|6|BOX(-40 -40,40 40)
+raster_geometry_overlap(X, query(1,1))|16|3|6|3|6|BOX(-40 -40,40 40)
+geometry_raster_overlap(X, query(1,1))|16|3|6|3|6|BOX(-40 -40,40 40)
+X && query(1,1)|16|3|6|3|6|BOX(-40 -40,40 40)
+X && query(1,1)|16|3|6|3|6|BOX(-40 -40,40 40)
+X && query(1,1)|16|3|6|3|6|BOX(-40 -40,40 40)
+raster_overleft(X, query(1,1))|60|0|5|0|9|BOX(-100 -100,20 100)
+X &< query(1,1)|60|0|5|0|9|BOX(-100 -100,20 100)
+raster_overright(X, query(1,1))|60|4|9|0|9|BOX(-20 -100,100 100)
+X &> query(1,1)|60|4|9|0|9|BOX(-20 -100,100 100)
+raster_right(X, query(1,1))|30|7|9|0|9|BOX(40 -100,100 100)
+X >> query(1,1)|30|7|9|0|9|BOX(40 -100,100 100)
+raster_same(X, query(1,1))|0|||||
+raster_same(X, query(7,7))|1|7|7|7|7|BOX(40 40,60 60)
+X ~= query(1,1)|0|||||
+X ~= tile(7,7)|1|7|7|7|7|BOX(40 40,60 60)
diff --git a/raster/test/regress/rt_left.sql b/raster/test/regress/rt_left.sql
deleted file mode 100644 (file)
index 53737ef..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
------------------------------------------------------------------------
--- $Id$
---
--- Copyright (c) 2009 Sandro Santilli <strk@keybit.net>
---
--- This is free software; you can redistribute and/or modify it under
--- the terms of the GNU General Public Licence. See the COPYING file.
------------------------------------------------------------------------
-
-CREATE TYPE tile AS (x int, y int, tile raster);
-CREATE OR REPLACE FUNCTION makegrid (int, int, box2d, int, int)
-    RETURNS SETOF tile
-AS
-'
-DECLARE
-    gridCols alias for $1;
-    gridRows alias for $2;
-    extent alias for $3;
-    tileWidth alias for $4;
-    tileHeight alias for $5;
-    rec tile;
-    scalex float8;
-    scaley float8;
-    ipx float8;
-    ipy float8;
-BEGIN
-       
-    -- compute some sizes
-    -- each tile extent width is extent.width / gridRows
-    scalex = ((ST_xmax(extent)-ST_xmin(extent))/gridCols)/tileWidth;
-    scaley = ((ST_ymax(extent)-ST_ymin(extent))/gridRows)/tileHeight;
-
-    FOR y IN 0..gridRows-1 LOOP
-        ipy = y*scaley + ST_ymin(extent);
-        FOR x IN 0..gridCols-1 LOOP
-            ipx = x*scalex + ST_xmin(extent);
-            rec.x = x;
-            rec.y = y;
-            rec.tile = st_MakeEmptyRaster(tileWidth, tileHeight, ipx, ipy,
-                                          scalex, scaley, 0, 0);
-            RETURN NEXT rec;
-        END LOOP;
-    END LOOP;
-
-    RETURN;
-END;
-'
-LANGUAGE 'plpgsql';
-
-CREATE TABLE rt_gist_grid_test AS 
-    SELECT * FROM makegrid(10, 10, 'BOX(-100 -100, 100 100)', 1, 1);
-
-CREATE TABLE rt_gist_query_test AS
-    SELECT * from makegrid(3, 3, 'BOX(-100 -100, 100 100)', 1, 1);
-
--------------------------------------------------------------------
--- raster_left
------------------------------------------------------------------------
-
-SELECT 'raster_left(X, query(1,1))' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND raster_left(a.tile, b.tile);
-
------------------------------------------------------------------------
--- Test << operator (left)
------------------------------------------------------------------------
-
-SELECT 'X << query(1,1)' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND a.tile << b.tile;
-
-DROP FUNCTION makegrid(integer,integer,box2d,integer,integer);
-DROP table rt_gist_grid_test;
-DROP table rt_gist_query_test;
-DROP type tile;
diff --git a/raster/test/regress/rt_left_expected b/raster/test/regress/rt_left_expected
deleted file mode 100644 (file)
index 9d48d73..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-raster_left(X, query(1,1))|30|0|2|0|9|BOX(-100 -100,-40 100)
-X << query(1,1)|30|0|2|0|9|BOX(-100 -100,-40 100)
diff --git a/raster/test/regress/rt_overabove.sql b/raster/test/regress/rt_overabove.sql
deleted file mode 100644 (file)
index 317de22..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
------------------------------------------------------------------------
--- $Id$
---
--- Copyright (c) 2009 Sandro Santilli <strk@keybit.net>
---
--- This is free software; you can redistribute and/or modify it under
--- the terms of the GNU General Public Licence. See the COPYING file.
------------------------------------------------------------------------
-
-CREATE TYPE tile AS (x int, y int, tile raster);
-CREATE OR REPLACE FUNCTION makegrid (int, int, box2d, int, int)
-    RETURNS SETOF tile
-AS
-'
-DECLARE
-    gridCols alias for $1;
-    gridRows alias for $2;
-    extent alias for $3;
-    tileWidth alias for $4;
-    tileHeight alias for $5;
-    rec tile;
-    scalex float8;
-    scaley float8;
-    ipx float8;
-    ipy float8;
-BEGIN
-       
-    -- compute some sizes
-    -- each tile extent width is extent.width / gridRows
-    scalex = ((ST_xmax(extent)-ST_xmin(extent))/gridCols)/tileWidth;
-    scaley = ((ST_ymax(extent)-ST_ymin(extent))/gridRows)/tileHeight;
-
-    FOR y IN 0..gridRows-1 LOOP
-        ipy = y*scaley + ST_ymin(extent);
-        FOR x IN 0..gridCols-1 LOOP
-            ipx = x*scalex + ST_xmin(extent);
-            rec.x = x;
-            rec.y = y;
-            rec.tile = st_MakeEmptyRaster(tileWidth, tileHeight, ipx, ipy,
-                                          scalex, scaley, 0, 0);
-            RETURN NEXT rec;
-        END LOOP;
-    END LOOP;
-
-    RETURN;
-END;
-'
-LANGUAGE 'plpgsql';
-
-CREATE TABLE rt_gist_grid_test AS 
-    SELECT * FROM makegrid(10, 10, 'BOX(-100 -100, 100 100)', 1, 1);
-
-CREATE TABLE rt_gist_query_test AS
-    SELECT * from makegrid(3, 3, 'BOX(-100 -100, 100 100)', 1, 1);
-
--------------------------------------------------------------------
--- raster_overabove
------------------------------------------------------------------------
-
-SELECT 'raster_overabove(X, query(1,1))' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND raster_overabove(a.tile, b.tile);
-
------------------------------------------------------------------------
--- Test |&> operator (overabove)
------------------------------------------------------------------------
-
-SELECT 'X |&> query(1,1)' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND a.tile |&> b.tile;
-
-DROP FUNCTION makegrid(integer,integer,box2d,integer,integer);
-DROP table rt_gist_grid_test;
-DROP table rt_gist_query_test;
-DROP type tile;
diff --git a/raster/test/regress/rt_overabove_expected b/raster/test/regress/rt_overabove_expected
deleted file mode 100644 (file)
index 3cf8d5e..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-raster_overabove(X, query(1,1))|60|0|9|4|9|BOX(-100 -20,100 100)
-X |&> query(1,1)|60|0|9|4|9|BOX(-100 -20,100 100)
diff --git a/raster/test/regress/rt_overbelow.sql b/raster/test/regress/rt_overbelow.sql
deleted file mode 100644 (file)
index 6a36158..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
------------------------------------------------------------------------
--- $Id$
---
--- Copyright (c) 2009 Sandro Santilli <strk@keybit.net>
---
--- This is free software; you can redistribute and/or modify it under
--- the terms of the GNU General Public Licence. See the COPYING file.
------------------------------------------------------------------------
-
-CREATE TYPE tile AS (x int, y int, tile raster);
-CREATE OR REPLACE FUNCTION makegrid (int, int, box2d, int, int)
-    RETURNS SETOF tile
-AS
-'
-DECLARE
-    gridCols alias for $1;
-    gridRows alias for $2;
-    extent alias for $3;
-    tileWidth alias for $4;
-    tileHeight alias for $5;
-    rec tile;
-    scalex float8;
-    scaley float8;
-    ipx float8;
-    ipy float8;
-BEGIN
-       
-    -- compute some sizes
-    -- each tile extent width is extent.width / gridRows
-    scalex = ((ST_xmax(extent)-ST_xmin(extent))/gridCols)/tileWidth;
-    scaley = ((ST_ymax(extent)-ST_ymin(extent))/gridRows)/tileHeight;
-
-    FOR y IN 0..gridRows-1 LOOP
-        ipy = y*scaley + ST_ymin(extent);
-        FOR x IN 0..gridCols-1 LOOP
-            ipx = x*scalex + ST_xmin(extent);
-            rec.x = x;
-            rec.y = y;
-            rec.tile = st_MakeEmptyRaster(tileWidth, tileHeight, ipx, ipy,
-                                          scalex, scaley, 0, 0);
-            RETURN NEXT rec;
-        END LOOP;
-    END LOOP;
-
-    RETURN;
-END;
-'
-LANGUAGE 'plpgsql';
-
-CREATE TABLE rt_gist_grid_test AS 
-    SELECT * FROM makegrid(10, 10, 'BOX(-100 -100, 100 100)', 1, 1);
-
-CREATE TABLE rt_gist_query_test AS
-    SELECT * from makegrid(3, 3, 'BOX(-100 -100, 100 100)', 1, 1);
-
--------------------------------------------------------------------
--- raster_overbelow
------------------------------------------------------------------------
-
-SELECT 'raster_overbelow(X, query(1,1))' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND raster_overbelow(a.tile, b.tile);
-
------------------------------------------------------------------------
--- Test &<| operator (overbelow)
------------------------------------------------------------------------
-
-SELECT 'X &<| query(1,1)' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND a.tile &<| b.tile;
-
-DROP FUNCTION makegrid(integer,integer,box2d,integer,integer);
-DROP table rt_gist_grid_test;
-DROP table rt_gist_query_test;
-DROP type tile;
-
diff --git a/raster/test/regress/rt_overbelow_expected b/raster/test/regress/rt_overbelow_expected
deleted file mode 100644 (file)
index 6096503..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-raster_overbelow(X, query(1,1))|60|0|9|0|5|BOX(-100 -100,100 20)
-X &<| query(1,1)|60|0|9|0|5|BOX(-100 -100,100 20)
diff --git a/raster/test/regress/rt_overlap.sql b/raster/test/regress/rt_overlap.sql
deleted file mode 100644 (file)
index 8cf0cee..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
------------------------------------------------------------------------
--- $Id$
---
--- Copyright (c) 2009 Sandro Santilli <strk@keybit.net>
---
--- This is free software; you can redistribute and/or modify it under
--- the terms of the GNU General Public Licence. See the COPYING file.
------------------------------------------------------------------------
-
-CREATE TYPE tile AS (x int, y int, tile raster);
-CREATE OR REPLACE FUNCTION makegrid (int, int, box2d, int, int)
-    RETURNS SETOF tile
-AS
-'
-DECLARE
-    gridCols alias for $1;
-    gridRows alias for $2;
-    extent alias for $3;
-    tileWidth alias for $4;
-    tileHeight alias for $5;
-    rec tile;
-    scalex float8;
-    scaley float8;
-    ipx float8;
-    ipy float8;
-BEGIN
-       
-    -- compute some sizes
-    -- each tile extent width is extent.width / gridRows
-    scalex = ((ST_xmax(extent)-ST_xmin(extent))/gridCols)/tileWidth;
-    scaley = ((ST_ymax(extent)-ST_ymin(extent))/gridRows)/tileHeight;
-
-    FOR y IN 0..gridRows-1 LOOP
-        ipy = y*scaley + ST_ymin(extent);
-        FOR x IN 0..gridCols-1 LOOP
-            ipx = x*scalex + ST_xmin(extent);
-            rec.x = x;
-            rec.y = y;
-            rec.tile = st_MakeEmptyRaster(tileWidth, tileHeight, ipx, ipy,
-                                          scalex, scaley, 0, 0);
-            RETURN NEXT rec;
-        END LOOP;
-    END LOOP;
-
-    RETURN;
-END;
-'
-LANGUAGE 'plpgsql';
-
-CREATE TABLE rt_gist_grid_test AS 
-    SELECT * FROM makegrid(10, 10, 'BOX(-100 -100, 100 100)', 1, 1);
-
-CREATE TABLE rt_gist_query_test AS
-    SELECT * from makegrid(3, 3, 'BOX(-100 -100, 100 100)', 1, 1);
-
--------------------------------------------------------------------
--- raster_overlap
------------------------------------------------------------------------
-
-SELECT 'raster_overlap(X, query(1,1))' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND raster_overlap(a.tile, b.tile);
-
--------------------------------------------------------------------
--- raster_geometry_overlap
------------------------------------------------------------------------
-
-SELECT 'raster_geometry_overlap(X, query(1,1))' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND raster_geometry_overlap(a.tile, b.tile::geometry);
-
--------------------------------------------------------------------
--- geometry_raster_overlap
------------------------------------------------------------------------
-
-SELECT 'geometry_raster_overlap(X, query(1,1))' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND geometry_raster_overlap(a.tile::geometry, b.tile);
-
------------------------------------------------------------------------
--- Test && operator (overlap)
------------------------------------------------------------------------
-
-SELECT 'X && query(1,1)' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND a.tile && b.tile;
-
------------------------------------------------------------------------
--- Test && operator (raster overlap geometry)
------------------------------------------------------------------------
-
-SELECT 'X && query(1,1)' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND a.tile && b.tile::geometry;
-
------------------------------------------------------------------------
--- Test && operator (geometry overlap raster)
------------------------------------------------------------------------
-
-SELECT 'X && query(1,1)' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND a.tile::geometry && b.tile;
-
-DROP FUNCTION makegrid(integer,integer,box2d,integer,integer);
-DROP table rt_gist_grid_test;
-DROP table rt_gist_query_test;
-DROP type tile;
diff --git a/raster/test/regress/rt_overlap_expected b/raster/test/regress/rt_overlap_expected
deleted file mode 100644 (file)
index bcc3f8b..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-raster_overlap(X, query(1,1))|16|3|6|3|6|BOX(-40 -40,40 40)
-raster_geometry_overlap(X, query(1,1))|16|3|6|3|6|BOX(-40 -40,40 40)
-geometry_raster_overlap(X, query(1,1))|16|3|6|3|6|BOX(-40 -40,40 40)
-X && query(1,1)|16|3|6|3|6|BOX(-40 -40,40 40)
-X && query(1,1)|16|3|6|3|6|BOX(-40 -40,40 40)
-X && query(1,1)|16|3|6|3|6|BOX(-40 -40,40 40)
diff --git a/raster/test/regress/rt_overleft.sql b/raster/test/regress/rt_overleft.sql
deleted file mode 100644 (file)
index 8a4c03a..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
------------------------------------------------------------------------
--- $Id$
---
--- Copyright (c) 2009 Sandro Santilli <strk@keybit.net>
---
--- This is free software; you can redistribute and/or modify it under
--- the terms of the GNU General Public Licence. See the COPYING file.
------------------------------------------------------------------------
-
-CREATE TYPE tile AS (x int, y int, tile raster);
-CREATE OR REPLACE FUNCTION makegrid (int, int, box2d, int, int)
-    RETURNS SETOF tile
-AS
-'
-DECLARE
-    gridCols alias for $1;
-    gridRows alias for $2;
-    extent alias for $3;
-    tileWidth alias for $4;
-    tileHeight alias for $5;
-    rec tile;
-    scalex float8;
-    scaley float8;
-    ipx float8;
-    ipy float8;
-BEGIN
-       
-    -- compute some sizes
-    -- each tile extent width is extent.width / gridRows
-    scalex = ((ST_xmax(extent)-ST_xmin(extent))/gridCols)/tileWidth;
-    scaley = ((ST_ymax(extent)-ST_ymin(extent))/gridRows)/tileHeight;
-
-    FOR y IN 0..gridRows-1 LOOP
-        ipy = y*scaley + ST_ymin(extent);
-        FOR x IN 0..gridCols-1 LOOP
-            ipx = x*scalex + ST_xmin(extent);
-            rec.x = x;
-            rec.y = y;
-            rec.tile = st_MakeEmptyRaster(tileWidth, tileHeight, ipx, ipy,
-                                          scalex, scaley, 0, 0);
-            RETURN NEXT rec;
-        END LOOP;
-    END LOOP;
-
-    RETURN;
-END;
-'
-LANGUAGE 'plpgsql';
-
-CREATE TABLE rt_gist_grid_test AS 
-    SELECT * FROM makegrid(10, 10, 'BOX(-100 -100, 100 100)', 1, 1);
-
-CREATE TABLE rt_gist_query_test AS
-    SELECT * from makegrid(3, 3, 'BOX(-100 -100, 100 100)', 1, 1);
-
------------------------------------------------------------------------
--- raster_overleft
------------------------------------------------------------------------
-
-SELECT 'raster_overleft(X, query(1,1))' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND raster_overleft(a.tile, b.tile);
-
------------------------------------------------------------------------
--- Test &< operator (overleft)
------------------------------------------------------------------------
-
-SELECT 'X &< query(1,1)' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND a.tile &< b.tile;
-
-DROP FUNCTION makegrid(integer,integer,box2d,integer,integer);
-DROP table rt_gist_grid_test;
-DROP table rt_gist_query_test;
-DROP type tile;
diff --git a/raster/test/regress/rt_overleft_expected b/raster/test/regress/rt_overleft_expected
deleted file mode 100644 (file)
index 9c27f22..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-raster_overleft(X, query(1,1))|60|0|5|0|9|BOX(-100 -100,20 100)
-X &< query(1,1)|60|0|5|0|9|BOX(-100 -100,20 100)
diff --git a/raster/test/regress/rt_overright.sql b/raster/test/regress/rt_overright.sql
deleted file mode 100644 (file)
index 9edce34..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
------------------------------------------------------------------------
--- $Id$
---
--- Copyright (c) 2009 Sandro Santilli <strk@keybit.net>
---
--- This is free software; you can redistribute and/or modify it under
--- the terms of the GNU General Public Licence. See the COPYING file.
------------------------------------------------------------------------
-
-CREATE TYPE tile AS (x int, y int, tile raster);
-CREATE OR REPLACE FUNCTION makegrid (int, int, box2d, int, int)
-    RETURNS SETOF tile
-AS
-'
-DECLARE
-    gridCols alias for $1;
-    gridRows alias for $2;
-    extent alias for $3;
-    tileWidth alias for $4;
-    tileHeight alias for $5;
-    rec tile;
-    scalex float8;
-    scaley float8;
-    ipx float8;
-    ipy float8;
-BEGIN
-       
-    -- compute some sizes
-    -- each tile extent width is extent.width / gridRows
-    scalex = ((ST_xmax(extent)-ST_xmin(extent))/gridCols)/tileWidth;
-    scaley = ((ST_ymax(extent)-ST_ymin(extent))/gridRows)/tileHeight;
-
-    FOR y IN 0..gridRows-1 LOOP
-        ipy = y*scaley + ST_ymin(extent);
-        FOR x IN 0..gridCols-1 LOOP
-            ipx = x*scalex + ST_xmin(extent);
-            rec.x = x;
-            rec.y = y;
-            rec.tile = st_MakeEmptyRaster(tileWidth, tileHeight, ipx, ipy,
-                                          scalex, scaley, 0, 0);
-            RETURN NEXT rec;
-        END LOOP;
-    END LOOP;
-
-    RETURN;
-END;
-'
-LANGUAGE 'plpgsql';
-
-CREATE TABLE rt_gist_grid_test AS 
-    SELECT * FROM makegrid(10, 10, 'BOX(-100 -100, 100 100)', 1, 1);
-
-CREATE TABLE rt_gist_query_test AS
-    SELECT * from makegrid(3, 3, 'BOX(-100 -100, 100 100)', 1, 1);
-
------------------------------------------------------------------------
--- raster_overright
------------------------------------------------------------------------
-SELECT 'raster_overright(X, query(1,1))' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND raster_overright(a.tile, b.tile);
-
------------------------------------------------------------------------
--- Test &> operator (overright)
------------------------------------------------------------------------
-
-SELECT 'X &> query(1,1)' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND a.tile &> b.tile;
-
-DROP FUNCTION makegrid(integer,integer,box2d,integer,integer);
-DROP table rt_gist_grid_test;
-DROP table rt_gist_query_test;
-DROP type tile;
diff --git a/raster/test/regress/rt_overright_expected b/raster/test/regress/rt_overright_expected
deleted file mode 100644 (file)
index 8ca465c..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-raster_overright(X, query(1,1))|60|4|9|0|9|BOX(-20 -100,100 100)
-X &> query(1,1)|60|4|9|0|9|BOX(-20 -100,100 100)
diff --git a/raster/test/regress/rt_right.sql b/raster/test/regress/rt_right.sql
deleted file mode 100644 (file)
index 2c1d2bf..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
------------------------------------------------------------------------
--- $Id$
---
--- Copyright (c) 2009 Sandro Santilli <strk@keybit.net>
---
--- This is free software; you can redistribute and/or modify it under
--- the terms of the GNU General Public Licence. See the COPYING file.
------------------------------------------------------------------------
-
-CREATE TYPE tile AS (x int, y int, tile raster);
-CREATE OR REPLACE FUNCTION makegrid (int, int, box2d, int, int)
-    RETURNS SETOF tile
-AS
-'
-DECLARE
-    gridCols alias for $1;
-    gridRows alias for $2;
-    extent alias for $3;
-    tileWidth alias for $4;
-    tileHeight alias for $5;
-    rec tile;
-    scalex float8;
-    scaley float8;
-    ipx float8;
-    ipy float8;
-BEGIN
-       
-    -- compute some sizes
-    -- each tile extent width is extent.width / gridRows
-    scalex = ((ST_xmax(extent)-ST_xmin(extent))/gridCols)/tileWidth;
-    scaley = ((ST_ymax(extent)-ST_ymin(extent))/gridRows)/tileHeight;
-
-    FOR y IN 0..gridRows-1 LOOP
-        ipy = y*scaley + ST_ymin(extent);
-        FOR x IN 0..gridCols-1 LOOP
-            ipx = x*scalex + ST_xmin(extent);
-            rec.x = x;
-            rec.y = y;
-            rec.tile = st_MakeEmptyRaster(tileWidth, tileHeight, ipx, ipy,
-                                          scalex, scaley, 0, 0);
-            RETURN NEXT rec;
-        END LOOP;
-    END LOOP;
-
-    RETURN;
-END;
-'
-LANGUAGE 'plpgsql';
-
-CREATE TABLE rt_gist_grid_test AS 
-    SELECT * FROM makegrid(10, 10, 'BOX(-100 -100, 100 100)', 1, 1);
-
-CREATE TABLE rt_gist_query_test AS
-    SELECT * from makegrid(3, 3, 'BOX(-100 -100, 100 100)', 1, 1);
-
--------------------------------------------------------------------
--- raster_right
------------------------------------------------------------------------
-
-SELECT 'raster_right(X, query(1,1))' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND raster_right(a.tile, b.tile);
-
------------------------------------------------------------------------
--- Test >> operator (right)
------------------------------------------------------------------------
-
-SELECT 'X >> query(1,1)' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND a.tile >> b.tile;
-
-DROP FUNCTION makegrid(integer,integer,box2d,integer,integer);
-DROP table rt_gist_grid_test;
-DROP table rt_gist_query_test;
-DROP type tile;
diff --git a/raster/test/regress/rt_right_expected b/raster/test/regress/rt_right_expected
deleted file mode 100644 (file)
index bba65fc..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-raster_right(X, query(1,1))|30|7|9|0|9|BOX(40 -100,100 100)
-X >> query(1,1)|30|7|9|0|9|BOX(40 -100,100 100)
diff --git a/raster/test/regress/rt_same.sql b/raster/test/regress/rt_same.sql
deleted file mode 100644 (file)
index abe8455..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
------------------------------------------------------------------------
--- $Id$
---
--- Copyright (c) 2009 Sandro Santilli <strk@keybit.net>
---
--- This is free software; you can redistribute and/or modify it under
--- the terms of the GNU General Public Licence. See the COPYING file.
------------------------------------------------------------------------
-
-CREATE TYPE tile AS (x int, y int, tile raster);
-CREATE OR REPLACE FUNCTION makegrid (int, int, box2d, int, int)
-    RETURNS SETOF tile
-AS
-'
-DECLARE
-    gridCols alias for $1;
-    gridRows alias for $2;
-    extent alias for $3;
-    tileWidth alias for $4;
-    tileHeight alias for $5;
-    rec tile;
-    scalex float8;
-    scaley float8;
-    ipx float8;
-    ipy float8;
-BEGIN
-       
-    -- compute some sizes
-    -- each tile extent width is extent.width / gridRows
-    scalex = ((ST_xmax(extent)-ST_xmin(extent))/gridCols)/tileWidth;
-    scaley = ((ST_ymax(extent)-ST_ymin(extent))/gridRows)/tileHeight;
-
-    FOR y IN 0..gridRows-1 LOOP
-        ipy = y*scaley + ST_ymin(extent);
-        FOR x IN 0..gridCols-1 LOOP
-            ipx = x*scalex + ST_xmin(extent);
-            rec.x = x;
-            rec.y = y;
-            rec.tile = st_MakeEmptyRaster(tileWidth, tileHeight, ipx, ipy,
-                                          scalex, scaley, 0, 0);
-            RETURN NEXT rec;
-        END LOOP;
-    END LOOP;
-
-    RETURN;
-END;
-'
-LANGUAGE 'plpgsql';
-
-CREATE TABLE rt_gist_grid_test AS 
-    SELECT * FROM makegrid(10, 10, 'BOX(-100 -100, 100 100)', 1, 1);
-
-CREATE TABLE rt_gist_query_test AS
-    SELECT * from makegrid(3, 3, 'BOX(-100 -100, 100 100)', 1, 1);
-
--------------------------------------------------------------------
--- raster_same
------------------------------------------------------------------------
-
-SELECT 'raster_same(X, query(1,1))' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND raster_same(a.tile, b.tile);
-
-SELECT 'raster_same(X, query(7,7))' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_grid_test b
-WHERE b.x = 7 and b.y = 7
-    AND raster_same(a.tile, b.tile);
-
------------------------------------------------------------------------
--- Test ~= operator (same)
------------------------------------------------------------------------
-
-SELECT 'X ~= query(1,1)' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_query_test b
-WHERE b.x = 1 and b.y = 1
-    AND a.tile ~= b.tile;
-
-SELECT 'X ~= tile(7,7)' as op,
-        count(a.y),
-        min(a.x) as xmin,
-        max(a.x) as xmax,
-        min(a.y) as ymin,
-        max(a.y) as ymax,
-        st_extent(a.tile::geometry)
-FROM rt_gist_grid_test a, rt_gist_grid_test b
-WHERE b.x = 7 and b.y = 7
-    AND a.tile ~= b.tile;
-
-DROP FUNCTION makegrid(integer,integer,box2d,integer,integer);
-DROP table rt_gist_grid_test;
-DROP table rt_gist_query_test;
-DROP type tile;
diff --git a/raster/test/regress/rt_same_expected b/raster/test/regress/rt_same_expected
deleted file mode 100644 (file)
index f342fc7..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-raster_same(X, query(1,1))|0|||||
-raster_same(X, query(7,7))|1|7|7|7|7|BOX(40 40,60 60)
-X ~= query(1,1)|0|||||
-X ~= tile(7,7)|1|7|7|7|7|BOX(40 40,60 60)