<sect1 id="RasterBand_Stats">
<title>Raster Band Statistics and Analytics</title>
-
- <refentry id="RT_ST_Quantile">
+ <refentry id="RT_ST_Count">
+ <refnamediv>
+ <refname>ST_Count</refname>
+ <refpurpose>Returns the number of pixels in a given band of a raster or raster coverage. If no band is specified defaults to band 1. If exclude_nodata_value is set to true, will only count pixels that are not equal to the nodata value.</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>bigint <function>ST_Count</function></funcdef>
+ <paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
+ <paramdef choice="opt"><type>integer </type> <parameter>nband=1</parameter></paramdef>
+ <paramdef choice="opt"><type>boolean </type> <parameter>exclude_nodata_value=true</parameter></paramdef>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>bigint <function>ST_Count</function></funcdef>
+ <paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
+ <paramdef><type>boolean </type> <parameter>exclude_nodata_value</parameter></paramdef>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>bigint <function>ST_Count</function></funcdef>
+ <paramdef><type>text </type> <parameter>rastertable</parameter></paramdef>
+ <paramdef><type>text </type> <parameter>rastercolumn</parameter></paramdef>
+ <paramdef choice="opt"><type>integer </type> <parameter>nband=1</parameter></paramdef>
+ <paramdef choice="opt"><type>boolean </type> <parameter>exclude_nodata_value=true</parameter></paramdef>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>bigint <function>ST_Count</function></funcdef>
+ <paramdef><type>text </type> <parameter>rastertable</parameter></paramdef>
+ <paramdef><type>text </type> <parameter>rastercolumn</parameter></paramdef>
+ <paramdef><type>boolean </type> <parameter>exclude_nodata_value</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+
+ <refsection>
+ <title>Description</title>
+
+ <para>Returns the number of pixels in a given band of a raster or raster coverage. If no band is specified <varname>nband</varname> defaults to 1. </para>
+ <note><para>If <varname>exclude_nodata_value</varname> is set to true, will only count pixels with value not equal to the <varname>nodata</varname> value of the raster. Set <varname>exclude_nodata_value</varname> to false to get count all pixels</para></note>
+ <para>Availability: 2.0.0 </para>
+ </refsection>
+
+ <refsection>
+ <title>Examples</title>
+ <!-- TODO: Fix once we confirm the right behavior -->
+ <programlisting>
+--example will count all pixels not 249 and one will count all pixels. --
+SELECT rid, ST_Count(ST_SetBandNoDataValue(rast,249)) As exclude_nodata,
+ ST_Count(ST_SetBandNoDataValue(rast,249),false) As include_nodata
+ FROM dummy_rast WHERE rid=2;
+
+rid | exclude_nodata | include_nodata
+-----+----------------+----------------
+ 2 | 23 | 25
+ </programlisting>
+ </refsection>
+
+ <refsection>
+ <title>See Also</title>
+ <para><xref linkend="RT_ST_SetBandNoDataValue" /></para>
+ </refsection>
+ </refentry>
+
+ <refentry id="RT_ST_Quantile">
<refnamediv>
<refname>ST_Quantile</refname>
<refpurpose>Compute quantiles in the context of the sample or population. Thus, a value could be examined to be at the raster's 25%, 50%, 75% percentile.</refpurpose>
<paramdef choice='opt'><type>boolean </type> <parameter>exclude_nodata_value=true</parameter></paramdef>
<paramdef choice='opt'><type>double precision[] </type> <parameter>quantiles=NULL</parameter></paramdef>
</funcprototype>
+ <funcprototype>
+ <funcdef>SETOF quantile <function>ST_Quantile</function></funcdef>
+ <paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
+ <paramdef><type>double precision[] </type> <parameter>quantiles</parameter></paramdef>
+ </funcprototype>
+ <funcprototype>
+ <funcdef>SETOF quantile <function>ST_Quantile</function></funcdef>
+ <paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
+ <paramdef><type>integer </type> <parameter>nband</parameter></paramdef>
+ <paramdef><type>double precision[] </type> <parameter>quantiles</parameter></paramdef>
+ </funcprototype>
<funcprototype>
<funcdef>double precision <function>ST_Quantile</function></funcdef>
<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
<paramdef><type>integer </type> <parameter>nband</parameter></paramdef>
<paramdef><type>double precision </type> <parameter>quantile</parameter></paramdef>
</funcprototype>
+ <funcprototype>
+ <funcdef>double precision <function>ST_Quantile</function></funcdef>
+ <paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
+ <paramdef><type>integer </type> <parameter>nband</parameter></paramdef>
+ <paramdef><type>boolean </type> <parameter>exclude_nodata_value</parameter></paramdef>
+ <paramdef><type>double precision </type> <parameter>quantile</parameter></paramdef>
+ </funcprototype>
<funcprototype>
<funcdef>double precision <function>ST_Quantile</function></funcdef>
<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
<para><xref linkend="RT_ST_Count" />, <xref linkend="RT_ST_SetBandNoDataValue" /></para>
</refsection>
</refentry>
- <refentry id="RT_ST_Count">
- <refnamediv>
- <refname>ST_Count</refname>
- <refpurpose>Returns the number of pixels in a given band of a raster or raster coverage. If no band is specified defaults to band 1. If exclude_nodata_value is set to true, will only count pixels that are not equal to the nodata value.</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <funcsynopsis>
- <funcprototype>
- <funcdef>bigint <function>ST_Count</function></funcdef>
- <paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
- <paramdef choice="opt"><type>integer </type> <parameter>nband=1</parameter></paramdef>
- <paramdef choice="opt"><type>boolean </type> <parameter>exclude_nodata_value=true</parameter></paramdef>
- </funcprototype>
- <funcprototype>
- <funcdef>bigint <function>ST_Count</function></funcdef>
- <paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
- <paramdef><type>boolean </type> <parameter>exclude_nodata_value</parameter></paramdef>
- </funcprototype>
- <funcprototype>
- <funcdef>bigint <function>ST_Count</function></funcdef>
- <paramdef><type>text </type> <parameter>rastertable</parameter></paramdef>
- <paramdef><type>text </type> <parameter>rastercolumn</parameter></paramdef>
- <paramdef choice="opt"><type>integer </type> <parameter>nband=1</parameter></paramdef>
- <paramdef choice="opt"><type>boolean </type> <parameter>exclude_nodata_value=true</parameter></paramdef>
- </funcprototype>
- <funcprototype>
- <funcdef>bigint <function>ST_Count</function></funcdef>
- <paramdef><type>text </type> <parameter>rastertable</parameter></paramdef>
- <paramdef><type>text </type> <parameter>rastercolumn</parameter></paramdef>
- <paramdef><type>boolean </type> <parameter>exclude_nodata_value</parameter></paramdef>
- </funcprototype>
- </funcsynopsis>
- </refsynopsisdiv>
-
- <refsection>
- <title>Description</title>
-
- <para>Returns the number of pixels in a given band of a raster or raster coverage. If no band is specified <varname>nband</varname> defaults to 1. </para>
- <note><para>If <varname>exclude_nodata_value</varname> is set to true, will only count pixels with value not equal to the <varname>nodata</varname> value of the raster. Set <varname>exclude_nodata_value</varname> to false to get count all pixels</para></note>
- <para>Availability: 2.0.0 </para>
- </refsection>
-
- <refsection>
- <title>Examples</title>
- <!-- TODO: Fix once we confirm the right behavior -->
- <programlisting>
---example will count all pixels not 249 and one will count all pixels. --
-SELECT rid, ST_Count(ST_SetBandNoDataValue(rast,249)) As exclude_nodata,
- ST_Count(ST_SetBandNoDataValue(rast,249),false) As include_nodata
- FROM dummy_rast WHERE rid=2;
-
-rid | exclude_nodata | include_nodata
------+----------------+----------------
- 2 | 23 | 25
- </programlisting>
- </refsection>
-
- <refsection>
- <title>See Also</title>
- <para><xref linkend="RT_ST_SetBandNoDataValue" /></para>
- </refsection>
- </refentry>
<refentry id="RT_ST_ValueCount">
<refnamediv>