]> granicus.if.org Git - postgis/commitdiff
Fix ST_InvDistWeigh4MA() to handle a situation when neighborhood is
authorBborie Park <bkpark at ucdavis.edu>
Thu, 21 Mar 2013 21:28:05 +0000 (21:28 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Thu, 21 Mar 2013 21:28:05 +0000 (21:28 +0000)
empty except the center pixel.

git-svn-id: http://svn.osgeo.org/postgis/trunk@11194 b70326c6-7e19-0410-871a-916f4a2858ee

raster/rt_pg/rtpostgis.sql.in

index 540f964dc062ccf30e373dd4711b2a3cc807adc8..f3af59f727e7f2396f876419e88c0edcf60faaa0 100644 (file)
@@ -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;