Re: Issue with addon r.vif in MS Windows GUI installations (stand-alone v. 7.2.2 and 7.0.5)
Paulo van Breugel <[email protected]>
| Newsgroups | gmane.comp.gis.grass.user |
|---|---|
| Message-ID | <[email protected]> |
On February 2, 2018 8:52:03 PM Helmut Kudrnovsky <[email protected]> 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 > [email protected] > https://lists.osgeo.org/mailman/listinfo/grass-user _______________________________________________ grass-user mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/grass-user