Opened 9 years ago
Closed 8 years ago
#2721 closed enhancement (fixed)
t.rast.what: allow stdin and add to GRASS 7.0
Reported by: | sbl | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.2.0 |
Component: | Default | Version: | unspecified |
Keywords: | t.rast.what | Cc: | |
CPU: | Unspecified | Platform: | All |
Description
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!
Attachments (2)
Change History (9)
by , 9 years ago
Attachment: | t.rast.what.diff added |
---|
comment:1 by , 9 years ago
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, ...
comment:2 by , 9 years ago
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.
Maybe the coordinates option can be removed as the same functionality is available through file/stdin input? Just a proper check of the input coordinates pair(s) is missing...
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...
comment:3 by , 9 years ago
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
comment:5 by , 9 years ago
Milestone: | 7.0.3 → 7.0.4 |
---|
comment:6 by , 9 years ago
Milestone: | 7.0.4 → 7.0.5 |
---|
comment:7 by , 8 years ago
Milestone: | 7.0.5 → 7.2.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
The patch is part of GRASS 7.2, changing the milestone and closing.
Allow t.rast.what to read from stdin