]> granicus.if.org Git - postgis/commitdiff
Explicitly set the output band's pixel type depending on the band being returned...
authorBborie Park <bkpark at ucdavis.edu>
Sat, 4 Feb 2012 00:02:08 +0000 (00:02 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Sat, 4 Feb 2012 00:02:08 +0000 (00:02 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@9024 b70326c6-7e19-0410-871a-916f4a2858ee

raster/rt_pg/rtpostgis.sql.in.c

index 7bfa15273eb96cd70828884a1c80864963f3ec84..a267d410679cf625ed8b192e5a73fc068a048626 100644 (file)
@@ -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;