]> granicus.if.org Git - postgis/commitdiff
Added news and docs for ST_Tile(raster). Additional regression tests for
authorBborie Park <bkpark at ucdavis.edu>
Tue, 23 Oct 2012 22:44:52 +0000 (22:44 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Tue, 23 Oct 2012 22:44:52 +0000 (22:44 +0000)
one additional variant of ST_Tile(raster)

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

NEWS
doc/reference_raster.xml
raster/rt_pg/rtpostgis.sql.in.c
raster/test/regress/rt_tile.sql
raster/test/regress/rt_tile_expected

diff --git a/NEWS b/NEWS
index 78d34eca98612afe9dc67befa5aff155416563f2..b7b2754ddc532a56930e2ae414ec9266fe6985d2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -41,6 +41,7 @@ PostGIS 2.1.0
   - Added geomval array variant of ST_SetValues() to set many pixel values of
     a band using a set of geometries and corresponding values in one call
     (Bborie Park / UC Davis)
+  - ST_Tile(raster) to break up a raster into tiles (Bborie Park / UC Davis)
 
 * Enhancements *
   - #823,  tiger geocoder: Make loader_generate_script download portion 
index 8e88747d290019bb63f4dd1f0ee905098d66fdae..f5299e7e1e18f7e86079b38faf43ed0d1f5a5915 100644 (file)
@@ -1491,6 +1491,7 @@ WHERE rid=35;
                                <para><xref linkend="RT_ST_AddBand" />, <xref linkend="RT_ST_NumBands" />, , <xref linkend="RT_ST_Reclass" /></para>
                        </refsection>
                </refentry>
+
                <refentry id="RT_ST_MakeEmptyRaster">
                        <refnamediv>
                                <refname>ST_MakeEmptyRaster</refname>
@@ -1571,6 +1572,140 @@ FROM (SELECT rid, ST_MetaData(rast) As md
                                <para><xref linkend="RT_ST_AddBand" />, <xref linkend="RT_ST_MetaData" />, <xref linkend="RT_ST_ScaleX" />, <xref linkend="RT_ST_ScaleY" />, <xref linkend="RT_ST_SetValue" />, <xref linkend="RT_ST_SkewX" />, , <xref linkend="RT_ST_SkewY" /></para>
                        </refsection>
                </refentry>
+
+               <refentry id="RT_ST_Tile">
+
+                       <refnamediv>
+                               <refname>ST_Tile</refname>
+                               <refpurpose>Returns a set of rasters resulting from the split of the input raster based upon the desired dimensions of the output rasters.</refpurpose>
+                       </refnamediv>
+
+                       <refsynopsisdiv>
+                               <funcsynopsis>
+                                       <funcprototype>
+                                               <funcdef>text <function>ST_Tile</function></funcdef>
+                                               <paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
+                                               <paramdef><type>integer </type> <parameter>width</parameter></paramdef>
+                                               <paramdef><type>integer </type> <parameter>height</parameter></paramdef>
+                                               <paramdef choice="opt"><type>int[] </type> <parameter>nband=NULL</parameter></paramdef>
+                                       </funcprototype>
+
+                                       <funcprototype>
+                                               <funcdef>text <function>ST_Tile</function></funcdef>
+                                               <paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
+                                               <paramdef><type>integer </type> <parameter>width</parameter></paramdef>
+                                               <paramdef><type>integer </type> <parameter>height</parameter></paramdef>
+                                               <paramdef><type>int </type> <parameter>nband</parameter></paramdef>
+                                       </funcprototype>
+
+                               </funcsynopsis>
+                       </refsynopsisdiv>
+
+                       <refsection>
+                               <title>Description</title>
+
+                               <para>
+                                       Returns a set of rasters resulting from the split of the input raster based upon the desired dimensions of the output rasters.
+                               </para>
+
+                               <para>Availability: 2.1.0</para>
+                       </refsection>
+
+                       <refsection>
+                               <title>Examples</title>
+
+                               <programlisting>
+WITH foo AS (
+       SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 0, 0, 1, -1, 0, 0, 0), 1, '8BUI', 1, 0), 2, '8BUI', 10, 0) AS rast UNION ALL
+       SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 3, 0, 1, -1, 0, 0, 0), 1, '8BUI', 2, 0), 2, '8BUI', 20, 0) AS rast UNION ALL
+       SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 6, 0, 1, -1, 0, 0, 0), 1, '8BUI', 3, 0), 2, '8BUI', 30, 0) AS rast UNION ALL
+
+       SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 0, -3, 1, -1, 0, 0, 0), 1, '8BUI', 4, 0), 2, '8BUI', 40, 0) AS rast UNION ALL
+       SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 3, -3, 1, -1, 0, 0, 0), 1, '8BUI', 5, 0), 2, '8BUI', 50, 0) AS rast UNION ALL
+       SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 6, -3, 1, -1, 0, 0, 0), 1, '8BUI', 6, 0), 2, '8BUI', 60, 0) AS rast UNION ALL
+
+       SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 0, -6, 1, -1, 0, 0, 0), 1, '8BUI', 7, 0), 2, '8BUI', 70, 0) AS rast UNION ALL
+       SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 3, -6, 1, -1, 0, 0, 0), 1, '8BUI', 8, 0), 2, '8BUI', 80, 0) AS rast UNION ALL
+       SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 6, -6, 1, -1, 0, 0, 0), 1, '8BUI', 9, 0), 2, '8BUI', 90, 0) AS rast
+), bar AS (
+       SELECT ST_Union(rast) AS rast FROM foo
+), baz AS (
+       SELECT ST_Tile(rast, 3, 3) AS rast FROM bar
+)
+SELECT
+       ST_DumpValues(rast)
+FROM baz;
+
+              st_dumpvalues               
+------------------------------------------
+ (1,"{{1,1,1},{1,1,1},{1,1,1}}")
+ (2,"{{10,10,10},{10,10,10},{10,10,10}}")
+ (1,"{{2,2,2},{2,2,2},{2,2,2}}")
+ (2,"{{20,20,20},{20,20,20},{20,20,20}}")
+ (1,"{{3,3,3},{3,3,3},{3,3,3}}")
+ (2,"{{30,30,30},{30,30,30},{30,30,30}}")
+ (1,"{{4,4,4},{4,4,4},{4,4,4}}")
+ (2,"{{40,40,40},{40,40,40},{40,40,40}}")
+ (1,"{{5,5,5},{5,5,5},{5,5,5}}")
+ (2,"{{50,50,50},{50,50,50},{50,50,50}}")
+ (1,"{{6,6,6},{6,6,6},{6,6,6}}")
+ (2,"{{60,60,60},{60,60,60},{60,60,60}}")
+ (1,"{{7,7,7},{7,7,7},{7,7,7}}")
+ (2,"{{70,70,70},{70,70,70},{70,70,70}}")
+ (1,"{{8,8,8},{8,8,8},{8,8,8}}")
+ (2,"{{80,80,80},{80,80,80},{80,80,80}}")
+ (1,"{{9,9,9},{9,9,9},{9,9,9}}")
+ (2,"{{90,90,90},{90,90,90},{90,90,90}}")
+(18 rows)
+                               </programlisting>
+
+                               <programlisting>
+WITH foo AS (
+       SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 0, 0, 1, -1, 0, 0, 0), 1, '8BUI', 1, 0), 2, '8BUI', 10, 0) AS rast UNION ALL
+       SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 3, 0, 1, -1, 0, 0, 0), 1, '8BUI', 2, 0), 2, '8BUI', 20, 0) AS rast UNION ALL
+       SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 6, 0, 1, -1, 0, 0, 0), 1, '8BUI', 3, 0), 2, '8BUI', 30, 0) AS rast UNION ALL
+
+       SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 0, -3, 1, -1, 0, 0, 0), 1, '8BUI', 4, 0), 2, '8BUI', 40, 0) AS rast UNION ALL
+       SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 3, -3, 1, -1, 0, 0, 0), 1, '8BUI', 5, 0), 2, '8BUI', 50, 0) AS rast UNION ALL
+       SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 6, -3, 1, -1, 0, 0, 0), 1, '8BUI', 6, 0), 2, '8BUI', 60, 0) AS rast UNION ALL
+
+       SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 0, -6, 1, -1, 0, 0, 0), 1, '8BUI', 7, 0), 2, '8BUI', 70, 0) AS rast UNION ALL
+       SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 3, -6, 1, -1, 0, 0, 0), 1, '8BUI', 8, 0), 2, '8BUI', 80, 0) AS rast UNION ALL
+       SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 6, -6, 1, -1, 0, 0, 0), 1, '8BUI', 9, 0), 2, '8BUI', 90, 0) AS rast
+), bar AS (
+       SELECT ST_Union(rast) AS rast FROM foo
+), baz AS (
+       SELECT ST_Tile(rast, 3, 3, 2) AS rast FROM bar
+)
+SELECT
+       ST_DumpValues(rast)
+FROM baz;
+
+              st_dumpvalues               
+------------------------------------------
+ (1,"{{10,10,10},{10,10,10},{10,10,10}}")
+ (1,"{{20,20,20},{20,20,20},{20,20,20}}")
+ (1,"{{30,30,30},{30,30,30},{30,30,30}}")
+ (1,"{{40,40,40},{40,40,40},{40,40,40}}")
+ (1,"{{50,50,50},{50,50,50},{50,50,50}}")
+ (1,"{{60,60,60},{60,60,60},{60,60,60}}")
+ (1,"{{70,70,70},{70,70,70},{70,70,70}}")
+ (1,"{{80,80,80},{80,80,80},{80,80,80}}")
+ (1,"{{90,90,90},{90,90,90},{90,90,90}}")
+(9 rows)
+                               </programlisting>
+
+                       </refsection>
+
+                       <refsection>
+                               <title>See Also</title>
+                               <para>
+                                       <xref linkend="RT_ST_Union" />
+                               </para>
+                       </refsection>
+
+               </refentry>
+
        </sect1>
        <sect1 id="Raster_Accessors">
                <title>Raster Accessors</title>
