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