From 8146bd4b7e0e14e2e6f3828044ec4957be30c054 Mon Sep 17 00:00:00 2001 From: Pierre Racine Date: Thu, 1 Dec 2011 01:09:22 +0000 Subject: [PATCH] Some cleaning before inclusion in rtpostgis.sql Removed ST_MultiBandMapAlgebra and ST_HasNoBand git-svn-id: http://svn.osgeo.org/postgis/trunk@8270 b70326c6-7e19-0410-871a-916f4a2858ee --- raster/scripts/plpgsql/st_union.sql | 41 +---------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) diff --git a/raster/scripts/plpgsql/st_union.sql b/raster/scripts/plpgsql/st_union.sql index 55c1fa60b..9d72b3ee1 100644 --- a/raster/scripts/plpgsql/st_union.sql +++ b/raster/scripts/plpgsql/st_union.sql @@ -1,4 +1,4 @@ ----------------------------------------------------------------------- +---------------------------------------------------------------------- -- -- $Id$ -- @@ -8,45 +8,6 @@ -- Note: The functions provided in this script are in developement. Do not use. --- Fix a bug in ST_HasNoBand -CREATE OR REPLACE FUNCTION ST_HasNoBand(raster, int) - RETURNS boolean - AS 'SELECT $1 IS NULL OR ST_NumBands($1) < $2' - LANGUAGE 'SQL' IMMUTABLE; - -CREATE OR REPLACE FUNCTION ST_MultiBandMapAlgebra(rast1 raster, - rast2 raster, - expression text, - extentexpr text) - RETURNS raster AS - $$ - DECLARE - numband int; - newrast raster; - pixeltype text; - nodataval float; - BEGIN - numband := ST_NumBands(rast1); - IF numband != ST_NumBands(rast2) THEN - RAISE EXCEPTION 'ST_MultiBandMapAlgebra: Rasters do not have the same number of band'; - END IF; - newrast := ST_MakeEmptyRaster(rast1); - FOR b IN 1..numband LOOP - pixeltype := ST_BandPixelType(rast1, b); - nodataval := ST_BandNodataValue(rast1, b); - newrast := ST_AddBand(newrast, NULL, ST_MapAlgebraExpr(rast1, b, rast2, b, expression, pixeltype, extentexpr, nodataval), 1); - END LOOP; - END; - $$ - LANGUAGE 'plpgsql'; - -CREATE OR REPLACE FUNCTION MultiBandMapAlgebra4Union(rast1 raster, rast2 raster, expression text) - RETURNS raster - AS $$ - SELECT ST_MultiBandMapAlgebra($1, $2, $3, 'UNION'); - $$ - LANGUAGE 'SQL'; - DROP TYPE IF EXISTS rastexpr CASCADE; CREATE TYPE rastexpr AS ( rast raster, -- 2.40.0