From: Regina Obe Date: Wed, 15 Jun 2011 01:25:58 +0000 (+0000) Subject: Change ST_MapAlgebra to use default args and amend the documentation to reflect chang... X-Git-Tag: 2.0.0alpha1~1426 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8f1406a3a11b51b14868ae111cc05e96a0664179;p=postgis Change ST_MapAlgebra to use default args and amend the documentation to reflect change. In so doing fix #969 - inconsistent order of args, #967 raster regress failures on 9.0 and 9.1 git-svn-id: http://svn.osgeo.org/postgis/trunk@7397 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference_raster.xml b/doc/reference_raster.xml index 5ff40b81b..b916f49f1 100644 --- a/doc/reference_raster.xml +++ b/doc/reference_raster.xml @@ -4612,45 +4612,24 @@ WHERE A.rid =2 ) As foo; raster rast integer band text expression - text nodatavalueexpr - text pixeltype + text nodatavalueexpr=NULL + text pixeltype=same_as_source raster ST_MapAlgebra raster rast - integer band text expression - text nodatavalueexpr + text nodatavalueexpr=NULL + text pixeltype=same_as_source raster ST_MapAlgebra raster rast text expression - text nodatavalueexpr text pixeltype - - - raster ST_MapAlgebra - raster rast - text expression - text pixeltype - - - - raster ST_MapAlgebra - raster rast - integer band - text expression - - - - raster ST_MapAlgebra - raster rast - text expression - diff --git a/raster/rt_pg/rtpostgis.sql.in.c b/raster/rt_pg/rtpostgis.sql.in.c index 8a9ff8ee5..737eebef5 100644 --- a/raster/rt_pg/rtpostgis.sql.in.c +++ b/raster/rt_pg/rtpostgis.sql.in.c @@ -1469,50 +1469,25 @@ CREATE OR REPLACE FUNCTION st_transform(rast raster, srid integer, algorithm tex -- This function can not be STRICT, because nodatavalueexpr can be NULL (could be just '' though) -- or pixeltype can not be determined (could be st_bandpixeltype(raster, band) though) CREATE OR REPLACE FUNCTION st_mapalgebra(rast raster, band integer, - expression text, nodatavalueexpr text, pixeltype text) + expression text, nodatavalueexpr text DEFAULT NULL, pixeltype text DEFAULT NULL) RETURNS raster AS 'MODULE_PATHNAME', 'RASTER_mapAlgebra' LANGUAGE 'C' IMMUTABLE; -CREATE OR REPLACE FUNCTION st_mapalgebra(rast raster, band integer, - expression text) - RETURNS raster - AS $$ SELECT st_mapalgebra($1, $2, $3, NULL, NULL) $$ - LANGUAGE SQL IMMUTABLE STRICT; - CREATE OR REPLACE FUNCTION st_mapalgebra(rast raster, expression text, pixeltype text) RETURNS raster AS $$ SELECT st_mapalgebra($1, 1, $2, NULL, $3) $$ LANGUAGE SQL IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION st_mapalgebra(rast raster, expression text) - RETURNS raster - AS $$ SELECT st_mapalgebra($1, 1, $2, NULL, NULL) $$ - LANGUAGE SQL IMMUTABLE STRICT; - --- This function can not be STRICT, because nodatavalueexpr can be NULL (could be just '' though) -CREATE OR REPLACE FUNCTION st_mapalgebra(rast raster, band integer, - expression text, nodatavalueexpr text) - RETURNS raster - AS $$ SELECT st_mapalgebra($1, $2, $3, $4, NULL) $$ - LANGUAGE SQL; - -- This function can not be STRICT, because nodatavalueexpr can be NULL (could be just '' though) -- or pixeltype can not be determined (could be st_bandpixeltype(raster, band) though) CREATE OR REPLACE FUNCTION st_mapalgebra(rast raster, expression text, - nodatavalueexpr text, pixeltype text) + nodatavalueexpr text DEFAULT NULL, pixeltype text DEFAULT NULL) RETURNS raster AS $$ SELECT st_mapalgebra($1, 1, $2, $3, $4) $$ LANGUAGE SQL; --- This function can not be STRICT, because nodatavalueexpr can be NULL (could be just '' though) -CREATE OR REPLACE FUNCTION st_mapalgebra(rast raster, expression text, - nodatavalueexpr text) - RETURNS raster - AS $$ SELECT st_mapalgebra($1, 1, $2, $3, NULL) $$ - LANGUAGE SQL; - ----------------------------------------------------------------------- -- Get information about the raster