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

Paulo van Breugel p.vanbreugel at gmail.com
Sat Feb 3 00:13:59 PST 2018



On February 2, 2018 8:52:03 PM Helmut Kudrnovsky <hellik at web.de> wrote:

>>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.
>
>
Ok, thanks Helmut, I'll see if that works in Linux too
>
> -----
> best regards
> Helmut
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20180203/d5c55955/attachment.html>


More information about the grass-user mailing list