From 690a0039c437aa341aa9899b3c5f9ca1f9c82167 Mon Sep 17 00:00:00 2001 From: Bborie Park Date: Sun, 29 Jul 2012 02:34:23 +0000 Subject: [PATCH] Removed valuecount data type. Ticket is #1939 git-svn-id: http://svn.osgeo.org/postgis/trunk@10135 b70326c6-7e19-0410-871a-916f4a2858ee --- raster/rt_pg/rtpostgis.sql.in.c | 29 +++++++++++++++++++--------- raster/rt_pg/rtpostgis_drop.sql.in.c | 1 + 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/raster/rt_pg/rtpostgis.sql.in.c b/raster/rt_pg/rtpostgis.sql.in.c index 2c43a95d3..1d886b004 100644 --- a/raster/rt_pg/rtpostgis.sql.in.c +++ b/raster/rt_pg/rtpostgis.sql.in.c @@ -1114,17 +1114,19 @@ CREATE OR REPLACE FUNCTION st_approxquantile(rastertable text, rastercolumn text ----------------------------------------------------------------------- -- ST_ValueCount and ST_ValuePercent ----------------------------------------------------------------------- -CREATE TYPE valuecount AS ( - value double precision, - count integer, - percent double precision -); -- None of the "valuecount" functions with "searchvalues" can be strict as "searchvalues" and "roundto" can be NULL -- Allowing "searchvalues" to be NULL instructs the function to count all values -CREATE OR REPLACE FUNCTION _st_valuecount(rast raster, nband integer DEFAULT 1, exclude_nodata_value boolean DEFAULT TRUE, searchvalues double precision[] DEFAULT NULL, roundto double precision DEFAULT 0) - RETURNS SETOF valuecount +CREATE OR REPLACE FUNCTION _st_valuecount( + rast raster, nband integer DEFAULT 1, + exclude_nodata_value boolean DEFAULT TRUE, + searchvalues double precision[] DEFAULT NULL, + roundto double precision DEFAULT 0, + OUT value double precision, + OUT count integer, + OUT percent double precision +) AS 'MODULE_PATHNAME', 'RASTER_valueCount' LANGUAGE 'c' IMMUTABLE; @@ -1200,8 +1202,17 @@ CREATE OR REPLACE FUNCTION st_valuepercent(rast raster, searchvalue double preci AS $$ SELECT (_st_valuecount($1, 1, TRUE, ARRAY[$2]::double precision[], $3)).percent $$ LANGUAGE 'sql' IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION _st_valuecount(rastertable text, rastercolumn text, nband integer DEFAULT 1, exclude_nodata_value boolean DEFAULT TRUE, searchvalues double precision[] DEFAULT NULL, roundto double precision DEFAULT 0) - RETURNS SETOF valuecount +CREATE OR REPLACE FUNCTION _st_valuecount( + rastertable text, + rastercolumn text, + nband integer DEFAULT 1, + exclude_nodata_value boolean DEFAULT TRUE, + searchvalues double precision[] DEFAULT NULL, + roundto double precision DEFAULT 0, + OUT value double precision, + OUT count integer, + OUT percent double precision +) AS 'MODULE_PATHNAME', 'RASTER_valueCountCoverage' LANGUAGE 'c' STABLE; diff --git a/raster/rt_pg/rtpostgis_drop.sql.in.c b/raster/rt_pg/rtpostgis_drop.sql.in.c index ea3eab4f8..1a17b55a0 100644 --- a/raster/rt_pg/rtpostgis_drop.sql.in.c +++ b/raster/rt_pg/rtpostgis_drop.sql.in.c @@ -214,6 +214,7 @@ DROP TYPE IF EXISTS bandmetadata; DROP TYPE IF EXISTS geomvalxy; DROP TYPE IF EXISTS summarystats; DROP TYPE IF EXISTS quantile; +DROP TYPE IF EXISTS valuecount; -- raster_columns and raster_overviews tables are deprecated DROP FUNCTION IF EXISTS _rename_raster_tables(); -- 2.40.0