From: Bborie Park Date: Thu, 21 Mar 2013 21:28:05 +0000 (+0000) Subject: Fix ST_InvDistWeigh4MA() to handle a situation when neighborhood is X-Git-Tag: 2.1.0beta2~154 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=12926cc45af55e74406af49614f10ece26cc6941;p=postgis Fix ST_InvDistWeigh4MA() to handle a situation when neighborhood is empty except the center pixel. git-svn-id: http://svn.osgeo.org/postgis/trunk@11194 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/raster/rt_pg/rtpostgis.sql.in b/raster/rt_pg/rtpostgis.sql.in index 540f964dc..f3af59f72 100644 --- a/raster/rt_pg/rtpostgis.sql.in +++ b/raster/rt_pg/rtpostgis.sql.in @@ -3367,7 +3367,12 @@ CREATE OR REPLACE FUNCTION st_invdistweight4ma(value double precision[][][], pos -- neighborhood is NODATA IF z IS NULL OR array_length(z, 1) < 1 THEN - RETURN NULL; + -- center pixel has value + IF cv IS NOT NULL THEN + RETURN cv; + ELSE + RETURN NULL; + END IF; END IF; z0 := 0;