From: Bborie Park Date: Thu, 26 May 2011 15:43:26 +0000 (+0000) Subject: Changed the datatype for "count" from integer to bigint. This should allow the ... X-Git-Tag: 2.0.0alpha1~1559 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5484c0bf01b36a404eb345dfefeba4191884d9b1;p=postgis Changed the datatype for "count" from integer to bigint. This should allow the "count" return value to handle large numbers coming from the various coverage functions. git-svn-id: http://svn.osgeo.org/postgis/trunk@7255 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/raster/rt_pg/rtpostgis.sql.in.c b/raster/rt_pg/rtpostgis.sql.in.c index 19bf95225..93d888f7f 100644 --- a/raster/rt_pg/rtpostgis.sql.in.c +++ b/raster/rt_pg/rtpostgis.sql.in.c @@ -262,7 +262,7 @@ CREATE OR REPLACE FUNCTION st_band(rast raster) -- ST_SummaryStats and ST_ApproxSummaryStats ----------------------------------------------------------------------- CREATE TYPE summarystats AS ( - count integer, + count bigint, sum double precision, mean double precision, stddev double precision, @@ -461,93 +461,93 @@ CREATE OR REPLACE FUNCTION st_approxsummarystats(rastertable text, rastercolumn ----------------------------------------------------------------------- -- ST_Count and ST_ApproxCount ----------------------------------------------------------------------- -CREATE OR REPLACE FUNCTION st_count(rast raster, nband int, hasnodata boolean, OUT count integer) - RETURNS integer +CREATE OR REPLACE FUNCTION st_count(rast raster, nband int, hasnodata boolean, OUT count bigint) + RETURNS bigint AS $$ SELECT count FROM _st_summarystats($1, $2, $3, 1) $$ LANGUAGE 'SQL' IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION st_count(rast raster, nband int, OUT count integer) - RETURNS integer +CREATE OR REPLACE FUNCTION st_count(rast raster, nband int, OUT count bigint) + RETURNS bigint AS $$ SELECT count FROM _st_summarystats($1, $2, TRUE, 1) $$ LANGUAGE 'SQL' IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION st_count(rast raster, hasnodata boolean, OUT count integer) - RETURNS integer +CREATE OR REPLACE FUNCTION st_count(rast raster, hasnodata boolean, OUT count bigint) + RETURNS bigint AS $$ SELECT count FROM _st_summarystats($1, 1, $2, 1) $$ LANGUAGE 'SQL' IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION st_count(rast raster, OUT count integer) - RETURNS integer +CREATE OR REPLACE FUNCTION st_count(rast raster, OUT count bigint) + RETURNS bigint AS $$ SELECT count FROM _st_summarystats($1, 1, TRUE, 1) $$ LANGUAGE 'SQL' IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION st_approxcount(rast raster, nband int, hasnodata boolean, sample_percent double precision, OUT count integer) - RETURNS integer +CREATE OR REPLACE FUNCTION st_approxcount(rast raster, nband int, hasnodata boolean, sample_percent double precision, OUT count bigint) + 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 integer) - RETURNS integer +CREATE OR REPLACE FUNCTION st_approxcount(rast raster, nband int, sample_percent double precision, OUT count bigint) + 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, OUT count integer) - RETURNS integer +CREATE OR REPLACE FUNCTION st_approxcount(rast raster, hasnodata boolean, sample_percent double precision, OUT count bigint) + 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 integer) - RETURNS integer +CREATE OR REPLACE FUNCTION st_approxcount(rast raster, sample_percent double precision, OUT count bigint) + RETURNS bigint AS $$ SELECT count FROM _st_summarystats($1, 1, TRUE, $2) $$ LANGUAGE 'SQL' IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION st_approxcount(rast raster, OUT count integer) - RETURNS integer +CREATE OR REPLACE FUNCTION st_approxcount(rast raster, OUT count bigint) + RETURNS bigint AS $$ SELECT count FROM _st_summarystats($1, 1, TRUE, 0.1) $$ LANGUAGE 'SQL' IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION st_count(rastertable text, rastercolumn text, nband int, hasnodata boolean, OUT count integer) - RETURNS integer +CREATE OR REPLACE FUNCTION st_count(rastertable text, rastercolumn text, nband int, hasnodata boolean, OUT count bigint) + RETURNS bigint AS $$ SELECT count FROM _st_summarystats($1, $2, $3, $4, 1) $$ LANGUAGE 'SQL' IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION st_count(rastertable text, rastercolumn text, nband int, OUT count integer) - RETURNS integer +CREATE OR REPLACE FUNCTION st_count(rastertable text, rastercolumn text, nband int, OUT count bigint) + RETURNS bigint AS $$ SELECT count FROM _st_summarystats($1, $2, $3, TRUE, 1) $$ LANGUAGE 'SQL' IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION st_count(rastertable text, rastercolumn text, hasnodata boolean, OUT count integer) - RETURNS integer +CREATE OR REPLACE FUNCTION st_count(rastertable text, rastercolumn text, hasnodata boolean, OUT count bigint) + RETURNS bigint AS $$ SELECT count FROM _st_summarystats($1, $2, 1, $3, 1) $$ LANGUAGE 'SQL' IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION st_count(rastertable text, rastercolumn text, OUT count integer) - RETURNS integer +CREATE OR REPLACE FUNCTION st_count(rastertable text, rastercolumn text, OUT count bigint) + RETURNS bigint AS $$ SELECT count FROM _st_summarystats($1, $2, 1, TRUE, 1) $$ LANGUAGE 'SQL' IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION st_approxcount(rastertable text, rastercolumn text, nband int, hasnodata boolean, sample_percent double precision, OUT count integer) - RETURNS integer +CREATE OR REPLACE FUNCTION st_approxcount(rastertable text, rastercolumn text, nband int, hasnodata boolean, sample_percent double precision, OUT count bigint) + RETURNS bigint AS $$ SELECT count FROM _st_summarystats($1, $2, $3, $4, $5) $$ LANGUAGE 'SQL' IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION st_approxcount(rastertable text, rastercolumn text, nband int, sample_percent double precision, OUT count integer) - RETURNS integer +CREATE OR REPLACE FUNCTION st_approxcount(rastertable text, rastercolumn text, nband int, sample_percent double precision, OUT count bigint) + RETURNS bigint AS $$ SELECT count FROM _st_summarystats($1, $2, $3, TRUE, $4) $$ LANGUAGE 'SQL' IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION st_approxcount(rastertable text, rastercolumn text, hasnodata boolean, sample_percent double precision, OUT count integer) - RETURNS integer +CREATE OR REPLACE FUNCTION st_approxcount(rastertable text, rastercolumn text, hasnodata boolean, sample_percent double precision, OUT count bigint) + RETURNS bigint AS $$ SELECT count FROM _st_summarystats($1, $2, 1, $3, $4) $$ LANGUAGE 'SQL' IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION st_approxcount(rastertable text, rastercolumn text, sample_percent double precision, OUT count integer) - RETURNS integer +CREATE OR REPLACE FUNCTION st_approxcount(rastertable text, rastercolumn text, sample_percent double precision, OUT count bigint) + RETURNS bigint AS $$ SELECT count FROM _st_summarystats($1, $2, 1, TRUE, $3) $$ LANGUAGE 'SQL' IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION st_approxcount(rastertable text, rastercolumn text, OUT count integer) - RETURNS integer +CREATE OR REPLACE FUNCTION st_approxcount(rastertable text, rastercolumn text, OUT count bigint) + RETURNS bigint AS $$ SELECT count FROM _st_summarystats($1, $2, 1, TRUE, 0.1) $$ LANGUAGE 'SQL' IMMUTABLE STRICT;