New answers tagged

1

Yes. You can run r.report from the command line on one file like this: grass --tmp-location foo.tif --exec bash -c "r.external input=foo.tif output=foo; r.report foo" And if you have many, I would suggest using GNU parallel (https://www.gnu.org/software/parallel/). Perhaps something like: parallel --bar "grass --tmp-location {1} --exec bash -...


5

If you have rename installed on you system, you can also use: rename oldname newname oldname.* or if you prefer a regex: rename 's/oldname/newname/g' oldname.* If you don't have rename, you can install it with your package manager, e.g. apt: sudo apt install rename


3

Here is my little tool to "move shapes" coded in Perl. If more "sidecar files" show up, append them to the line. # Shape file extention candidates + so called side car files my @ext = qw(shp shx dbf prj sbn sbx fbn fbx atx ixs mxs cpg); May be it is a little bit noisy in terms of output. #!/usr/bin/env perl # -----------------------------...


8

Expanding from this answer https://stackoverflow.com/questions/9558986/what-does-the-curly-brace-syntax-var-mean/9559024#9559024 it is possible to do for f in oldname.*; do mv -- "$f" "newname${f#oldname}" done


1

Newer versions of GDAL now have a -json output which can easily be parsed with jq. For example gdalinfo -json file.tif | jq -r .cornerCoordinates.upperLeft


1

This should work in Ubuntu 20.04: export GISBASE=/lib/grass78/ export PATH=$PATH:$GISBASE/bin:$GISBASE/scripts export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GISBASE/lib if [ ! "$PYTHONPATH" ] ; then PYTHONPATH="$GISBASE/etc/python" else PYTHONPATH="$GISBASE/etc/python:$PYTHONPATH" fi export PYTHONPATH export GIS_LOCK=$$...


1

I suggest that you read the documentation on the GRASS Wiki page. There are several steps needed to set up the GRASS environment. My answer will mostly be some copy/paste of this page in order to avoid a "link only" answer. # Example in bash shell syntax: # path to GRASS binaries and libraries: export GISBASE=/usr/lib64/grass78 ...


Top 50 recent answers are included