|
On 27/04/2019 22:05, Mehrdad Varedi
wrote:
Maybe this will help: (You must have GRASS installed, of course)
# Parameters for the GRASS installation and temporary GRASS mapset GISBase = "/usr/lib/grass76" GISDbase = "/tmp" # Now run the 'grass' command within R and # use the -c and -e flags to create the temp
mapset, then exit setup_grass_cmd = paste("grass", "-c", georef, "-e", mapset_path) system(setup_grass_cmd)
# Load the R grass interface and initialize GRASS within R, # using the temporary mapset from above library(rgrass7)
# Try some GRASS commands input_tif = "isrlat12.tif" grass_rast = "isrlat12" I did not add a command to remove the temporary mapset. Something like: unlink(file.path(GISDbase, Location), recusive = TRUE) might be necessary
One other note: you probably will get better suggestions on the R-sig-geo list...
-- Micha Silver Ben Gurion Univ. Sde Boker, Remote Sensing Lab cell: +972-523-665918 |
_______________________________________________ grass-user mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/grass-user
