]> granicus.if.org Git - postgis/commitdiff
example of AddRasterConstraint that takes listing of constraints to apply
authorRegina Obe <lr@pcorp.us>
Fri, 6 Jan 2012 16:29:39 +0000 (16:29 +0000)
committerRegina Obe <lr@pcorp.us>
Fri, 6 Jan 2012 16:29:39 +0000 (16:29 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@8687 b70326c6-7e19-0410-871a-916f4a2858ee

doc/reference_raster.xml

index 442233dce9f1f24b23c9eb452187163c6191e314..31824e39306e2e2e840a4ea708b905ba168b7bb3 100644 (file)
@@ -372,7 +372,20 @@ VALUES (1,
                table.</para>
                
                <para><varname>raster2pgsql</varname> loader uses this function to register raster tables</para>
-
+               <para>Valid constraint names to pass in: refer to <xref linkend="RT_Raster_Columns"/> for more details.</para>
+               <itemizedlist>
+                       <listitem><varname>blocksize</varname> sets both x and y blocksize</listitem>
+                       <listitem><varname>blocksize_x</varname> sets x blocksize (width in pixels of each tile)</listitem>
+                       <listitem><varname>blocksize_y</varname> sets y blocksize (height in pixels of each tile)</listitem>
+                       <listitem><varname>extent</varname> computes extent of whole table and applys constraint all rasters must be withint that extent</listitem>
+
+                       <listitem><varname>num_bands</varname> number of bands</listitem>
+                       <listitem><varname>pixel_types</varname> reads array of pixel types for each band ensure all band n have same pixel type</listitem>
+                       <listitem><varname>regular_blocking</varname> apply informational flag to denote all tiles are regularly blocked</listitem>
+                       <listitem><varname>same_alignment</varname> ensures they all have same alignment meanign any two tiles you compare will return true for Refer to <xref linkend="RT_ST_SameAlignment" /></listitem>
+                       <listitem><varname>srid</varname> ensures all have same srid</listitem>
+                       <listime>More -- any listed as inputs into the above functions</listime>
+               </itemizedlist>
                <note>
                        <para>This function infers the constraints from the data already present in the table.  As such for it to work, you must create the raster column first
                        and then load it with data.
@@ -387,13 +400,13 @@ VALUES (1,
          </refsection>
 
          <refsection>
-               <title>Examples</title>
+               <title>Examples: Apply all possible constraints on column based on data</title>
 
                <programlisting>CREATE TABLE myrasters(rid SERIAL primary key, rast raster);
 INSERT INTO myrasters(rast)
 SELECT ST_AddBand(ST_MakeEmptyRaster(1000, 1000, 0.3, -0.3, 2, 2, 0, 0,4326), 1, '8BSI', -129, NULL);
 
-SELECT AddRasterConstraints('myrasters', 'rast');
+SELECT AddRasterConstraints('myrasters'::name, 'rast'::name);
 
 
 -- verify it registered correctly in raster_columns --
@@ -405,12 +418,28 @@ SELECT srid, scale_x, scale_y, blocksize_x, blocksize_y, num_bands, pixel_types,
 ------+---------+---------+-------------+-------------+-----------+-------------+---------------
  4326 |       2 |       2 |        1000 |        1000 |         1 | {8BSI}      | {0}
                </programlisting>
+         </refsection>
+         
+          <refsection>
+               <title>Examples: Apply single constraint</title>
+
+               <programlisting>CREATE TABLE public.myrasters2(rid SERIAL primary key, rast raster);
+INSERT INTO myrasters2(rast)
+SELECT ST_AddBand(ST_MakeEmptyRaster(1000, 1000, 0.3, -0.3, 2, 2, 0, 0,4326), 1, '8BSI', -129, NULL);
+
+SELECT AddRasterConstraints('public'::name, 'myrasters2'::name, 'rast'::name,'regular_blocking', 'blocksize');
+-- get notice--
+NOTICE:  Adding regular blocking constraint
+INFO:  The regular_blocking constraint is just a flag indicating that the column "rast" is regularly blocked.  It is up to the end-user to ensure that the column is truely regularly blocked.
+CONTEXT:  PL/pgSQL function "addrasterconstraints" line 85 at assignment
+NOTICE:  Adding blocksize-X constraint
+NOTICE:  Adding blocksize-Y constraint</programlisting>
          </refsection>
 
          <refsection>
                <title>See Also</title>
 
-               <para><xref linkend="RT_ST_AddBand"/>, <xref linkend="RT_ST_MakeEmptyRaster"/>, <xref linkend="RT_DropRasterConstraints"/>, <xref linkend="RT_ST_BandPixelType" />, <xref linkend="RT_ST_SRID" /></para>
+               <para><xref linkend="RT_Raster_Columns"/>,<xref linkend="RT_ST_AddBand"/>, <xref linkend="RT_ST_MakeEmptyRaster"/>, <xref linkend="RT_DropRasterConstraints"/>, <xref linkend="RT_ST_BandPixelType" />, <xref linkend="RT_ST_SRID" /></para>
          </refsection>
        </refentry>