From: Bborie Park Date: Sat, 4 Feb 2012 00:02:08 +0000 (+0000) Subject: Explicitly set the output band's pixel type depending on the band being returned... X-Git-Tag: 2.0.0alpha4~80 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6514fc57ae04fce0b86f4d5d3b61832756f528fc;p=postgis 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. git-svn-id: http://svn.osgeo.org/postgis/trunk@9024 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/raster/rt_pg/rtpostgis.sql.in.c b/raster/rt_pg/rtpostgis.sql.in.c index 7bfa15273..a267d4106 100644 --- a/raster/rt_pg/rtpostgis.sql.in.c +++ b/raster/rt_pg/rtpostgis.sql.in.c @@ -3198,14 +3198,14 @@ CREATE OR REPLACE FUNCTION _st_intersection( rtn := NULL; CASE WHEN _returnband = 'FIRST' THEN - rtn := ST_MapAlgebraExpr(rast1, band1, rast2, band2, '[rast1.val]', NULL, extenttype); + rtn := ST_MapAlgebraExpr(rast1, band1, rast2, band2, '[rast1.val]', ST_BandPixelType(rast1, band1), extenttype); WHEN _returnband = 'SECOND' THEN - rtn := ST_MapAlgebraExpr(rast2, band2, rast1, band1, '[rast1.val]', NULL, extenttype); + rtn := ST_MapAlgebraExpr(rast1, band1, rast2, band2, '[rast2.val]', ST_BandPixelType(rast2, band2), extenttype); WHEN _returnband = 'OTHER' THEN rtn := ST_MapAlgebraFct(rast1, band1, rast2, band2, otheruserfunc, NULL, extenttype); ELSE -- BOTH - rtn := ST_MapAlgebraExpr(rast1, band1, rast2, band2, '[rast1.val]', NULL, extenttype); - rtn := ST_AddBand(rtn, ST_MapAlgebraExpr(rast2, band2, rast1, band1, '[rast1.val]', NULL, extenttype)); + rtn := ST_MapAlgebraExpr(rast1, band1, rast2, band2, '[rast1.val]', ST_BandPixelType(rast1, band1), extenttype); + rtn := ST_AddBand(rtn, ST_MapAlgebraExpr(rast1, band1, rast2, band2, '[rast2.val]', ST_BandPixelType(rast2, band2), extenttype)); END CASE; RETURN rtn;