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.
</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 --
------+---------+---------+-------------+-------------+-----------+-------------+---------------
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>