Thanks Stephan, I'm aware of rgrass7 and spgrass6 -- I had in mind a package a lot lighter, that basically "hides" the specificities of GRASS (eg the notions of GRASSDATA, of locations, of mapsets...) from the user, and just run a GRASS command on a GDAL/OGR type file.
Cheers, P On 16 August 2018 at 20:37, Stefan Blumentrath <[email protected]> wrote: > Dear Pierre, > > Just in case you are not aware of it, GRASS and R integrate very nicely: > https://grasswiki.osgeo.org/wiki/R_statistics/rgrass7 > > Cheers, > Stefan > > -----Original Message----- > From: grass-user <[email protected]> On Behalf Of Pierre > Roudier > Sent: torsdag 16. august 2018 10:07 > To: Vaclav Petras <[email protected]> > Cc: GRASS user list <[email protected]> > Subject: Re: [GRASS-user] New CLI option --tmp-location in 7.5 to enhance > --exec > > Thanks Vaclav, > > Looks like a great enhancement. It should make it easy to wrap it into a R > package for example. > > One question -- is that possible to refer to the input dataset in the script > called by --exec? Something like: > > grass --tmp-location ~/data/elevation.tiff --exec "r.param.scale in=myinput > out=myoutput param=slope size=9" > > Cheers, > > P > > On 15 August 2018 at 15:20, Vaclav Petras <[email protected]> wrote: >> Dear user list, >> >> The (main) GRASS GIS executable, usually available as simply `grass` >> on most systems has now a new option (flag/parameter) in trunk (aka >> 7.5). The option is called --tmp-location. >> >> When specified, GRASS GIS automatically creates an new (and empty) >> location based on provided EPSG code or georeferenced file (similarly >> to what -c flag does). Newly it is also possible to provide string >> "XY" instead of EPSG to create XY (non-georeferenced) location. >> >> This temporary location has only PERMANENT mapset and the whole >> location is removed. The location is created in a temporary directory >> (which is also deleted at the end). >> >> The flag --tmp-location is meant to be used together with --exec and >> it is a part of a lager endeavor to make the CLI easier for use from >> outside of the GRASS GIS session. >> >> If you are interested, please, test this new functionality. It is an >> opportunity to provide feedback before this feature lands in the 7.6 >> release. >> >> Here are some things to try: >> >> * Execute a module in a location created based on EPSG: >> >> grass --tmp-location EPSG:3358 --exec g.region -p >> >> * Execute Python script in a location created based on EPSG: >> >> grass --tmp-location EPSG:3358 --exec script.py >> >> * Examine the created location using a Bash command: >> >> grass --tmp-location EPSG:3358 --exec bash -c "g.proj -p && g.region >> -p && g.mapset -p && g.gisenv GISDBASE,LOCATION_NAME sep=/" >> >> * Get SRS/CRS for a file: >> >> grass --tmp-location ~/data/elevation.tiff --exec g.proj -p >> >> * Get help text for a module: >> >> grass --tmp-location XY --exec r.neighbors --help >> >> See the documentation and `grass --help` for more hints (and let me >> know how these can be enhanced). >> >> Best regards, >> Vaclav >> >> >> https://trac.osgeo.org/grass/ticket/3537 >> https://trac.osgeo.org/grass/ticket/3585 >> https://trac.osgeo.org/grass/ticket/3586 >> https://trac.osgeo.org/grass/changeset/72790 >> https://trac.osgeo.org/grass/changeset/73096 >> https://trac.osgeo.org/grass/changeset/73098 >> https://trac.osgeo.org/grass/changeset/73099 >> >> >> >> _______________________________________________ >> 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 _______________________________________________ grass-user mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/grass-user
