]> granicus.if.org Git - postgis/commitdiff
Tweak what value to initialize new band to when NODATA isn't present
authorBborie Park <bkpark at ucdavis.edu>
Wed, 3 Oct 2012 20:53:27 +0000 (20:53 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Wed, 3 Oct 2012 20:53:27 +0000 (20:53 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@10371 b70326c6-7e19-0410-871a-916f4a2858ee

raster/rt_pg/rt_pg.c

index dffbc6f4eaa6e9850171a0cc64bba2536e50822e..51fee395052230885e5f1db48d8743d09a71c4b2 100644 (file)
@@ -14182,9 +14182,8 @@ Datum RASTER_union_transfn(PG_FUNCTION_ARGS)
                                        hasnodata = rt_band_get_hasnodata_flag(_band);
                                        if (hasnodata)
                                                nodataval = rt_band_get_nodata(_band);
-                                       /* shouldn't this be rt_band_get_min_val(_band) */
                                        else
-                                               nodataval = 0;
+                                               nodataval = rt_band_get_min_value(_band);
 
                                        if (rt_raster_generate_new_band(
                                                iwr->bandarg[i].raster[0],
@@ -14258,9 +14257,8 @@ Datum RASTER_union_transfn(PG_FUNCTION_ARGS)
                                hasnodata = rt_band_get_hasnodata_flag(_band);
                                if (hasnodata)
                                        nodataval = rt_band_get_nodata(_band);
-                               /* shouldn't this be rt_band_get_min_val(_band) */
                                else
-                                       nodataval = 0;
+                                       nodataval = rt_band_get_min_value(_band);
                        }
 
                        /* UT_MEAN requires two passes, first for UT_COUNT and second for UT_SUM */