Opened 13 years ago

Last modified 13 years ago

#1317 closed defect

[raster] CASE expression causes ST_MapAlgebra for 2 raster to fail — at Version 1

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

Description (last modified by pracine)

This query:

SELECT ST_MapAlgebraExpr(ST_AddBand(ST_MakeEmptyRaster(4, 4, 0, 0, 1, 1, 0, 0, -1), '32BF'::text, 6, -1), 1, 
                         ST_AddBand(ST_MakeEmptyRaster(4, 4, 0, 0, 1, 1, 0, 0, -1), '32BF'::text, 4, -1), 1,
                         'CASE WHEN rast2 > 0 THEN rast1 / rast2 ELSE NULL END'::text, 
                         NULL::text, 
                         'UNION'::text, 
                         NULL::text, 
                         NULL::text, 
                         NULL::double precision)

produces this error:

ERROR:  column "rast2" does not exist
LINE 1: SELECT (CASE WHEN $2 > 0 THEN $1 / RAST2 ELSE NULL END)::dou...
                                           ^
QUERY:  SELECT (CASE WHEN $2 > 0 THEN $1 / RAST2 ELSE NULL END)::double precision

********** Error **********

ERROR: column "rast2" does not exist
SQL state: 42703

There seems to be a problem when parsing CASE expressions…

I was testing ST_Union()…

Change History (1)

comment:1 by pracine, 13 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.