Opened 15 years ago
Closed 13 years ago
#195 closed enhancement (worksforme)
-g flag in r.proj/v.proj for easily-parsable output for use in scripts
|Reported by:||epatton||Owned by:|
|Keywords:||r.proj, output, print, script||Cc:|
Currently r.proj -l spits out a tab-separated list of rasters; I would like to request a -g flag to print out rasters (and vectors with v.proj) one per line so it's easily parsable in one-liner scripts a la:
for MAP in `r.proj -g location=spearfish mapset=PERMANENT` ; do r.proj $MAP ...etc.
Change History (4)
comment:1 by , 15 years ago
|CPU:||x86-64 → All|
|Platform:||Linux → All|
follow-up: 3 comment:2 by , 13 years ago
comment:3 by , 13 years ago
comment:4 by , 13 years ago
|Status:||new → closed|
Originally, I wanted to create a list of rasters from outside the current Location for batch-reprojecting into the current Location. I don't follow how the -g flag will really accomplish this, but then it is Monday morning. Regardless, I think the new functionality of the -g flag will be quite useful in its own right.
As for the initial wish, I guess I could always go to the Location of the rasters that are to be reprojected, create the list with g.mlist > list.txt, then use that as input to a r.proj one-liner script.
Anyway, I'd say its ok to close this one, thanks.
Sounds reasonable. r.proj (indeed it is r.proj.seg) use G_list_element() which needs an extra parameter for that (hence an update to all modules/libs which use this function (defined in lib/gis/list.c).