[GRASS-dev] [GRASS GIS] #195: -g flag in r.proj/v.proj for easily-parsable output for use in scripts

#195: -g flag in r.proj/v.proj for easily-parsable output for use in scripts
-------------------------------------------+--------------------------------
Reporter: epatton | Owner: grass-dev@lists.osgeo.org
     Type: enhancement | Status: new
Priority: trivial | Milestone: 6.4.0
Component: Raster | Version: svn-trunk
Keywords: r.proj, output, print, script | Platform: Linux
      Cpu: x86-64 |
-------------------------------------------+--------------------------------
Hi,

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.
}}}

Thanks,

~ Eric.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/195&gt;
GRASS GIS <http://grass.osgeo.org>

#195: -g flag in r.proj/v.proj for easily-parsable output for use in scripts
--------------------------+-------------------------------------------------
  Reporter: epatton | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: trivial | Milestone: 6.4.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.proj, output, print, script
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Changes (by neteler):

  * platform: Linux => All
  * cpu: x86-64 => All

Comment:

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).

Markus

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/195#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#195: -g flag in r.proj/v.proj for easily-parsable output for use in scripts
--------------------------+-------------------------------------------------
  Reporter: epatton | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: trivial | Milestone: 6.4.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.proj, output, print, script
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Comment (by neteler):

Do ticket #845 and changes in 6.5svn (r40559) and trunk in r40560) help?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/195#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#195: -g flag in r.proj/v.proj for easily-parsable output for use in scripts
--------------------------+-------------------------------------------------
  Reporter: epatton | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: trivial | Milestone: 6.4.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.proj, output, print, script
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Comment (by hamish):

Replying to [comment:2 neteler]:
> Do ticket #845 and changes in 6.5svn (r40559) and trunk in r40560) help?

Yes. Although not exactly in the way Eric envisioned, I think the new -g
flag will make it possible to accomplish the same thing in a script.

Eric, any comments before closing this one?

Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/195#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#195: -g flag in r.proj/v.proj for easily-parsable output for use in scripts
--------------------------+-------------------------------------------------
  Reporter: epatton | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: closed
  Priority: trivial | Milestone: 6.4.0
Component: Raster | Version: svn-trunk
Resolution: worksforme | Keywords: r.proj, output, print, script
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Changes (by epatton):

  * status: new => closed
  * resolution: => worksforme

Comment:

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.

~ Eric.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/195#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>