-----------------------------------------------------------------------
-- ST_Count and ST_ApproxCount
-----------------------------------------------------------------------
-CREATE OR REPLACE FUNCTION st_count(rast raster, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, OUT count bigint)
+CREATE OR REPLACE FUNCTION st_count(rast raster, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE)
RETURNS bigint
AS $$ SELECT count FROM st_summarystats($1, $2, $3, 1) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_count(rast raster, hasnodata boolean, OUT count bigint)
+CREATE OR REPLACE FUNCTION st_count(rast raster, hasnodata boolean)
RETURNS bigint
AS $$ SELECT count FROM st_summarystats($1, 1, $2, 1) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxcount(rast raster, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, sample_percent double precision DEFAULT 0.1, OUT count bigint)
+CREATE OR REPLACE FUNCTION st_approxcount(rast raster, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, sample_percent double precision DEFAULT 0.1)
RETURNS bigint
AS $$ SELECT count FROM st_summarystats($1, $2, $3, $4) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxcount(rast raster, nband int, sample_percent double precision, OUT count bigint)
+CREATE OR REPLACE FUNCTION st_approxcount(rast raster, nband int, sample_percent double precision)
RETURNS bigint
AS $$ SELECT count FROM st_summarystats($1, $2, TRUE, $3) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxcount(rast raster, hasnodata boolean, sample_percent double precision DEFAULT 0.1, OUT count bigint)
+CREATE OR REPLACE FUNCTION st_approxcount(rast raster, hasnodata boolean, sample_percent double precision DEFAULT 0.1)
RETURNS bigint
AS $$ SELECT count FROM st_summarystats($1, 1, $2, $3) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxcount(rast raster, sample_percent double precision, OUT count bigint)
+CREATE OR REPLACE FUNCTION st_approxcount(rast raster, sample_percent double precision)
RETURNS bigint
AS $$ SELECT count FROM st_summarystats($1, 1, TRUE, $2) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_count(rastertable text, rastercolumn text, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, OUT count bigint)
+CREATE OR REPLACE FUNCTION st_count(rastertable text, rastercolumn text, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE)
RETURNS bigint
AS $$ SELECT count FROM st_summarystats($1, $2, $3, $4, 1) $$
LANGUAGE 'SQL' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_count(rastertable text, rastercolumn text, hasnodata boolean, OUT count bigint)
+CREATE OR REPLACE FUNCTION st_count(rastertable text, rastercolumn text, hasnodata boolean)
RETURNS bigint
AS $$ SELECT count FROM st_summarystats($1, $2, 1, $3, 1) $$
LANGUAGE 'SQL' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxcount(rastertable text, rastercolumn text, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, sample_percent double precision DEFAULT 0.1, OUT count bigint)
+CREATE OR REPLACE FUNCTION st_approxcount(rastertable text, rastercolumn text, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, sample_percent double precision DEFAULT 0.1)
RETURNS bigint
AS $$ SELECT count FROM st_summarystats($1, $2, $3, $4, $5) $$
LANGUAGE 'SQL' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxcount(rastertable text, rastercolumn text, nband int, sample_percent double precision, OUT count bigint)
+CREATE OR REPLACE FUNCTION st_approxcount(rastertable text, rastercolumn text, nband int, sample_percent double precision)
RETURNS bigint
AS $$ SELECT count FROM st_summarystats($1, $2, $3, TRUE, $4) $$
LANGUAGE 'SQL' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxcount(rastertable text, rastercolumn text, hasnodata boolean, sample_percent double precision DEFAULT 0.1, OUT count bigint)
+CREATE OR REPLACE FUNCTION st_approxcount(rastertable text, rastercolumn text, hasnodata boolean, sample_percent double precision DEFAULT 0.1)
RETURNS bigint
AS $$ SELECT count FROM st_summarystats($1, $2, 1, $3, $4) $$
LANGUAGE 'SQL' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxcount(rastertable text, rastercolumn text, sample_percent double precision, OUT count bigint)
+CREATE OR REPLACE FUNCTION st_approxcount(rastertable text, rastercolumn text, sample_percent double precision)
RETURNS bigint
AS $$ SELECT count FROM st_summarystats($1, $2, 1, TRUE, $3) $$
LANGUAGE 'SQL' STABLE STRICT;
-----------------------------------------------------------------------
-- ST_Sum and ST_ApproxSum
-----------------------------------------------------------------------
-CREATE OR REPLACE FUNCTION st_sum(rast raster, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, OUT sum double precision)
+CREATE OR REPLACE FUNCTION st_sum(rast raster, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE)
RETURNS double precision
AS $$ SELECT sum FROM st_summarystats($1, $2, $3, 1) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_sum(rast raster, hasnodata boolean, OUT sum double precision)
+CREATE OR REPLACE FUNCTION st_sum(rast raster, hasnodata boolean)
RETURNS double precision
AS $$ SELECT sum FROM st_summarystats($1, 1, $2, 1) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxsum(rast raster, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, sample_percent double precision DEFAULT 0.1, OUT sum double precision)
+CREATE OR REPLACE FUNCTION st_approxsum(rast raster, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, sample_percent double precision DEFAULT 0.1)
RETURNS double precision
AS $$ SELECT sum FROM st_summarystats($1, $2, $3, $4) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxsum(rast raster, nband int, sample_percent double precision, OUT sum double precision)
+CREATE OR REPLACE FUNCTION st_approxsum(rast raster, nband int, sample_percent double precision)
RETURNS double precision
AS $$ SELECT sum FROM st_summarystats($1, $2, TRUE, $3) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxsum(rast raster, hasnodata boolean, sample_percent double precision DEFAULT 0.1, OUT sum double precision)
+CREATE OR REPLACE FUNCTION st_approxsum(rast raster, hasnodata boolean, sample_percent double precision DEFAULT 0.1)
RETURNS double precision
AS $$ SELECT sum FROM st_summarystats($1, 1, $2, $3) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxsum(rast raster, sample_percent double precision, OUT sum double precision)
+CREATE OR REPLACE FUNCTION st_approxsum(rast raster, sample_percent double precision)
RETURNS double precision
AS $$ SELECT sum FROM st_summarystats($1, 1, TRUE, $2) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_sum(rastertable text, rastercolumn text, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, OUT sum double precision)
+CREATE OR REPLACE FUNCTION st_sum(rastertable text, rastercolumn text, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE)
RETURNS double precision
AS $$ SELECT sum FROM st_summarystats($1, $2, $3, $4, 1) $$
LANGUAGE 'SQL' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_sum(rastertable text, rastercolumn text, hasnodata boolean, OUT sum double precision)
+CREATE OR REPLACE FUNCTION st_sum(rastertable text, rastercolumn text, hasnodata boolean)
RETURNS double precision
AS $$ SELECT sum FROM st_summarystats($1, $2, 1, $3, 1) $$
LANGUAGE 'SQL' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxsum(rastertable text, rastercolumn text, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, sample_percent double precision DEFAULT 0.1, OUT sum double precision)
+CREATE OR REPLACE FUNCTION st_approxsum(rastertable text, rastercolumn text, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, sample_percent double precision DEFAULT 0.1)
RETURNS double precision
AS $$ SELECT sum FROM st_summarystats($1, $2, $3, $4, $5) $$
LANGUAGE 'SQL' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxsum(rastertable text, rastercolumn text, nband int, sample_percent double precision, OUT sum double precision)
+CREATE OR REPLACE FUNCTION st_approxsum(rastertable text, rastercolumn text, nband int, sample_percent double precision)
RETURNS double precision
AS $$ SELECT sum FROM st_summarystats($1, $2, $3, TRUE, $4) $$
LANGUAGE 'SQL' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxsum(rastertable text, rastercolumn text, hasnodata boolean, sample_percent double precision DEFAULT 0.1, OUT sum double precision)
+CREATE OR REPLACE FUNCTION st_approxsum(rastertable text, rastercolumn text, hasnodata boolean, sample_percent double precision DEFAULT 0.1)
RETURNS double precision
AS $$ SELECT sum FROM st_summarystats($1, $2, 1, $3, $4) $$
LANGUAGE 'SQL' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxsum(rastertable text, rastercolumn text, sample_percent double precision, OUT sum double precision)
+CREATE OR REPLACE FUNCTION st_approxsum(rastertable text, rastercolumn text, sample_percent double precision)
RETURNS double precision
AS $$ SELECT sum FROM st_summarystats($1, $2, 1, TRUE, $3) $$
LANGUAGE 'SQL' STABLE STRICT;
-----------------------------------------------------------------------
-- ST_Mean and ST_ApproxMean
-----------------------------------------------------------------------
-CREATE OR REPLACE FUNCTION st_mean(rast raster, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, OUT mean double precision)
+CREATE OR REPLACE FUNCTION st_mean(rast raster, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE)
RETURNS double precision
AS $$ SELECT mean FROM st_summarystats($1, $2, $3, 1) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_mean(rast raster, hasnodata boolean, OUT mean double precision)
+CREATE OR REPLACE FUNCTION st_mean(rast raster, hasnodata boolean)
RETURNS double precision
AS $$ SELECT mean FROM st_summarystats($1, 1, $2, 1) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxmean(rast raster, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, sample_percent double precision DEFAULT 0.1, OUT mean double precision)
+CREATE OR REPLACE FUNCTION st_approxmean(rast raster, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, sample_percent double precision DEFAULT 0.1)
RETURNS double precision
AS $$ SELECT mean FROM st_summarystats($1, $2, $3, $4) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxmean(rast raster, nband int, sample_percent double precision, OUT mean double precision)
+CREATE OR REPLACE FUNCTION st_approxmean(rast raster, nband int, sample_percent double precision)
RETURNS double precision
AS $$ SELECT mean FROM st_summarystats($1, $2, TRUE, $3) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxmean(rast raster, hasnodata boolean, sample_percent double precision DEFAULT 0.1, OUT mean double precision)
+CREATE OR REPLACE FUNCTION st_approxmean(rast raster, hasnodata boolean, sample_percent double precision DEFAULT 0.1)
RETURNS double precision
AS $$ SELECT mean FROM st_summarystats($1, 1, $2, $3) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxmean(rast raster, sample_percent double precision, OUT mean double precision)
+CREATE OR REPLACE FUNCTION st_approxmean(rast raster, sample_percent double precision)
RETURNS double precision
AS $$ SELECT mean FROM st_summarystats($1, 1, TRUE, $2) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_mean(rastertable text, rastercolumn text, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, OUT mean double precision)
+CREATE OR REPLACE FUNCTION st_mean(rastertable text, rastercolumn text, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE)
RETURNS double precision
AS $$ SELECT mean FROM st_summarystats($1, $2, $3, $4, 1) $$
LANGUAGE 'SQL' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_mean(rastertable text, rastercolumn text, hasnodata boolean, OUT mean double precision)
+CREATE OR REPLACE FUNCTION st_mean(rastertable text, rastercolumn text, hasnodata boolean)
RETURNS double precision
AS $$ SELECT mean FROM st_summarystats($1, $2, 1, $3, 1) $$
LANGUAGE 'SQL' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxmean(rastertable text, rastercolumn text, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, sample_percent double precision DEFAULT 0.1, OUT mean double precision)
+CREATE OR REPLACE FUNCTION st_approxmean(rastertable text, rastercolumn text, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, sample_percent double precision DEFAULT 0.1)
RETURNS double precision
AS $$ SELECT mean FROM st_summarystats($1, $2, $3, $4, $5) $$
LANGUAGE 'SQL' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxmean(rastertable text, rastercolumn text, nband int, sample_percent double precision, OUT mean double precision)
+CREATE OR REPLACE FUNCTION st_approxmean(rastertable text, rastercolumn text, nband int, sample_percent double precision)
RETURNS double precision
AS $$ SELECT mean FROM st_summarystats($1, $2, $3, TRUE, $4) $$
LANGUAGE 'SQL' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxmean(rastertable text, rastercolumn text, hasnodata boolean, sample_percent double precision DEFAULT 0.1, OUT mean double precision)
+CREATE OR REPLACE FUNCTION st_approxmean(rastertable text, rastercolumn text, hasnodata boolean, sample_percent double precision DEFAULT 0.1)
RETURNS double precision
AS $$ SELECT mean FROM st_summarystats($1, $2, 1, $3, $4) $$
LANGUAGE 'SQL' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxmean(rastertable text, rastercolumn text, sample_percent double precision, OUT mean double precision)
+CREATE OR REPLACE FUNCTION st_approxmean(rastertable text, rastercolumn text, sample_percent double precision)
RETURNS double precision
AS $$ SELECT mean FROM st_summarystats($1, $2, 1, TRUE, $3) $$
LANGUAGE 'SQL' STABLE STRICT;
-----------------------------------------------------------------------
-- ST_StdDev and ST_ApproxStdDev
-----------------------------------------------------------------------
-CREATE OR REPLACE FUNCTION st_stddev(rast raster, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, OUT stddev double precision)
+CREATE OR REPLACE FUNCTION st_stddev(rast raster, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE)
RETURNS double precision
AS $$ SELECT stddev FROM st_summarystats($1, $2, $3, 1) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_stddev(rast raster, hasnodata boolean, OUT stddev double precision)
+CREATE OR REPLACE FUNCTION st_stddev(rast raster, hasnodata boolean)
RETURNS double precision
AS $$ SELECT stddev FROM st_summarystats($1, 1, $2, 1) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxstddev(rast raster, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, sample_percent double precision DEFAULT 0.1, OUT stddev double precision)
+CREATE OR REPLACE FUNCTION st_approxstddev(rast raster, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, sample_percent double precision DEFAULT 0.1)
RETURNS double precision
AS $$ SELECT stddev FROM st_summarystats($1, $2, $3, $4) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxstddev(rast raster, nband int, sample_percent double precision, OUT stddev double precision)
+CREATE OR REPLACE FUNCTION st_approxstddev(rast raster, nband int, sample_percent double precision)
RETURNS double precision
AS $$ SELECT stddev FROM st_summarystats($1, $2, TRUE, $3) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxstddev(rast raster, hasnodata boolean, sample_percent double precision DEFAULT 0.1, OUT stddev double precision)
+CREATE OR REPLACE FUNCTION st_approxstddev(rast raster, hasnodata boolean, sample_percent double precision DEFAULT 0.1)
RETURNS double precision
AS $$ SELECT stddev FROM st_summarystats($1, 1, $2, $3) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxstddev(rast raster, sample_percent double precision, OUT stddev double precision)
+CREATE OR REPLACE FUNCTION st_approxstddev(rast raster, sample_percent double precision)
RETURNS double precision
AS $$ SELECT stddev FROM st_summarystats($1, 1, TRUE, $2) $$
LANGUAGE 'SQL' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_stddev(rastertable text, rastercolumn text, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, OUT stddev double precision)
+CREATE OR REPLACE FUNCTION st_stddev(rastertable text, rastercolumn text, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE)
RETURNS double precision
AS $$ SELECT stddev FROM st_summarystats($1, $2, $3, $4, 1) $$
LANGUAGE 'SQL' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_stddev(rastertable text, rastercolumn text, hasnodata boolean, OUT stddev double precision)
+CREATE OR REPLACE FUNCTION st_stddev(rastertable text, rastercolumn text, hasnodata boolean)
RETURNS double precision
AS $$ SELECT stddev FROM st_summarystats($1, $2, 1, $3, 1) $$
LANGUAGE 'SQL' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxstddev(rastertable text, rastercolumn text, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, sample_percent double precision DEFAULT 0.1, OUT stddev double precision)
+CREATE OR REPLACE FUNCTION st_approxstddev(rastertable text, rastercolumn text, nband int DEFAULT 1, hasnodata boolean DEFAULT TRUE, sample_percent double precision DEFAULT 0.1)
RETURNS double precision
AS $$ SELECT stddev FROM st_summarystats($1, $2, $3, $4, $5) $$
LANGUAGE 'SQL' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxstddev(rastertable text, rastercolumn text, nband int, sample_percent double precision, OUT stddev double precision)
+CREATE OR REPLACE FUNCTION st_approxstddev(rastertable text, rastercolumn text, nband int, sample_percent double precision)
RETURNS double precision
AS $$ SELECT stddev FROM st_summarystats($1, $2, $3, TRUE, $4) $$
LANGUAGE 'SQL' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxstddev(rastertable text, rastercolumn text, hasnodata boolean, sample_percent double precision DEFAULT 0.1, OUT stddev double precision)
+CREATE OR REPLACE FUNCTION st_approxstddev(rastertable text, rastercolumn text, hasnodata boolean, sample_percent double precision DEFAULT 0.1)
RETURNS double precision
AS $$ SELECT stddev FROM st_summarystats($1, $2, 1, $3, $4) $$
LANGUAGE 'SQL' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_approxstddev(rastertable text, rastercolumn text, sample_percent double precision, OUT stddev double precision)
+CREATE OR REPLACE FUNCTION st_approxstddev(rastertable text, rastercolumn text, sample_percent double precision)
RETURNS double precision
AS $$ SELECT stddev FROM st_summarystats($1, $2, 1, TRUE, $3) $$
LANGUAGE 'SQL' STABLE STRICT;
LANGUAGE 'sql' IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION st_quantile(rast raster, nband int, hasnodata boolean, quantile double precision)
- RETURNS quantile
- AS $$ SELECT quantile, value FROM _st_quantile($1, $2, $3, 1, ARRAY[$4]::double precision[]) $$
+ RETURNS double precision
+ AS $$ SELECT value FROM _st_quantile($1, $2, $3, 1, ARRAY[$4]::double precision[]) $$
LANGUAGE 'sql' IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION st_quantile(rast raster, nband int, quantile double precision)
- RETURNS quantile
- AS $$ SELECT quantile, value FROM _st_quantile($1, $2, TRUE, 1, ARRAY[$3]::double precision[]) $$
+ RETURNS double precision
+ AS $$ SELECT value FROM _st_quantile($1, $2, TRUE, 1, ARRAY[$3]::double precision[]) $$
LANGUAGE 'sql' IMMUTABLE STRICT;
-- Cannot be strict as "quantile" can be NULL
CREATE OR REPLACE FUNCTION st_quantile(rast raster, hasnodata boolean, quantile double precision DEFAULT NULL)
- RETURNS quantile
- AS $$ SELECT quantile, value FROM _st_quantile($1, 1, $2, 1, ARRAY[$3]::double precision[]) $$
+ RETURNS double precision
+ AS $$ SELECT value FROM _st_quantile($1, 1, $2, 1, ARRAY[$3]::double precision[]) $$
LANGUAGE 'sql' IMMUTABLE;
CREATE OR REPLACE FUNCTION st_quantile(rast raster, quantile double precision)
- RETURNS quantile
- AS $$ SELECT quantile, value FROM _st_quantile($1, 1, TRUE, 1, ARRAY[$2]::double precision[]) $$
+ RETURNS double precision
+ AS $$ SELECT value FROM _st_quantile($1, 1, TRUE, 1, ARRAY[$2]::double precision[]) $$
LANGUAGE 'sql' IMMUTABLE STRICT;
-- Cannot be strict as "quantiles" can be NULL
LANGUAGE 'sql' IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION st_approxquantile(rast raster, nband int, hasnodata boolean, sample_percent double precision, quantile double precision)
- RETURNS quantile
- AS $$ SELECT quantile, value FROM _st_quantile($1, $2, $3, $4, ARRAY[$5]::double precision[]) $$
+ RETURNS double precision
+ AS $$ SELECT value FROM _st_quantile($1, $2, $3, $4, ARRAY[$5]::double precision[]) $$
LANGUAGE 'sql' IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION st_approxquantile(rast raster, nband int, sample_percent double precision, quantile double precision)
- RETURNS quantile
- AS $$ SELECT quantile, value FROM _st_quantile($1, $2, TRUE, $3, ARRAY[$4]::double precision[]) $$
+ RETURNS double precision
+ AS $$ SELECT value FROM _st_quantile($1, $2, TRUE, $3, ARRAY[$4]::double precision[]) $$
LANGUAGE 'sql' IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION st_approxquantile(rast raster, sample_percent double precision, quantile double precision)
- RETURNS quantile
- AS $$ SELECT quantile, value FROM _st_quantile($1, 1, TRUE, $2, ARRAY[$3]::double precision[]) $$
+ RETURNS double precision
+ AS $$ SELECT value FROM _st_quantile($1, 1, TRUE, $2, ARRAY[$3]::double precision[]) $$
LANGUAGE 'sql' IMMUTABLE STRICT;
-- Cannot be strict as "quantile" can be NULL
CREATE OR REPLACE FUNCTION st_approxquantile(rast raster, hasnodata boolean, quantile double precision DEFAULT NULL)
- RETURNS quantile
- AS $$ SELECT quantile, value FROM _st_quantile($1, 1, $2, 1, ARRAY[$3]::double precision[]) $$
+ RETURNS double precision
+ AS $$ SELECT value FROM _st_quantile($1, 1, $2, 1, ARRAY[$3]::double precision[]) $$
LANGUAGE 'sql' IMMUTABLE;
CREATE OR REPLACE FUNCTION st_approxquantile(rast raster, quantile double precision)
- RETURNS quantile
- AS $$ SELECT quantile, value FROM _st_quantile($1, 1, TRUE, 1, ARRAY[$2]::double precision[]) $$
+ RETURNS double precision
+ AS $$ SELECT value FROM _st_quantile($1, 1, TRUE, 1, ARRAY[$2]::double precision[]) $$
LANGUAGE 'sql' IMMUTABLE;
-----------------------------------------------------------------------
AS $$ SELECT value, count FROM _st_valuecount($1, 1, TRUE, $2, $3) $$
LANGUAGE 'sql' IMMUTABLE;
-CREATE OR REPLACE FUNCTION st_valuecount(rast raster, nband integer, hasnodata boolean, searchvalue double precision, roundto double precision DEFAULT 0, OUT count integer)
+CREATE OR REPLACE FUNCTION st_valuecount(rast raster, nband integer, hasnodata boolean, searchvalue double precision, roundto double precision DEFAULT 0)
RETURNS integer
AS $$ SELECT count FROM _st_valuecount($1, $2, $3, ARRAY[$4]::double precision[], $5) $$
LANGUAGE 'sql' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_valuecount(rast raster, nband integer, searchvalue double precision, roundto double precision DEFAULT 0, OUT count integer)
+CREATE OR REPLACE FUNCTION st_valuecount(rast raster, nband integer, searchvalue double precision, roundto double precision DEFAULT 0)
RETURNS integer
AS $$ SELECT count FROM _st_valuecount($1, $2, TRUE, ARRAY[$3]::double precision[], $4) $$
LANGUAGE 'sql' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_valuecount(rast raster, searchvalue double precision, roundto double precision DEFAULT 0, OUT count integer)
+CREATE OR REPLACE FUNCTION st_valuecount(rast raster, searchvalue double precision, roundto double precision DEFAULT 0)
RETURNS integer
AS $$ SELECT count FROM _st_valuecount($1, 1, TRUE, ARRAY[$2]::double precision[], $3) $$
LANGUAGE 'sql' IMMUTABLE STRICT;
AS $$ SELECT value, count FROM st_valuecount($1, $2, 1, TRUE, $3, $4) $$
LANGUAGE 'sql' STABLE;
-CREATE OR REPLACE FUNCTION st_valuecount(rastertable text, rastercolumn text, nband integer, hasnodata boolean, searchvalue double precision, roundto double precision DEFAULT 0, OUT count bigint)
+CREATE OR REPLACE FUNCTION st_valuecount(rastertable text, rastercolumn text, nband integer, hasnodata boolean, searchvalue double precision, roundto double precision DEFAULT 0)
RETURNS bigint
AS $$ SELECT count FROM st_valuecount($1, $2, $3, $4, ARRAY[$5]::double precision[], $6) $$
LANGUAGE 'sql' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_valuecount(rastertable text, rastercolumn text, nband integer, searchvalue double precision, roundto double precision DEFAULT 0, OUT count bigint)
+CREATE OR REPLACE FUNCTION st_valuecount(rastertable text, rastercolumn text, nband integer, searchvalue double precision, roundto double precision DEFAULT 0)
RETURNS bigint
AS $$ SELECT count FROM st_valuecount($1, $2, $3, TRUE, ARRAY[$4]::double precision[], $5) $$
LANGUAGE 'sql' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_valuecount(rastertable text, rastercolumn text, searchvalue double precision, roundto double precision DEFAULT 0, OUT count bigint)
+CREATE OR REPLACE FUNCTION st_valuecount(rastertable text, rastercolumn text, searchvalue double precision, roundto double precision DEFAULT 0)
RETURNS bigint
AS $$ SELECT count FROM st_valuecount($1, $2, 1, TRUE, ARRAY[$3]::double precision[], $4) $$
LANGUAGE 'sql' STABLE STRICT;
AS $$ SELECT value, percent FROM _st_valuecount($1, 1, TRUE, $2, $3) $$
LANGUAGE 'sql' IMMUTABLE;
-CREATE OR REPLACE FUNCTION st_valuepercent(rast raster, nband integer, hasnodata boolean, searchvalue double precision, roundto double precision DEFAULT 0, OUT percent double precision)
+CREATE OR REPLACE FUNCTION st_valuepercent(rast raster, nband integer, hasnodata boolean, searchvalue double precision, roundto double precision DEFAULT 0)
RETURNS double precision
AS $$ SELECT percent FROM _st_valuecount($1, $2, $3, ARRAY[$4]::double precision[], $5) $$
LANGUAGE 'sql' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_valuepercent(rast raster, nband integer, searchvalue double precision, roundto double precision DEFAULT 0, OUT percent double precision)
+CREATE OR REPLACE FUNCTION st_valuepercent(rast raster, nband integer, searchvalue double precision, roundto double precision DEFAULT 0)
RETURNS double precision
AS $$ SELECT percent FROM _st_valuecount($1, $2, TRUE, ARRAY[$3]::double precision[], $4) $$
LANGUAGE 'sql' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION st_valuepercent(rast raster, searchvalue double precision, roundto double precision DEFAULT 0, OUT percent double precision)
+CREATE OR REPLACE FUNCTION st_valuepercent(rast raster, searchvalue double precision, roundto double precision DEFAULT 0)
RETURNS double precision
AS $$ SELECT percent FROM _st_valuecount($1, 1, TRUE, ARRAY[$2]::double precision[], $3) $$
LANGUAGE 'sql' IMMUTABLE STRICT;
AS $$ SELECT value, percent FROM st_valuepercent($1, $2, 1, TRUE, $3, $4) $$
LANGUAGE 'sql' STABLE;
-CREATE OR REPLACE FUNCTION st_valuepercent(rastertable text, rastercolumn text, nband integer, hasnodata boolean, searchvalue double precision, roundto double precision DEFAULT 0, OUT percent double precision)
+CREATE OR REPLACE FUNCTION st_valuepercent(rastertable text, rastercolumn text, nband integer, hasnodata boolean, searchvalue double precision, roundto double precision DEFAULT 0)
RETURNS double precision
AS $$ SELECT percent FROM st_valuepercent($1, $2, $3, $4, ARRAY[$5]::double precision[], $6) $$
LANGUAGE 'sql' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_valuepercent(rastertable text, rastercolumn text, nband integer, searchvalue double precision, roundto double precision DEFAULT 0, OUT percent double precision)
+CREATE OR REPLACE FUNCTION st_valuepercent(rastertable text, rastercolumn text, nband integer, searchvalue double precision, roundto double precision DEFAULT 0)
RETURNS double precision
AS $$ SELECT percent FROM st_valuepercent($1, $2, $3, TRUE, ARRAY[$4]::double precision[], $5) $$
LANGUAGE 'sql' STABLE STRICT;
-CREATE OR REPLACE FUNCTION st_valuepercent(rastertable text, rastercolumn text, searchvalue double precision, roundto double precision DEFAULT 0, OUT percent double precision)
+CREATE OR REPLACE FUNCTION st_valuepercent(rastertable text, rastercolumn text, searchvalue double precision, roundto double precision DEFAULT 0)
RETURNS double precision
AS $$ SELECT percent FROM st_valuepercent($1, $2, 1, TRUE, ARRAY[$3]::double precision[], $4) $$
LANGUAGE 'sql' STABLE STRICT;