]> granicus.if.org Git - postgis/commitdiff
Clarify the role of ST_DumpValues array indexes
authorSandro Santilli <strk@keybit.net>
Fri, 13 Mar 2015 12:09:51 +0000 (12:09 +0000)
committerSandro Santilli <strk@keybit.net>
Fri, 13 Mar 2015 12:09:51 +0000 (12:09 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@13331 b70326c6-7e19-0410-871a-916f4a2858ee

doc/reference_raster.xml

index 8351c8d3ae1240656d5e35c4dd3cbfadecc2bbb2..cd2095cd437781e5b535dabbcee006a242bbd65e 100644 (file)
@@ -5564,7 +5564,7 @@ ORDER BY t1.rid, t2.gid, t3.gid;
                                                        <type>raster </type> <parameter>rast</parameter>
                                                </paramdef>
                                                <paramdef>
-                                                       <type>integer[] </type> <parameter>nband</parameter>
+                                                       <type>integer[] </type> <parameter>nband=NULL</parameter>
                                                </paramdef>
                                                <paramdef>
                                                        <type>boolean </type> <parameter>exclude_nodata_value=true</parameter>
@@ -5589,7 +5589,7 @@ ORDER BY t1.rid, t2.gid, t3.gid;
                                <title>Description</title>
 
                                <para>
-                                       Get the values of the specified band as a 2-dimension array If <varname>nband</varname> is NULL or not provided, all raster bands are processed.
+                                       Get the values of the specified band as a 2-dimension array (first index is row, second is column). If <varname>nband</varname> is NULL or not provided, all raster bands are processed.
                                </para>
 
                                <para>Availability: 2.1.0</para>
@@ -5628,6 +5628,19 @@ FROM foo;
      1 | {{1,1,1},{1,1,1},{1,1,1}}
 (2 rows)
                                </programlisting>
+                               <programlisting>
+WITH foo AS (
+       SELECT ST_SetValue(ST_AddBand(ST_MakeEmptyRaster(3, 3, 0, 0, 1, -1, 0, 0, 0), 1, '8BUI', 1, 0), 1, 2, 5) AS rast
+)
+SELECT
+       (ST_DumpValues(rast, 1))[2][1]
+FROM foo;
+
+ st_dumpvalues
+---------------
+             5
+(1 row)
+                               </programlisting>
                        </refsection>
 
                        <refsection>