>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
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to