Opened 12 years ago

Closed 12 years ago

#1515 closed defect (fixed)

[raster] Optimization in ST_MapAlgebra fails

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

Description

When doing:

SELECT ST_MapAlgebraExpr(ST_AddBand(ST_MakeEmptyRaster(3, 3, 0, 0, 1, 1, 0, 0, -1), '32BSI'::text, 1, -1), 1, '32BF'::text, 'rast'::text)

to convert a 32BSI band to a 32BF band, RASTER_mapAlgebraExpr() fails to copy the band (this is an optimization when the map algebra expression resume to 'rast') with this notice:

NOTICE: rt_raster_copy_band: Second raster has no band.

I am pretty sure this line in rt_pg.c:

rt_raster_copy_band(raster, newrast, nband - 1, 0);

should look like:

rt_raster_copy_band(newrast, raster, nband - 1, 0);

Unfortunately I can't commit now as I still don<t have a working windows build.

Change History (2)

comment:1 by Bborie Park, 12 years ago

Owner: changed from pracine to dzwarg

comment:2 by Bborie Park, 12 years ago

Resolution: fixed
Status: newclosed

Fixed in r9017.

Note: See TracTickets for help on using tickets.