[GRASS-dev] [GRASS GIS] #2721: t.rast.what: allow stdin and add to GRASS 7.0

#2721: t.rast.what: allow stdin and add to GRASS 7.0
-------------------------+-------------------------
Reporter: sbl | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.2
Component: Default | Version: unspecified
Keywords: t.rast.what | CPU: Unspecified
Platform: All |
-------------------------+-------------------------
Please find attached a diff which allows t.rast.what to read from stdin.
That way it becomes also possible to add a site name to the output, which
is pretty useful for later useage of it...
The site name is only propagated to the output, when a site name has been
provided in the (first line of the) input.

There are probably more elegant solutions for this, so improvements are
very welcome. I did not update the manual and the test suite yet, but I
will try to do so, if you consider this addition useful too...

For users with "commandlineophobia" it would be probably better to specify
coordinates using the file option G_OPT_F_INPUT?

Furthermore, the script works very well in GRASS 7.0 too. Any particular
reason for not shipping it with the stable release? t.rast.what is a
pretty handy tool!

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

#2721: t.rast.what: allow stdin and add to GRASS 7.0
--------------------------+-------------------------
  Reporter: sbl | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.0.2
Component: Default | Version: unspecified
Resolution: | Keywords: t.rast.what
       CPU: Unspecified | Platform: All
--------------------------+-------------------------
Changes (by sbl):

* Attachment "t.rast.what.diff" added.

Allow t.rast.what to read from stdin

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

#2721: t.rast.what: allow stdin and add to GRASS 7.0
--------------------------+-------------------------
  Reporter: sbl | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.0.2
Component: Default | Version: unspecified
Resolution: | Keywords: t.rast.what
       CPU: Unspecified | Platform: All
--------------------------+-------------------------

Comment (by huhabla):

I have applied your patch in r65964 with some modifications. Thanks a lot
for this improvement. I have introduced the flag "-i" to expect stdin
input, otherwise stdin.read() will block if coordinates or point input are
not set.

About a backport to 7.0.*, t.rast.what is still alpha or beta state, it
should be further improved [*] and more tested before backporting.

[*] Supporting site names from vector files, input files with coordinates,
output transformation with lower memory footprint, ...

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

#2721: t.rast.what: allow stdin and add to GRASS 7.0
--------------------------+-------------------------
  Reporter: sbl | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.0.2
Component: Default | Version: unspecified
Resolution: | Keywords: t.rast.what
       CPU: Unspecified | Platform: All
--------------------------+-------------------------
Changes (by sbl):

* Attachment "t.rast.what_fileinput.diff" added.

Add file input option to t.rast.what

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

#2721: t.rast.what: allow stdin and add to GRASS 7.0
--------------------------+-------------------------
  Reporter: sbl | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.0.2
Component: Default | Version: unspecified
Resolution: | Keywords: t.rast.what
       CPU: Unspecified | Platform: All
--------------------------+-------------------------

Comment (by sbl):

In order to support "input files with coordinates" I created a new tiny
diff. Please review. I can update the manual accordingly, if you like.

For site names from vector files I guess r.what should be improved first,
don`t you think?

Would you mind if I try to get the script into the new GRASS plugin in
QGIS, marking it as experimental? This module is definitely a good
candidate for functionality users with limited knowledge of GRASS / TGIS
can benefit from very much... And a nice teaser for the power of TGIS...

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

#2721: t.rast.what: allow stdin and add to GRASS 7.0
--------------------------+-------------------------
  Reporter: sbl | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.0.2
Component: Default | Version: unspecified
Resolution: | Keywords: t.rast.what
       CPU: Unspecified | Platform: All
--------------------------+-------------------------

Comment (by neteler):

Just for the record: there is also a new t.rast.whatcsv. See

https://svn.osgeo.org/grass/grass-
addons/grass7/temporal/t.rast.whatcsv/t.rast.whatcsv.html

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

#2721: t.rast.what: allow stdin and add to GRASS 7.0
--------------------------+-------------------------
  Reporter: sbl | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.0.4
Component: Default | Version: unspecified
Resolution: | Keywords: t.rast.what
       CPU: Unspecified | Platform: All
--------------------------+-------------------------
Changes (by sbl):

* milestone: 7.0.3 => 7.0.4

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

#2721: t.rast.what: allow stdin and add to GRASS 7.0
--------------------------+-------------------------
  Reporter: sbl | Owner: grass-dev@…
      Type: enhancement | Status: closed
  Priority: normal | Milestone: 7.2.0
Component: Default | Version: unspecified
Resolution: fixed | Keywords: t.rast.what
       CPU: Unspecified | Platform: All
--------------------------+-------------------------
Changes (by martinl):

* status: new => closed
* resolution: => fixed
* milestone: 7.0.5 => 7.2.0

Comment:

The patch is part of GRASS 7.2, changing the milestone and closing.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2721#comment:7&gt;
GRASS GIS <https://grass.osgeo.org>