Ignore:
Timestamp:
Feb 3, 2012 4:02:08 PM (5 years ago)
Author:
dustymugs
Message:

Explicitly set the output band's pixel type depending on the band being returned (FIRST, SECOND, BOTH. OTHER is left NULL) in ST_Intersection(raster, raster). Related ticket is #1537.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/raster/rt_pg/rtpostgis.sql.in.c

    r9023 r9024  
    31993199                CASE
    32003200                        WHEN _returnband = 'FIRST' THEN
    3201                                 rtn := ST_MapAlgebraExpr(rast1, band1, rast2, band2, '[rast1.val]', NULL, extenttype);
     3201                                rtn := ST_MapAlgebraExpr(rast1, band1, rast2, band2, '[rast1.val]', ST_BandPixelType(rast1, band1), extenttype);
    32023202                        WHEN _returnband = 'SECOND' THEN
    3203                                 rtn := ST_MapAlgebraExpr(rast2, band2, rast1, band1, '[rast1.val]', NULL, extenttype);
     3203                                rtn := ST_MapAlgebraExpr(rast1, band1, rast2, band2, '[rast2.val]', ST_BandPixelType(rast2, band2), extenttype);
    32043204                        WHEN _returnband = 'OTHER' THEN
    32053205                                rtn := ST_MapAlgebraFct(rast1, band1, rast2, band2, otheruserfunc, NULL, extenttype);
    32063206                        ELSE -- BOTH
    3207                                 rtn := ST_MapAlgebraExpr(rast1, band1, rast2, band2, '[rast1.val]', NULL, extenttype);
    3208                                 rtn := ST_AddBand(rtn, ST_MapAlgebraExpr(rast2, band2, rast1, band1, '[rast1.val]', NULL, extenttype));
     3207                                rtn := ST_MapAlgebraExpr(rast1, band1, rast2, band2, '[rast1.val]', ST_BandPixelType(rast1, band1), extenttype);
     3208                                rtn := ST_AddBand(rtn, ST_MapAlgebraExpr(rast1, band1, rast2, band2, '[rast2.val]', ST_BandPixelType(rast2, band2), extenttype));
    32093209                END CASE;
    32103210
Note: See TracChangeset for help on using the changeset viewer.