Opened 14 years ago

Closed 13 years ago

#644 closed defect (fixed)

[raster] ST_MapAlgebra raster/scripts/plpgsql some broken

Reported by: robe Owned by: pracine
Priority: blocker Milestone: PostGIS 2.0.0
Component: raster Version: master
Keywords: Cc:

Description

— this is invalid (that should be $4 I believe)

CREATE OR REPLACE FUNCTION ST_MapAlgebra(rast raster, band integer, expression text, nodatavalexpr text) 
    RETURNS raster
    AS 'SELECT ST_MapAlgebra($1, $2, $3, nodatavalexpr, NULL)'
    LANGUAGE 'SQL' IMMUTABLE;

—- this is invalid (it might be because I'm testing on 9.1 (though 9.0 should have the same issue) since both support named variables function call syntax and so are more stringent about naming -

CREATE OR REPLACE FUNCTION ST_MapAlgebra(rast raster, expression text, nodatavalexpr text) 
    RETURNS raster
    AS 'SELECT ST_MapAlgebra($1, 1, $2, $3, NULL)'
    LANGUAGE 'SQL' IMMUTABLE;

gives error

ERROR: cannot change name of input parameter "pixeltype" HINT: Use DROP FUNCTION first.

Attachments (1)

fix_map_algebra.sql (9.0 KB ) - added by dzwarg 14 years ago.
Attached are fixes that repair the prototype st_mapalgebra.sql file in the scripts/plpgsql folder.

Download all attachments as: .zip

Change History (7)

comment:1 by robe, 14 years ago

To add to this — this function also makes use of

ST_HasNoBand(rast, band) 
ERROR:  function st_hasnoband(raster, integer) does not exist
LINE 1: SELECT ST_HasNoBand(rast, band)

Can't we just replace this with is ST_NumBands(rast) < band

comment:2 by pracine, 14 years ago

Summary: ST_MapAlgebra raster/scripts/plpgsql some broken[raster] ST_MapAlgebra raster/scripts/plpgsql some broken

comment:3 by pracine, 14 years ago

Status: newassigned

comment:4 by pracine, 14 years ago

Priority: mediumblocker

by dzwarg, 14 years ago

Attachment: fix_map_algebra.sql added

Attached are fixes that repair the prototype st_mapalgebra.sql file in the scripts/plpgsql folder.

comment:5 by pracine, 13 years ago

Fixed in r7659 by removing all the variants. They are not necessary in the prototype.

comment:6 by pracine, 13 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.