]> granicus.if.org Git - postgis/commitdiff
Added default values for function arguments of ST_Reclass
authorBborie Park <bkpark at ucdavis.edu>
Fri, 27 May 2011 14:42:23 +0000 (14:42 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Fri, 27 May 2011 14:42:23 +0000 (14:42 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@7276 b70326c6-7e19-0410-871a-916f4a2858ee

raster/rt_pg/rtpostgis.sql.in.c

index 2f2dc4e85538f9fc0923917a0b631cd66b0ab29d..8fff7b4612f49df31f0186145860cd1688cbcab1 100644 (file)
@@ -1151,15 +1151,11 @@ CREATE OR REPLACE FUNCTION st_reclass(rast raster, VARIADIC reclassargset reclas
        END;
        $$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
 
-CREATE OR REPLACE FUNCTION st_reclass(rast raster, nband int, reclassexpr text, pixeltype text, nodataval double precision)
+-- Cannot be strict as "nodataval" can be NULL
+CREATE OR REPLACE FUNCTION st_reclass(rast raster, nband int, reclassexpr text, pixeltype text, nodataval double precision DEFAULT NULL)
        RETURNS raster
        AS $$ SELECT st_reclass($1, ROW($2, $3, $4, $5)) $$
-       LANGUAGE 'SQL' IMMUTABLE STRICT;
-
-CREATE OR REPLACE FUNCTION st_reclass(rast raster, nband int, reclassexpr text, pixeltype text)
-       RETURNS raster
-       AS $$ SELECT st_reclass($1, ROW($2, $3, $4, NULL)) $$
-       LANGUAGE 'SQL' IMMUTABLE STRICT;
+       LANGUAGE 'SQL' IMMUTABLE;
 
 CREATE OR REPLACE FUNCTION st_reclass(rast raster, reclassexpr text, pixeltype text)
        RETURNS raster