index 6ca25c00fdc28efcffd78d26f60c8766bd023ff2..3e899e13a15437733e5a3b91d6ff3cff7fc153e1 100644 (file)
@@ -3975,6 +3975,15 @@ CREATE OR REPLACE FUNCTION st_tile(
        AS 'MODULE_PATHNAME','RASTER_tile'
        LANGUAGE 'c' IMMUTABLE;
 
+CREATE OR REPLACE FUNCTION st_tile(
+       rast raster,
+       width integer, height integer,
+       nband int
+)
+       RETURNS SETOF raster
+       AS $$ SELECT st_tile($1, $2, $3, ARRAY[$4]::int[]) $$
+       LANGUAGE 'sql' IMMUTABLE;
+
 -----------------------------------------------------------------------
 -- Raster Band Editors
 -----------------------------------------------------------------------
index 0e6117d3a40b9dfea39f07bd4a13535506dac3fb..7c86c638f9b76a24cf09f8f288092f2747260efe 100644 (file)
@@ -19,35 +19,49 @@ WITH foo AS (
        SELECT ST_Tile(rast, 3, 3) AS rast FROM raster_tile
 )
 SELECT
-       ST_DumpValues(rast)
+       1, ST_DumpValues(rast)
 FROM foo;
 
 WITH foo AS (
        SELECT ST_Tile(rast, 3, 3, ARRAY[1]) AS rast FROM raster_tile
 )
 SELECT
-       ST_DumpValues(rast)
+       2, ST_DumpValues(rast)
+FROM foo;
+
+WITH foo AS (
+       SELECT ST_Tile(rast, 3, 3, ARRAY[2, 1]) AS rast FROM raster_tile
+)
+SELECT
+       3, ST_DumpValues(rast)
+FROM foo;
+
+WITH foo AS (
+       SELECT ST_Tile(rast, 3, 3, 2) AS rast FROM raster_tile
+)
+SELECT
+       4, ST_DumpValues(rast)
 FROM foo;
 
 WITH foo AS (
        SELECT ST_Tile(rast, 2, 2) AS rast FROM raster_tile
 )
 SELECT
-       ST_DumpValues(rast)
+       5, ST_DumpValues(rast)
 FROM foo;
 
 WITH foo AS (
        SELECT ST_Tile(rast, 1, 1) AS rast FROM raster_tile
 )
 SELECT
-       ST_DumpValues(rast)
+       6, ST_DumpValues(rast)
 FROM foo;
 
 WITH foo AS (
        SELECT ST_Tile(rast, 5, 5) AS rast FROM raster_tile
 )
 SELECT
-       ST_DumpValues(rast)
+       7, ST_DumpValues(rast)
 FROM foo;
 
 DROP TABLE IF EXISTS raster_tile;
index 9cbc538d27086b6af8a73ed7a7833e5c72566552..2c04bca53ca1d25314d7f6b4f9d345ea3c3afd84 100644 (file)
 NOTICE:  table "raster_tile" does not exist, skipping
-(1,"{{1,1,1},{1,1,1},{1,1,1}}")
-(2,"{{10,10,10},{10,10,10},{10,10,10}}")
-(1,"{{2,2,2},{2,2,2},{2,2,2}}")
-(2,"{{20,20,20},{20,20,20},{20,20,20}}")
-(1,"{{3,3,3},{3,3,3},{3,3,3}}")
-(2,"{{30,30,30},{30,30,30},{30,30,30}}")
-(1,"{{4,4,4},{4,4,4},{4,4,4}}")
-(2,"{{40,40,40},{40,40,40},{40,40,40}}")
-(1,"{{5,5,5},{5,5,5},{5,5,5}}")
-(2,"{{50,50,50},{50,50,50},{50,50,50}}")
-(1,"{{6,6,6},{6,6,6},{6,6,6}}")
-(2,"{{60,60,60},{60,60,60},{60,60,60}}")
-(1,"{{7,7,7},{7,7,7},{7,7,7}}")
-(2,"{{70,70,70},{70,70,70},{70,70,70}}")
-(1,"{{8,8,8},{8,8,8},{8,8,8}}")
-(2,"{{80,80,80},{80,80,80},{80,80,80}}")
-(1,"{{9,9,9},{9,9,9},{9,9,9}}")
-(2,"{{90,90,90},{90,90,90},{90,90,90}}")
-(1,"{{1,1,1},{1,1,1},{1,1,1}}")
-(1,"{{2,2,2},{2,2,2},{2,2,2}}")
-(1,"{{3,3,3},{3,3,3},{3,3,3}}")
-(1,"{{4,4,4},{4,4,4},{4,4,4}}")
-(1,"{{5,5,5},{5,5,5},{5,5,5}}")
-(1,"{{6,6,6},{6,6,6},{6,6,6}}")
-(1,"{{7,7,7},{7,7,7},{7,7,7}}")
-(1,"{{8,8,8},{8,8,8},{8,8,8}}")
-(1,"{{9,9,9},{9,9,9},{9,9,9}}")
-(1,"{{1,1},{1,1}}")
-(2,"{{10,10},{10,10}}")
-(1,"{{1,2},{1,2}}")
-(2,"{{10,20},{10,20}}")
-(1,"{{2,2},{2,2}}")
-(2,"{{20,20},{20,20}}")
-(1,"{{3,3},{3,3}}")
-(2,"{{30,30},{30,30}}")
-(1,"{{3,NULL},{3,NULL}}")
-(2,"{{30,NULL},{30,NULL}}")
-(1,"{{1,1},{4,4}}")
-(2,"{{10,10},{40,40}}")
-(1,"{{1,2},{4,5}}")
-(2,"{{10,20},{40,50}}")
-(1,"{{2,2},{5,5}}")
-(2,"{{20,20},{50,50}}")
-(1,"{{3,3},{6,6}}")
-(2,"{{30,30},{60,60}}")
-(1,"{{3,NULL},{6,NULL}}")
-(2,"{{30,NULL},{60,NULL}}")
-(1,"{{4,4},{4,4}}")
-(2,"{{40,40},{40,40}}")
-(1,"{{4,5},{4,5}}")
-(2,"{{40,50},{40,50}}")
-(1,"{{5,5},{5,5}}")
-(2,"{{50,50},{50,50}}")
-(1,"{{6,6},{6,6}}")
-(2,"{{60,60},{60,60}}")
-(1,"{{6,NULL},{6,NULL}}")
-(2,"{{60,NULL},{60,NULL}}")
-(1,"{{7,7},{7,7}}")
-(2,"{{70,70},{70,70}}")
-(1,"{{7,8},{7,8}}")
-(2,"{{70,80},{70,80}}")
-(1,"{{8,8},{8,8}}")
-(2,"{{80,80},{80,80}}")
-(1,"{{9,9},{9,9}}")
-(2,"{{90,90},{90,90}}")
-(1,"{{9,NULL},{9,NULL}}")
-(2,"{{90,NULL},{90,NULL}}")
-(1,"{{7,7},{NULL,NULL}}")
-(2,"{{70,70},{NULL,NULL}}")
-(1,"{{7,8},{NULL,NULL}}")
-(2,"{{70,80},{NULL,NULL}}")
-(1,"{{8,8},{NULL,NULL}}")
-(2,"{{80,80},{NULL,NULL}}")
-(1,"{{9,9},{NULL,NULL}}")
-(2,"{{90,90},{NULL,NULL}}")
-(1,"{{9,NULL},{NULL,NULL}}")
-(2,"{{90,NULL},{NULL,NULL}}")
-(1,{{1}})
-(2,{{10}})
-(1,{{1}})
-(2,{{10}})
-(1,{{1}})
-(2,{{10}})
-(1,{{2}})
-(2,{{20}})
-(1,{{2}})
-(2,{{20}})
-(1,{{2}})
-(2,{{20}})
-(1,{{3}})
-(2,{{30}})
-(1,{{3}})
-(2,{{30}})
-(1,{{3}})
-(2,{{30}})
-(1,{{1}})
-(2,{{10}})
-(1,{{1}})
-(2,{{10}})
-(1,{{1}})
-(2,{{10}})
-(1,{{2}})
-(2,{{20}})
-(1,{{2}})
-(2,{{20}})
-(1,{{2}})
-(2,{{20}})
-(1,{{3}})
-(2,{{30}})
-(1,{{3}})
-(2,{{30}})
-(1,{{3}})
-(2,{{30}})
-(1,{{1}})
-(2,{{10}})
-(1,{{1}})
-(2,{{10}})
-(1,{{1}})
-(2,{{10}})
-(1,{{2}})
-(2,{{20}})
-(1,{{2}})
-(2,{{20}})
-(1,{{2}})
-(2,{{20}})
-(1,{{3}})
-(2,{{30}})
-(1,{{3}})
-(2,{{30}})
-(1,{{3}})
-(2,{{30}})
-(1,{{4}})
-(2,{{40}})
-(1,{{4}})
-(2,{{40}})
-(1,{{4}})
-(2,{{40}})
-(1,{{5}})
-(2,{{50}})
-(1,{{5}})
-(2,{{50}})
-(1,{{5}})
-(2,{{50}})
-(1,{{6}})
-(2,{{60}})
-(1,{{6}})
-(2,{{60}})
-(1,{{6}})
-(2,{{60}})
-(1,{{4}})
-(2,{{40}})
-(1,{{4}})
-(2,{{40}})
-(1,{{4}})
-(2,{{40}})
-(1,{{5}})
-(2,{{50}})
-(1,{{5}})
-(2,{{50}})
-(1,{{5}})
-(2,{{50}})
-(1,{{6}})
-(2,{{60}})
-(1,{{6}})
-(2,{{60}})
-(1,{{6}})
-(2,{{60}})
-(1,{{4}})
-(2,{{40}})
-(1,{{4}})
-(2,{{40}})
-(1,{{4}})
-(2,{{40}})
-(1,{{5}})
-(2,{{50}})
-(1,{{5}})
-(2,{{50}})
-(1,{{5}})
-(2,{{50}})
-(1,{{6}})
-(2,{{60}})
-(1,{{6}})
-(2,{{60}})
-(1,{{6}})
-(2,{{60}})
-(1,{{7}})
-(2,{{70}})
-(1,{{7}})
-(2,{{70}})
-(1,{{7}})
-(2,{{70}})
-(1,{{8}})
-(2,{{80}})
-(1,{{8}})
-(2,{{80}})
-(1,{{8}})
-(2,{{80}})
-(1,{{9}})
-(2,{{90}})
-(1,{{9}})
-(2,{{90}})
-(1,{{9}})
-(2,{{90}})
-(1,{{7}})
-(2,{{70}})
-(1,{{7}})
-(2,{{70}})
-(1,{{7}})
-(2,{{70}})
-(1,{{8}})
-(2,{{80}})
-(1,{{8}})
-(2,{{80}})
-(1,{{8}})
-(2,{{80}})
-(1,{{9}})
-(2,{{90}})
-(1,{{9}})
-(2,{{90}})
-(1,{{9}})
-(2,{{90}})
-(1,{{7}})
-(2,{{70}})
-(1,{{7}})
-(2,{{70}})
-(1,{{7}})
-(2,{{70}})
-(1,{{8}})
-(2,{{80}})
-(1,{{8}})
-(2,{{80}})
-(1,{{8}})
-(2,{{80}})
-(1,{{9}})
-(2,{{90}})
-(1,{{9}})
-(2,{{90}})
-(1,{{9}})
-(2,{{90}})
-(1,"{{1,1,1,2,2},{1,1,1,2,2},{1,1,1,2,2},{4,4,4,5,5},{4,4,4,5,5}}")
-(2,"{{10,10,10,20,20},{10,10,10,20,20},{10,10,10,20,20},{40,40,40,50,50},{40,40,40,50,50}}")
-(1,"{{2,3,3,3,NULL},{2,3,3,3,NULL},{2,3,3,3,NULL},{5,6,6,6,NULL},{5,6,6,6,NULL}}")
-(2,"{{20,30,30,30,NULL},{20,30,30,30,NULL},{20,30,30,30,NULL},{50,60,60,60,NULL},{50,60,60,60,NULL}}")
-(1,"{{4,4,4,5,5},{7,7,7,8,8},{7,7,7,8,8},{7,7,7,8,8},{NULL,NULL,NULL,NULL,NULL}}")
-(2,"{{40,40,40,50,50},{70,70,70,80,80},{70,70,70,80,80},{70,70,70,80,80},{NULL,NULL,NULL,NULL,NULL}}")
-(1,"{{5,6,6,6,NULL},{8,9,9,9,NULL},{8,9,9,9,NULL},{8,9,9,9,NULL},{NULL,NULL,NULL,NULL,NULL}}")
-(2,"{{50,60,60,60,NULL},{80,90,90,90,NULL},{80,90,90,90,NULL},{80,90,90,90,NULL},{NULL,NULL,NULL,NULL,NULL}}")
+1|(1,"{{1,1,1},{1,1,1},{1,1,1}}")
+1|(2,"{{10,10,10},{10,10,10},{10,10,10}}")
+1|(1,"{{2,2,2},{2,2,2},{2,2,2}}")
+1|(2,"{{20,20,20},{20,20,20},{20,20,20}}")
+1|(1,"{{3,3,3},{3,3,3},{3,3,3}}")
+1|(2,"{{30,30,30},{30,30,30},{30,30,30}}")
+1|(1,"{{4,4,4},{4,4,4},{4,4,4}}")
+1|(2,"{{40,40,40},{40,40,40},{40,40,40}}")
+1|(1,"{{5,5,5},{5,5,5},{5,5,5}}")
+1|(2,"{{50,50,50},{50,50,50},{50,50,50}}")
+1|(1,"{{6,6,6},{6,6,6},{6,6,6}}")
+1|(2,"{{60,60,60},{60,60,60},{60,60,60}}")
+1|(1,"{{7,7,7},{7,7,7},{7,7,7}}")
+1|(2,"{{70,70,70},{70,70,70},{70,70,70}}")
+1|(1,"{{8,8,8},{8,8,8},{8,8,8}}")
+1|(2,"{{80,80,80},{80,80,80},{80,80,80}}")
+1|(1,"{{9,9,9},{9,9,9},{9,9,9}}")
+1|(2,"{{90,90,90},{90,90,90},{90,90,90}}")
+2|(1,"{{1,1,1},{1,1,1},{1,1,1}}")
+2|(1,"{{2,2,2},{2,2,2},{2,2,2}}")
+2|(1,"{{3,3,3},{3,3,3},{3,3,3}}")
+2|(1,"{{4,4,4},{4,4,4},{4,4,4}}")
+2|(1,"{{5,5,5},{5,5,5},{5,5,5}}")
+2|(1,"{{6,6,6},{6,6,6},{6,6,6}}")
+2|(1,"{{7,7,7},{7,7,7},{7,7,7}}")
+2|(1,"{{8,8,8},{8,8,8},{8,8,8}}")
+2|(1,"{{9,9,9},{9,9,9},{9,9,9}}")
+3|(1,"{{10,10,10},{10,10,10},{10,10,10}}")
+3|(2,"{{1,1,1},{1,1,1},{1,1,1}}")
+3|(1,"{{20,20,20},{20,20,20},{20,20,20}}")
+3|(2,"{{2,2,2},{2,2,2},{2,2,2}}")
+3|(1,"{{30,30,30},{30,30,30},{30,30,30}}")
+3|(2,"{{3,3,3},{3,3,3},{3,3,3}}")
+3|(1,"{{40,40,40},{40,40,40},{40,40,40}}")
+3|(2,"{{4,4,4},{4,4,4},{4,4,4}}")
+3|(1,"{{50,50,50},{50,50,50},{50,50,50}}")
+3|(2,"{{5,5,5},{5,5,5},{5,5,5}}")
+3|(1,"{{60,60,60},{60,60,60},{60,60,60}}")
+3|(2,"{{6,6,6},{6,6,6},{6,6,6}}")
+3|(1,"{{70,70,70},{70,70,70},{70,70,70}}")
+3|(2,"{{7,7,7},{7,7,7},{7,7,7}}")
+3|(1,"{{80,80,80},{80,80,80},{80,80,80}}")
+3|(2,"{{8,8,8},{8,8,8},{8,8,8}}")
+3|(1,"{{90,90,90},{90,90,90},{90,90,90}}")
+3|(2,"{{9,9,9},{9,9,9},{9,9,9}}")
+4|(1,"{{10,10,10},{10,10,10},{10,10,10}}")
+4|(1,"{{20,20,20},{20,20,20},{20,20,20}}")
+4|(1,"{{30,30,30},{30,30,30},{30,30,30}}")
+4|(1,"{{40,40,40},{40,40,40},{40,40,40}}")
+4|(1,"{{50,50,50},{50,50,50},{50,50,50}}")
+4|(1,"{{60,60,60},{60,60,60},{60,60,60}}")
+4|(1,"{{70,70,70},{70,70,70},{70,70,70}}")
+4|(1,"{{80,80,80},{80,80,80},{80,80,80}}")
+4|(1,"{{90,90,90},{90,90,90},{90,90,90}}")
+5|(1,"{{1,1},{1,1}}")
+5|(2,"{{10,10},{10,10}}")
+5|(1,"{{1,2},{1,2}}")
+5|(2,"{{10,20},{10,20}}")
+5|(1,"{{2,2},{2,2}}")
+5|(2,"{{20,20},{20,20}}")
+5|(1,"{{3,3},{3,3}}")
+5|(2,"{{30,30},{30,30}}")
+5|(1,"{{3,NULL},{3,NULL}}")
+5|(2,"{{30,NULL},{30,NULL}}")
+5|(1,"{{1,1},{4,4}}")
+5|(2,"{{10,10},{40,40}}")
+5|(1,"{{1,2},{4,5}}")
+5|(2,"{{10,20},{40,50}}")
+5|(1,"{{2,2},{5,5}}")
+5|(2,"{{20,20},{50,50}}")
+5|(1,"{{3,3},{6,6}}")
+5|(2,"{{30,30},{60,60}}")
+5|(1,"{{3,NULL},{6,NULL}}")
+5|(2,"{{30,NULL},{60,NULL}}")
+5|(1,"{{4,4},{4,4}}")
+5|(2,"{{40,40},{40,40}}")
+5|(1,"{{4,5},{4,5}}")
+5|(2,"{{40,50},{40,50}}")
+5|(1,"{{5,5},{5,5}}")
+5|(2,"{{50,50},{50,50}}")
+5|(1,"{{6,6},{6,6}}")
+5|(2,"{{60,60},{60,60}}")
+5|(1,"{{6,NULL},{6,NULL}}")
+5|(2,"{{60,NULL},{60,NULL}}")
+5|(1,"{{7,7},{7,7}}")
+5|(2,"{{70,70},{70,70}}")
+5|(1,"{{7,8},{7,8}}")
+5|(2,"{{70,80},{70,80}}")
+5|(1,"{{8,8},{8,8}}")
+5|(2,"{{80,80},{80,80}}")
+5|(1,"{{9,9},{9,9}}")
+5|(2,"{{90,90},{90,90}}")
+5|(1,"{{9,NULL},{9,NULL}}")
+5|(2,"{{90,NULL},{90,NULL}}")
+5|(1,"{{7,7},{NULL,NULL}}")
+5|(2,"{{70,70},{NULL,NULL}}")
+5|(1,"{{7,8},{NULL,NULL}}")
+5|(2,"{{70,80},{NULL,NULL}}")
+5|(1,"{{8,8},{NULL,NULL}}")
+5|(2,"{{80,80},{NULL,NULL}}")
+5|(1,"{{9,9},{NULL,NULL}}")
+5|(2,"{{90,90},{NULL,NULL}}")
+5|(1,"{{9,NULL},{NULL,NULL}}")
+5|(2,"{{90,NULL},{NULL,NULL}}")
+6|(1,{{1}})
+6|(2,{{10}})
+6|(1,{{1}})
+6|(2,{{10}})
+6|(1,{{1}})
+6|(2,{{10}})
+6|(1,{{2}})
+6|(2,{{20}})
+6|(1,{{2}})
+6|(2,{{20}})
+6|(1,{{2}})
+6|(2,{{20}})
+6|(1,{{3}})
+6|(2,{{30}})
+6|(1,{{3}})
+6|(2,{{30}})
+6|(1,{{3}})
+6|(2,{{30}})
+6|(1,{{1}})
+6|(2,{{10}})
+6|(1,{{1}})
+6|(2,{{10}})
+6|(1,{{1}})
+6|(2,{{10}})
+6|(1,{{2}})
+6|(2,{{20}})
+6|(1,{{2}})
+6|(2,{{20}})
+6|(1,{{2}})
+6|(2,{{20}})
+6|(1,{{3}})
+6|(2,{{30}})
+6|(1,{{3}})
+6|(2,{{30}})
+6|(1,{{3}})
+6|(2,{{30}})
+6|(1,{{1}})
+6|(2,{{10}})
+6|(1,{{1}})
+6|(2,{{10}})
+6|(1,{{1}})
+6|(2,{{10}})
+6|(1,{{2}})
+6|(2,{{20}})
+6|(1,{{2}})
+6|(2,{{20}})
+6|(1,{{2}})
+6|(2,{{20}})
+6|(1,{{3}})
+6|(2,{{30}})
+6|(1,{{3}})
+6|(2,{{30}})
+6|(1,{{3}})
+6|(2,{{30}})
+6|(1,{{4}})
+6|(2,{{40}})
+6|(1,{{4}})
+6|(2,{{40}})
+6|(1,{{4}})
+6|(2,{{40}})
+6|(1,{{5}})
+6|(2,{{50}})
+6|(1,{{5}})
+6|(2,{{50}})
+6|(1,{{5}})
+6|(2,{{50}})
+6|(1,{{6}})
+6|(2,{{60}})
+6|(1,{{6}})
+6|(2,{{60}})
+6|(1,{{6}})
+6|(2,{{60}})
+6|(1,{{4}})
+6|(2,{{40}})
+6|(1,{{4}})
+6|(2,{{40}})
+6|(1,{{4}})
+6|(2,{{40}})
+6|(1,{{5}})
+6|(2,{{50}})
+6|(1,{{5}})
+6|(2,{{50}})
+6|(1,{{5}})
+6|(2,{{50}})
+6|(1,{{6}})
+6|(2,{{60}})
+6|(1,{{6}})
+6|(2,{{60}})
+6|(1,{{6}})
+6|(2,{{60}})
+6|(1,{{4}})
+6|(2,{{40}})
+6|(1,{{4}})
+6|(2,{{40}})
+6|(1,{{4}})
+6|(2,{{40}})
+6|(1,{{5}})
+6|(2,{{50}})
+6|(1,{{5}})
+6|(2,{{50}})
+6|(1,{{5}})
+6|(2,{{50}})
+6|(1,{{6}})
+6|(2,{{60}})
+6|(1,{{6}})
+6|(2,{{60}})
+6|(1,{{6}})
+6|(2,{{60}})
+6|(1,{{7}})
+6|(2,{{70}})
+6|(1,{{7}})
+6|(2,{{70}})
+6|(1,{{7}})
+6|(2,{{70}})
+6|(1,{{8}})
+6|(2,{{80}})
+6|(1,{{8}})
+6|(2,{{80}})
+6|(1,{{8}})
+6|(2,{{80}})
+6|(1,{{9}})
+6|(2,{{90}})
+6|(1,{{9}})
+6|(2,{{90}})
+6|(1,{{9}})
+6|(2,{{90}})
+6|(1,{{7}})
+6|(2,{{70}})
+6|(1,{{7}})
+6|(2,{{70}})
+6|(1,{{7}})
+6|(2,{{70}})
+6|(1,{{8}})
+6|(2,{{80}})
+6|(1,{{8}})
+6|(2,{{80}})
+6|(1,{{8}})
+6|(2,{{80}})
+6|(1,{{9}})
+6|(2,{{90}})
+6|(1,{{9}})
+6|(2,{{90}})
+6|(1,{{9}})
+6|(2,{{90}})
+6|(1,{{7}})
+6|(2,{{70}})
+6|(1,{{7}})
+6|(2,{{70}})
+6|(1,{{7}})
+6|(2,{{70}})
+6|(1,{{8}})
+6|(2,{{80}})
+6|(1,{{8}})
+6|(2,{{80}})
+6|(1,{{8}})
+6|(2,{{80}})
+6|(1,{{9}})
+6|(2,{{90}})
+6|(1,{{9}})
+6|(2,{{90}})
+6|(1,{{9}})
+6|(2,{{90}})
+7|(1,"{{1,1,1,2,2},{1,1,1,2,2},{1,1,1,2,2},{4,4,4,5,5},{4,4,4,5,5}}")
+7|(2,"{{10,10,10,20,20},{10,10,10,20,20},{10,10,10,20,20},{40,40,40,50,50},{40,40,40,50,50}}")
+7|(1,"{{2,3,3,3,NULL},{2,3,3,3,NULL},{2,3,3,3,NULL},{5,6,6,6,NULL},{5,6,6,6,NULL}}")
+7|(2,"{{20,30,30,30,NULL},{20,30,30,30,NULL},{20,30,30,30,NULL},{50,60,60,60,NULL},{50,60,60,60,NULL}}")
+7|(1,"{{4,4,4,5,5},{7,7,7,8,8},{7,7,7,8,8},{7,7,7,8,8},{NULL,NULL,NULL,NULL,NULL}}")
+7|(2,"{{40,40,40,50,50},{70,70,70,80,80},{70,70,70,80,80},{70,70,70,80,80},{NULL,NULL,NULL,NULL,NULL}}")
+7|(1,"{{5,6,6,6,NULL},{8,9,9,9,NULL},{8,9,9,9,NULL},{8,9,9,9,NULL},{NULL,NULL,NULL,NULL,NULL}}")
+7|(2,"{{50,60,60,60,NULL},{80,90,90,90,NULL},{80,90,90,90,NULL},{80,90,90,90,NULL},{NULL,NULL,NULL,NULL,NULL}}")