Explorar el Código

i.oif: Fixed r.covar output parsing (backport of https://trac.osgeo.org/grass/changeset/61288)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@61289 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler hace 10 años
padre
commit
4a5ac0d331
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      scripts/i.oif/i.oif.py

+ 4 - 1
scripts/i.oif/i.oif.py

@@ -125,7 +125,10 @@ def main():
     correlation = {}
     s = grass.read_command('r.covar', flags='r', map=[band for band in bands],
                            quiet=True)
-    for i, row in zip(bands, s.splitlines()):
+
+    # We need to skip the first line, since r.covar prints the number of values
+    lines = s.splitlines()
+    for i, row in zip(bands, lines[1:]):
         for j, cell in zip(bands, row.split(' ')):
             correlation[i, j] = float(cell)