Ticket #644 (closed defect: fixed)

Opened 3 years ago

Last modified 22 months ago

[raster] ST_MapAlgebra raster/scripts/plpgsql some broken

Reported by: robe Owned by: pracine
Priority: blocker Milestone: PostGIS 2.0.0
Component: raster Version: trunk
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

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

Change History

Changed 3 years ago by robe

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

Changed 3 years ago by pracine

  • summary changed from ST_MapAlgebra raster/scripts/plpgsql some broken to [raster] ST_MapAlgebra raster/scripts/plpgsql some broken

Changed 2 years ago by pracine

  • status changed from new to assigned

Changed 2 years ago by pracine

  • priority changed from medium to blocker

Changed 2 years ago by dzwarg

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

Changed 22 months ago by pracine

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

Changed 22 months ago by pracine

  • status changed from assigned to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.