Просмотр исходного кода

r.blend: fix NULL handling

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@53624 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 12 лет назад
Родитель
Сommit
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..."))
 
-    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 = ';'.join(cmd)