[GRASS-user] r.in.xyz can now read from stdin

Hamish hamish_nospam at yahoo.com
Wed Jul 11 03:32:16 EDT 2007


Hi,

I just added redirection from stdin support to r.in.xyz. Everything seems to
work, but of course testing is appreciated.

This bypasses the bulk of the code which may trigger LFS issues for
very large input files (many GB). ie it skips scanning the filesize --
which was only needed for G_percent() anyway.

You can't rewind a piped stream so the percent= multi-pass option won't
work, and it must keep 100% of the raster map in memory. (limits region
size) Hopefully if you are working with massive datasets you already
have lots of RAM installed.

I used G_clicker()- I'm pretty sure it does not have GUI hooks like
G_percent() does for the progress bar, but then you can't feed data from
stdin using the GUI so you can't trigger it anyway. (this is the
\b\b\b\b\b... GUI window output problem)


Q: is realloc() needed here? it works for me but I'm not sure if it'll
segfault for someone someday.

char   *infile;
...
infile = input_opt->answer;
...
if (strcmp ("-", infile) == 0) {
   from_stdin = TRUE;
   ...
   strcpy(infile, "stdin"); /* filename for history metadata */

?


I found that the new r.colors inverse + equalized color flags make the
Jockey's Ridge, NC sample LIDAR dataset look really nice. It brings
out the ground features (roads, homes) well without having to manually
filter-out the bogus outliers.


=============================
Re: [GRASS-user] Re: some interesting tools for working with LAS format

Dylan wrote:
> > Perhaps we can talk to these people, and integrate a LAS reader into
> > GRASS, or better yet figure out how to use it with r.in.xyz!

Bernhard Hoefle wrote:
> the LAS Tools by M. Isenburg
...
> The tool "las2txt" can be used to generate ASCII Files that can be
> imported with r.in.xyz or v.in.ascii.

Dylan:
> As a start we can include references to the LAS tools in the relevant
> man pages and wiki, with build and useage examples. This would get
> new users up to speed on the 'toolchain' approach to processing data
> with GRASS+external tools.

now:
 las2txt | r.in.xyz in=- fs=''


enjoy,

Hamish




More information about the grass-user mailing list