]> granicus.if.org Git - postgis/commitdiff
Removed histogram data type. Ticket is #1939
authorBborie Park <bkpark at ucdavis.edu>
Sun, 29 Jul 2012 02:34:29 +0000 (02:34 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Sun, 29 Jul 2012 02:34:29 +0000 (02:34 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@10136 b70326c6-7e19-0410-871a-916f4a2858ee

doc/reference_raster.xml
raster/rt_pg/rtpostgis.sql.in.c
raster/rt_pg/rtpostgis_drop.sql.in.c

index db9f6bd3a1505bcdabb6b9cc4dd68d3065c6e055..47dee238e48ab539142ce5b5ddaf4e20b451fe7d 100644 (file)
@@ -142,40 +142,6 @@ VALUES (1,
                        </refsection>
                </refentry>
 
-               <refentry id="histogram">
-                 <refnamediv>
-                       <refname>histogram</refname>
-                       <refpurpose>A composite type used as record output of the ST_Histogram and ST_ApproxHistogram functions.</refpurpose>
-                 </refnamediv>
-                 <refsection>
-                       <title>Description</title>
-                       <para>A composite type used as record outputs of the <xref linkend="RT_ST_Histogram" /> <varname>ST_ApproxHistogram</varname> functions. Note that depending on <varname>exclude_nodata_value</varname> of function, may or may not contain nodata pixels.</para>
-                       <para>Each histogram record in results corresponds to a bin for a selected raster band.</para>
-                       <variablelist>
-                           <varlistentry>
-                               <term><parameter>min </parameter><type>double precision</type></term>
-                               <listitem><para>minimum pixel value in this bin</para></listitem>
-                           </varlistentry>
-                           <varlistentry>
-                               <term><parameter>max </parameter><type>double precision</type></term>
-                               <listitem><para>Maximum pixel value in this bin.</para></listitem>
-                           </varlistentry>
-                               <varlistentry>
-                               <term><parameter>count </parameter><type>integer</type></term>
-                               <listitem><para>count of pixels in this bin.</para></listitem>
-                           </varlistentry>
-                               <varlistentry>
-                               <term><parameter>percent </parameter><type>double precision</type></term>
-                               <listitem><para>Percent of pixels of the overall population in this bin.</para></listitem>
-                           </varlistentry>
-                       </variablelist>
-                 </refsection>
-                  <refsection>
-                <title>See Also</title>
-                <para><xref linkend="RT_ST_Histogram" /></para>
-           </refsection>
-               </refentry>
-               
                <refentry id="raster">
             <refnamediv>
                 <refname>raster</refname>
@@ -5165,13 +5131,13 @@ rid | exclude_nodata | include_nodata
                <refentry id="RT_ST_Histogram">
                        <refnamediv>
                                <refname>ST_Histogram</refname>
-                               <refpurpose>Returns a set of histogram summarizing a raster or raster coverage data distribution separate bin ranges. Number of bins are autocomputed if not specified.</refpurpose>
+                               <refpurpose>Returns a set of record summarizing a raster or raster coverage data distribution separate bin ranges. Number of bins are autocomputed if not specified.</refpurpose>
                        </refnamediv>
                
                        <refsynopsisdiv>
                                <funcsynopsis>
                                  <funcprototype>
-                                       <funcdef>SETOF histogram <function>ST_Histogram</function></funcdef>
+                                       <funcdef>SETOF record <function>ST_Histogram</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>
@@ -5181,7 +5147,7 @@ rid | exclude_nodata | include_nodata
                                  </funcprototype>
                                  
                                  <funcprototype>
-                                       <funcdef>SETOF histogram <function>ST_Histogram</function></funcdef>
+                                       <funcdef>SETOF record <function>ST_Histogram</function></funcdef>
                                        <paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
                                        <paramdef><type>integer </type> <parameter>nband</parameter></paramdef>
                                        <paramdef><type>integer </type> <parameter>bins</parameter></paramdef>
@@ -5190,7 +5156,7 @@ rid | exclude_nodata | include_nodata
                                  </funcprototype>
                                  
                                  <funcprototype>
-                                       <funcdef>SETOF histogram <function>ST_Histogram</function></funcdef>
+                                       <funcdef>SETOF record <function>ST_Histogram</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>
@@ -5199,7 +5165,7 @@ rid | exclude_nodata | include_nodata
                                  </funcprototype>
                                  
                                  <funcprototype>
-                                       <funcdef>SETOF histogram <function>ST_Histogram</function></funcdef>
+                                       <funcdef>SETOF record <function>ST_Histogram</function></funcdef>
                                        <paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
                                        <paramdef><type>integer </type> <parameter>nband</parameter></paramdef>
                                        <paramdef><type>integer </type> <parameter>bins</parameter></paramdef>
@@ -5207,7 +5173,7 @@ rid | exclude_nodata | include_nodata
                                  </funcprototype>
                                  
                                  <funcprototype>
-                                       <funcdef>SETOF histogram <function>ST_Histogram</function></funcdef>
+                                       <funcdef>SETOF record <function>ST_Histogram</function></funcdef>
                                        <paramdef><type>text </type> <parameter>rastertable</parameter></paramdef>
                                        <paramdef><type>text </type> <parameter>rastercolumn</parameter></paramdef>
                                        <paramdef><type>integer </type> <parameter>nband</parameter></paramdef>
@@ -5216,7 +5182,7 @@ rid | exclude_nodata | include_nodata
                                  </funcprototype>
                                  
                                  <funcprototype>
-                                       <funcdef>SETOF histogram <function>ST_Histogram</function></funcdef>
+                                       <funcdef>SETOF record <function>ST_Histogram</function></funcdef>
                                        <paramdef><type>text </type> <parameter>rastertable</parameter></paramdef>
                                        <paramdef><type>text </type> <parameter>rastercolumn</parameter></paramdef>
                                        <paramdef><type>integer </type> <parameter>nband</parameter></paramdef>
@@ -5226,7 +5192,7 @@ rid | exclude_nodata | include_nodata
                                  </funcprototype>
                                  
                                  <funcprototype>
-                                       <funcdef>SETOF histogram <function>ST_Histogram</function></funcdef>
+                                       <funcdef>SETOF record <function>ST_Histogram</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>
@@ -5237,7 +5203,7 @@ rid | exclude_nodata | include_nodata
                                  </funcprototype>
                                  
                                  <funcprototype>
-                                       <funcdef>SETOF histogram <function>ST_Histogram</function></funcdef>
+                                       <funcdef>SETOF record <function>ST_Histogram</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>
@@ -5251,7 +5217,7 @@ rid | exclude_nodata | include_nodata
                        <refsection>
                                <title>Description</title>
                                
-                               <para>Returns set of <varname>histogram</varname> records consisting of min,max, count, percent for a given raster band for each bin. If no band is specified <varname>nband</varname> defaults to 1. </para> 
+                               <para>Returns set of records consisting of min, max, count, percent for a given raster band for each bin. If no band is specified <varname>nband</varname> defaults to 1. </para> 
                                <note><para>By default only considers pixel values not equal to the <varname>nodata</varname> value . Set <varname>exclude_nodata_value</varname> to false to get count all pixels.</para></note>
                                
                                <variablelist>
@@ -5335,7 +5301,10 @@ FROM (SELECT rid, ST_Histogram(rast, 2,6,ARRAY[0.5,1,4,100,5]) As stats
 
                        <refsection>
                                <title>See Also</title>
-                               <para><xref linkend="histogram" />, <xref linkend="RT_ST_Count" />, <xref linkend="RT_ST_SummaryStats" /></para>
+                               <para>
+                                       <xref linkend="RT_ST_Count" />, 
+                                       <xref linkend="RT_ST_SummaryStats" />
+                               </para>
                        </refsection>
                </refentry>
                
index 1d886b004854afcf0ff515d912cf7267e4adbb56..86911b05a7d5ef228d21c880cc1debb5a5edf8fa 100644 (file)
@@ -659,13 +659,6 @@ CREATE OR REPLACE FUNCTION st_approxcount(rastertable text, rastercolumn text, s
 -----------------------------------------------------------------------
 -- ST_Histogram and ST_ApproxHistogram
 -----------------------------------------------------------------------
-CREATE TYPE histogram AS (
-       min double precision,
-       max double precision,
-       count bigint,
-       percent double precision
-);
-
 -- Cannot be strict as "width", "min" and "max" can be NULL
 CREATE OR REPLACE FUNCTION _st_histogram(
        rast raster, nband int DEFAULT 1,
@@ -673,31 +666,69 @@ CREATE OR REPLACE FUNCTION _st_histogram(
        sample_percent double precision DEFAULT 1,
        bins int DEFAULT 0, width double precision[] DEFAULT NULL,
        right boolean DEFAULT FALSE,
-       min double precision DEFAULT NULL, max double precision DEFAULT NULL
+       min double precision DEFAULT NULL, max double precision DEFAULT NULL,
+       OUT min double precision,
+       OUT max double precision,
+       OUT count bigint,
+       OUT percent double precision
 )
-       RETURNS SETOF histogram
+       RETURNS SETOF record
        AS 'MODULE_PATHNAME','RASTER_histogram'
        LANGUAGE 'c' IMMUTABLE;
 
 -- Cannot be strict as "width" can be NULL
-CREATE OR REPLACE FUNCTION st_histogram(rast raster, nband int DEFAULT 1, exclude_nodata_value boolean DEFAULT TRUE, bins int DEFAULT 0, width double precision[] DEFAULT NULL, right boolean DEFAULT FALSE)
-       RETURNS SETOF histogram
+CREATE OR REPLACE FUNCTION st_histogram(
+       rast raster, nband int DEFAULT 1,
+       exclude_nodata_value boolean DEFAULT TRUE,
+       bins int DEFAULT 0, width double precision[] DEFAULT NULL,
+       right boolean DEFAULT FALSE,
+       OUT min double precision,
+       OUT max double precision,
+       OUT count bigint,
+       OUT percent double precision
+)
+       RETURNS SETOF record
        AS $$ SELECT min, max, count, percent FROM _st_histogram($1, $2, $3, 1, $4, $5, $6) $$
        LANGUAGE 'sql' IMMUTABLE;
 
-CREATE OR REPLACE FUNCTION st_histogram(rast raster, nband int, exclude_nodata_value boolean, bins int, right boolean)
-       RETURNS SETOF histogram
+CREATE OR REPLACE FUNCTION st_histogram(
+       rast raster, nband int,
+       exclude_nodata_value boolean,
+       bins int,
+       right boolean,
+       OUT min double precision,
+       OUT max double precision,
+       OUT count bigint,
+       OUT percent double precision
+)
+       RETURNS SETOF record
        AS $$ SELECT min, max, count, percent FROM _st_histogram($1, $2, $3, 1, $4, NULL, $5) $$
        LANGUAGE 'sql' IMMUTABLE STRICT;
 
 -- Cannot be strict as "width" can be NULL
-CREATE OR REPLACE FUNCTION st_histogram(rast raster, nband int, bins int, width double precision[] DEFAULT NULL, right boolean DEFAULT FALSE)
-       RETURNS SETOF histogram
+CREATE OR REPLACE FUNCTION st_histogram(
+       rast raster, nband int,
+       bins int, width double precision[] DEFAULT NULL,
+       right boolean DEFAULT FALSE,
+       OUT min double precision,
+       OUT max double precision,
+       OUT count bigint,
+       OUT percent double precision
+)
+       RETURNS SETOF record
        AS $$ SELECT min, max, count, percent FROM _st_histogram($1, $2, TRUE, 1, $3, $4, $5) $$
        LANGUAGE 'sql' IMMUTABLE;
 
-CREATE OR REPLACE FUNCTION st_histogram(rast raster, nband int, bins int, right boolean)
-       RETURNS SETOF histogram
+CREATE OR REPLACE FUNCTION st_histogram(
+       rast raster, nband int,
+       bins int,
+       right boolean,
+       OUT min double precision,
+       OUT max double precision,
+       OUT count bigint,
+       OUT percent double precision
+)
+       RETURNS SETOF record
        AS $$ SELECT min, max, count, percent FROM _st_histogram($1, $2, TRUE, 1, $3, NULL, $4) $$
        LANGUAGE 'sql' IMMUTABLE STRICT;
 
@@ -707,35 +738,80 @@ CREATE OR REPLACE FUNCTION st_approxhistogram(
        exclude_nodata_value boolean DEFAULT TRUE,
        sample_percent double precision DEFAULT 0.1,
        bins int DEFAULT 0, width double precision[] DEFAULT NULL,
-       right boolean DEFAULT FALSE
+       right boolean DEFAULT FALSE,
+       OUT min double precision,
+       OUT max double precision,
+       OUT count bigint,
+       OUT percent double precision
 )
-       RETURNS SETOF histogram
+       RETURNS SETOF record
        AS $$ SELECT min, max, count, percent FROM _st_histogram($1, $2, $3, $4, $5, $6, $7) $$
        LANGUAGE 'sql' IMMUTABLE;
 
-CREATE OR REPLACE FUNCTION st_approxhistogram(rast raster, nband int, exclude_nodata_value boolean, sample_percent double precision, bins int, right boolean)
-       RETURNS SETOF histogram
+CREATE OR REPLACE FUNCTION st_approxhistogram(
+       rast raster, nband int,
+       exclude_nodata_value boolean,
+       sample_percent double precision,
+       bins int,
+       right boolean,
+       OUT min double precision,
+       OUT max double precision,
+       OUT count bigint,
+       OUT percent double precision
+)
+       RETURNS SETOF record
        AS $$ SELECT min, max, count, percent FROM _st_histogram($1, $2, $3, $4, $5, NULL, $6) $$
        LANGUAGE 'sql' IMMUTABLE STRICT;
 
-CREATE OR REPLACE FUNCTION st_approxhistogram(rast raster, nband int, sample_percent double precision)
-       RETURNS SETOF histogram
+CREATE OR REPLACE FUNCTION st_approxhistogram(
+       rast raster, nband int,
+       sample_percent double precision,
+       OUT min double precision,
+       OUT max double precision,
+       OUT count bigint,
+       OUT percent double precision
+)
+       RETURNS SETOF record
        AS $$ SELECT min, max, count, percent FROM _st_histogram($1, $2, TRUE, $3, 0, NULL, FALSE) $$
        LANGUAGE 'sql' IMMUTABLE STRICT;
 
-CREATE OR REPLACE FUNCTION st_approxhistogram(rast raster, sample_percent double precision)
-       RETURNS SETOF histogram
+CREATE OR REPLACE FUNCTION st_approxhistogram(
+       rast raster,
+       sample_percent double precision,
+       OUT min double precision,
+       OUT max double precision,
+       OUT count bigint,
+       OUT percent double precision
+)
+       RETURNS SETOF record
        AS $$ SELECT min, max, count, percent FROM _st_histogram($1, 1, TRUE, $2, 0, NULL, FALSE) $$
        LANGUAGE 'sql' IMMUTABLE STRICT;
 
 -- Cannot be strict as "width" can be NULL
-CREATE OR REPLACE FUNCTION st_approxhistogram(rast raster, nband int, sample_percent double precision, bins int, width double precision[] DEFAULT NULL, right boolean DEFAULT FALSE)
-       RETURNS SETOF histogram
+CREATE OR REPLACE FUNCTION st_approxhistogram(
+       rast raster, nband int,
+       sample_percent double precision,
+       bins int, width double precision[] DEFAULT NULL,
+       right boolean DEFAULT FALSE,
+       OUT min double precision,
+       OUT max double precision,
+       OUT count bigint,
+       OUT percent double precision
+)
+       RETURNS SETOF record
        AS $$ SELECT min, max, count, percent FROM _st_histogram($1, $2, TRUE, $3, $4, $5, $6) $$
        LANGUAGE 'sql' IMMUTABLE STRICT;
 
-CREATE OR REPLACE FUNCTION st_approxhistogram(rast raster, nband int, sample_percent double precision, bins int, right boolean)
-       RETURNS SETOF histogram
+CREATE OR REPLACE FUNCTION st_approxhistogram(
+       rast raster, nband int,
+       sample_percent double precision,
+       bins int, right boolean,
+       OUT min double precision,
+       OUT max double precision,
+       OUT count bigint,
+       OUT percent double precision
+)
+       RETURNS SETOF record
        AS $$ SELECT min, max, count, percent FROM _st_histogram($1, $2, TRUE, $3, $4, NULL, $5) $$
        LANGUAGE 'sql' IMMUTABLE STRICT;
 
@@ -746,30 +822,68 @@ CREATE OR REPLACE FUNCTION _st_histogram(
        exclude_nodata_value boolean DEFAULT TRUE,
        sample_percent double precision DEFAULT 1,
        bins int DEFAULT 0, width double precision[] DEFAULT NULL,
-       right boolean DEFAULT FALSE
+       right boolean DEFAULT FALSE,
+       OUT min double precision,
+       OUT max double precision,
+       OUT count bigint,
+       OUT percent double precision
 )
-       RETURNS SETOF histogram
+       RETURNS SETOF record
        AS 'MODULE_PATHNAME','RASTER_histogramCoverage'
        LANGUAGE 'c' IMMUTABLE;
 
-CREATE OR REPLACE FUNCTION st_histogram(rastertable text, rastercolumn text, nband int DEFAULT 1, exclude_nodata_value boolean DEFAULT TRUE, bins int DEFAULT 0, width double precision[] DEFAULT NULL, right boolean DEFAULT FALSE)
-       RETURNS SETOF histogram
+CREATE OR REPLACE FUNCTION st_histogram(
+       rastertable text, rastercolumn text, nband int DEFAULT 1,
+       exclude_nodata_value boolean DEFAULT TRUE,
+       bins int DEFAULT 0, width double precision[] DEFAULT NULL,
+       right boolean DEFAULT FALSE,
+       OUT min double precision,
+       OUT max double precision,
+       OUT count bigint,
+       OUT percent double precision
+)
+       RETURNS SETOF record
        AS $$ SELECT _st_histogram($1, $2, $3, $4, 1, $5, $6, $7) $$
        LANGUAGE 'sql' STABLE;
 
-CREATE OR REPLACE FUNCTION st_histogram(rastertable text, rastercolumn text, nband int, exclude_nodata_value boolean, bins int, right boolean)
-       RETURNS SETOF histogram
+CREATE OR REPLACE FUNCTION st_histogram(
+       rastertable text, rastercolumn text, nband int,
+       exclude_nodata_value boolean,
+       bins int,
+       right boolean,
+       OUT min double precision,
+       OUT max double precision,
+       OUT count bigint,
+       OUT percent double precision
+)
+       RETURNS SETOF record
        AS $$ SELECT _st_histogram($1, $2, $3, $4, 1, $5, NULL, $6) $$
        LANGUAGE 'sql' STABLE STRICT;
 
 -- Cannot be strict as "width" can be NULL
-CREATE OR REPLACE FUNCTION st_histogram(rastertable text, rastercolumn text, nband int, bins int, width double precision[] DEFAULT NULL, right boolean DEFAULT FALSE)
-       RETURNS SETOF histogram
+CREATE OR REPLACE FUNCTION st_histogram(
+       rastertable text, rastercolumn text, nband int,
+       bins int, width double precision[] DEFAULT NULL,
+       right boolean DEFAULT FALSE,
+       OUT min double precision,
+       OUT max double precision,
+       OUT count bigint,
+       OUT percent double precision
+)
+       RETURNS SETOF record
        AS $$ SELECT _st_histogram($1, $2, $3, TRUE, 1, $4, $5, $6) $$
        LANGUAGE 'sql' STABLE;
 
-CREATE OR REPLACE FUNCTION st_histogram(rastertable text, rastercolumn text, nband int, bins int, right boolean)
-       RETURNS SETOF histogram
+CREATE OR REPLACE FUNCTION st_histogram(
+       rastertable text, rastercolumn text, nband int,
+       bins int,
+       right boolean,
+       OUT min double precision,
+       OUT max double precision,
+       OUT count bigint,
+       OUT percent double precision
+)
+       RETURNS SETOF record
        AS $$ SELECT _st_histogram($1, $2, $3, TRUE, 1, $4, NULL, $5) $$
        LANGUAGE 'sql' STABLE STRICT;
 
@@ -780,35 +894,81 @@ CREATE OR REPLACE FUNCTION st_approxhistogram(
        exclude_nodata_value boolean DEFAULT TRUE,
        sample_percent double precision DEFAULT 0.1,
        bins int DEFAULT 0, width double precision[] DEFAULT NULL,
-       right boolean DEFAULT FALSE
+       right boolean DEFAULT FALSE,
+       OUT min double precision,
+       OUT max double precision,
+       OUT count bigint,
+       OUT percent double precision
 )
-       RETURNS SETOF histogram
+       RETURNS SETOF record
        AS $$ SELECT _st_histogram($1, $2, $3, $4, $5, $6, $7, $8) $$
        LANGUAGE 'sql' STABLE;
 
-CREATE OR REPLACE FUNCTION st_approxhistogram(rastertable text, rastercolumn text, nband int, exclude_nodata_value boolean, sample_percent double precision, bins int, right boolean)
-       RETURNS SETOF histogram
+CREATE OR REPLACE FUNCTION st_approxhistogram(
+       rastertable text, rastercolumn text, nband int,
+       exclude_nodata_value boolean,
+       sample_percent double precision,
+       bins int,
+       right boolean,
+       OUT min double precision,
+       OUT max double precision,
+       OUT count bigint,
+       OUT percent double precision
+)
+       RETURNS SETOF record
        AS $$ SELECT _st_histogram($1, $2, $3, $4, $5, $6, NULL, $7) $$
        LANGUAGE 'sql' STABLE STRICT;
 
-CREATE OR REPLACE FUNCTION st_approxhistogram(rastertable text, rastercolumn text, nband int, sample_percent double precision)
-       RETURNS SETOF histogram
+CREATE OR REPLACE FUNCTION st_approxhistogram(
+       rastertable text, rastercolumn text, nband int,
+       sample_percent double precision,
+       OUT min double precision,
+       OUT max double precision,
+       OUT count bigint,
+       OUT percent double precision
+)
+       RETURNS SETOF record
        AS $$ SELECT _st_histogram($1, $2, $3, TRUE, $4, 0, NULL, FALSE) $$
        LANGUAGE 'sql' STABLE STRICT;
 
-CREATE OR REPLACE FUNCTION st_approxhistogram(rastertable text, rastercolumn text, sample_percent double precision)
-       RETURNS SETOF histogram
+CREATE OR REPLACE FUNCTION st_approxhistogram(
+       rastertable text, rastercolumn text,
+       sample_percent double precision,
+       OUT min double precision,
+       OUT max double precision,
+       OUT count bigint,
+       OUT percent double precision
+)
+       RETURNS SETOF record
        AS $$ SELECT _st_histogram($1, $2, 1, TRUE, $3, 0, NULL, FALSE) $$
        LANGUAGE 'sql' STABLE STRICT;
 
 -- Cannot be strict as "width" can be NULL
-CREATE OR REPLACE FUNCTION st_approxhistogram(rastertable text, rastercolumn text, nband int, sample_percent double precision, bins int, width double precision[] DEFAULT NULL, right boolean DEFAULT FALSE)
-       RETURNS SETOF histogram
+CREATE OR REPLACE FUNCTION st_approxhistogram(
+       rastertable text, rastercolumn text, nband int,
+       sample_percent double precision,
+       bins int, width double precision[] DEFAULT NULL,
+       right boolean DEFAULT FALSE,
+       OUT min double precision,
+       OUT max double precision,
+       OUT count bigint,
+       OUT percent double precision
+)
+       RETURNS SETOF record
        AS $$ SELECT _st_histogram($1, $2, $3, TRUE, $4, $5, $6, $7) $$
        LANGUAGE 'sql' STABLE STRICT;
 
-CREATE OR REPLACE FUNCTION st_approxhistogram(rastertable text, rastercolumn text, nband int, sample_percent double precision, bins int, right boolean)
-       RETURNS SETOF histogram
+CREATE OR REPLACE FUNCTION st_approxhistogram(
+       rastertable text, rastercolumn text, nband int,
+       sample_percent double precision,
+       bins int,
+       right boolean,
+       OUT min double precision,
+       OUT max double precision,
+       OUT count bigint,
+       OUT percent double precision
+)
+       RETURNS SETOF record
        AS $$ SELECT _st_histogram($1, $2, $3, TRUE, $4, $5, NULL, $6) $$
        LANGUAGE 'sql' STABLE STRICT;
 
@@ -1127,6 +1287,7 @@ CREATE OR REPLACE FUNCTION _st_valuecount(
        OUT count integer,
        OUT percent double precision
 )
+       RETURNS SETOF record
        AS 'MODULE_PATHNAME', 'RASTER_valueCount'
        LANGUAGE 'c' IMMUTABLE;
 
@@ -1213,6 +1374,7 @@ CREATE OR REPLACE FUNCTION _st_valuecount(
        OUT count integer,
        OUT percent double precision
 )
+       RETURNS SETOF record
        AS 'MODULE_PATHNAME', 'RASTER_valueCountCoverage'
        LANGUAGE 'c' STABLE;
 
index 1a17b55a00d05a9ea188e83a72b8679cb315240c..94ed9ddd9a9ab74b755f026e4714051e2a57ff72 100644 (file)
@@ -213,6 +213,7 @@ DROP FUNCTION IF EXISTS ST_PixelAsPolygons(raster,integer);
 DROP TYPE IF EXISTS bandmetadata;
 DROP TYPE IF EXISTS geomvalxy;
 DROP TYPE IF EXISTS summarystats;
+DROP TYPE IF EXISTS histogram;
 DROP TYPE IF EXISTS quantile;
 DROP TYPE IF EXISTS valuecount;