[GRASS-user] Issue with addon r.vif in MS Windows GUI installations (stand-alone v. 7.2.2 and 7.0.5)

Helmut Kudrnovsky hellik at web.de
Fri Feb 2 11:51:47 PST 2018


>Any idea how I can do that in such a way that it works on both Linux and
Windows?

in r.vif script I've changed the relevant lines:

<----------------------------------------
    # Get the raster values at sample points
    fd, tmpcov = tempfile.mkstemp()
    with open(tmpcov, "w") as text_file:
        text_file.write(
                gs.read_command("r.stats", flags="1n", input=raster,
                                quiet=True, separator="comma"))
    p = np.loadtxt(tmpcov, skiprows=0, delimiter=",")

    # Clean up
    text_file.close()
    os.close(fd)
    os.remove(tmpcov)
    if not n == "100%":
        gs.run_command("r.mask", flags="r", quiet=True)
        if exist_mask['fullname']:
            gs.run_command("g.rename", raster=[mask_backup, "MASK"],
                           quiet=True)
    return(p)
---------------------------------------->

and tested the script in winGRASS; it seems to work in windows; not tested
on linux and mac.




-----
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html


More information about the grass-user mailing list