From fc2e203a2af2e2f8d3aaf00ed98262982a444411 Mon Sep 17 00:00:00 2001 From: Bborie Park Date: Mon, 22 Oct 2012 17:19:41 +0000 Subject: [PATCH] Tweaked rt_band_check_is_nodata() to make use of rt_band_get_pixel()'s ability to return flag indicating if value is NODATA git-svn-id: http://svn.osgeo.org/postgis/trunk@10515 b70326c6-7e19-0410-871a-916f4a2858ee --- raster/rt_core/rt_api.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/raster/rt_core/rt_api.c b/raster/rt_core/rt_api.c index 1930bd80a..6394ab8e5 100644 --- a/raster/rt_core/rt_api.c +++ b/raster/rt_core/rt_api.c @@ -2801,6 +2801,7 @@ int rt_band_check_is_nodata(rt_band band) { int i, j, err; double pxValue; + int isnodata = 0; assert(NULL != band); @@ -2816,12 +2817,12 @@ rt_band_check_is_nodata(rt_band band) { /* Check all pixels */ for (i = 0; i < band->width; i++) { for (j = 0; j < band->height; j++) { - err = rt_band_get_pixel(band, i, j, &pxValue, NULL); + err = rt_band_get_pixel(band, i, j, &pxValue, &isnodata); if (err != 0) { rterror("rt_band_check_is_nodata: Cannot get band pixel"); return FALSE; } - else if (FLT_NEQ(pxValue, band->nodataval)) { + else if (!isnodata) { band->isnodata = FALSE; return FALSE; } -- 2.40.0