소스 검색

r.blend: fix NULL handling

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@53624 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 12 년 전
부모
커밋
4151f6f2ee
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      scripts/r.blend/r.blend.py

+ 1 - 1
scripts/r.blend/r.blend.py

@@ -75,7 +75,7 @@ def main():
 
 
     grass.message(_("Calculating the three component maps..."))
     grass.message(_("Calculating the three component maps..."))
 
 
-    template = string.Template("$$output.$ch = $$frac1 * $ch#$$first + $$frac2 * $ch#$$second")
+    template = string.Template("$$output.$ch = if(isnull($$first), $ch#$$second, if(isnull($$second), $ch#$$first, $$frac1 * $ch#$$first + $$frac2 * $ch#$$second))")
     cmd = [template.substitute(ch = ch) for ch in ['r','g','b']]
     cmd = [template.substitute(ch = ch) for ch in ['r','g','b']]
     cmd = ';'.join(cmd)
     cmd = ';'.join(cmd)