<div dir="ltr"><div class="gmail_extra">[Switching from grass-user to grass-dev.]<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 1, 2017 at 5:11 PM, Markus Metz <span dir="ltr"><<a href="mailto:markus.metz.giswork@gmail.com" target="_blank">markus.metz.giswork@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-"><div>> > Is it different from the binning code in <a href="http://r.in.xyz" target="_blank">r.in.xyz</a> ?<br>><br>><br>> Not really. r.in.lidar was based on <a href="http://r.in.xyz" target="_blank">r.in.xyz</a>, now they are different but of course the idea is to make them again as similar as possible.<br><br></div></span>I would rather keep <a href="http://r.in.xyz" target="_blank">r.in.xyz</a> as simple as possible and instead add wrapper scripts for specific tasks. Maybe r.in.lidar could be sync'ed back to <a href="http://r.in.xyz" target="_blank">r.in.xyz</a> and a new wrapper script could be created, something like r.in.lidar.filter ;-)<span class="gmail-"><br></span></blockquote><div><br></div><div>I was perhaps not clear enough. The code of r.in.lidar and <a href="http://r.in.xyz">r.in.xyz</a> is the same even now except for the separation of the binning code and LAS versus ASCII. There is some filtering related to lidar, but I don't understand if it is what you mean. Nevertheless, some filtering in <a href="http://r.in.xyz">r.in.xyz</a> and getting some functionality from r.in.lidar would make sense (as they are used interchangeably depending on libLAS availability); unfortunately not really making it simpler.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-"><div>> ><br>> >><br>> >> Anyway, a new module needs to be implemented for this. The name can be<br>> >> something like r.binning, r.vect.stats, r.point.stats, or<br>> >> r.points.stats. It might good project for beginners.<br>> ><br>> ><br>> > I like the idea. But do you really think this would be much faster than v.out.ascii | <a href="http://r.in.xyz" target="_blank">r.in.xyz</a> ?<br>><br>><br>> I don't know if much faster, but it will be at least little faster. Another issue is that "v.out.ascii | <a href="http://r.in.xyz" target="_blank">r.in.xyz</a>" is little hard to do on MS Windows and from GUI in general. Yes, there should have been a wrapper module for this already, but the a module to do the task directly is seems to me as a better solution<br><br></div></span><div>Why would a new C module be a better solution than a simple wrapper combining v.out.ascii + <a href="http://r.in.xyz" target="_blank">r.in.xyz</a>? Considering code maintenance, a wrapper script would be easier to maintain. Otherwise, a dedicated C module would be another clone of <a href="http://r.in.xyz" target="_blank">r.in.xyz</a>, taking as input not a text file but a GRASS vector with points.<br></div></blockquote></div><br></div><div class="gmail_extra">I agree, script would be easier to maintain, but considering the duplication between <a href="http://r.in.xyz">r.in.xyz</a> and r.in.lidar (and possibly also r.in.pdal which I haven't mentioned yet), I though moving the binning code to the library and perhaps gaining some performance improvement along the way is a better option.<br><br>But I'm not against a wrapper. I added a prototype with limited functionality to addons [1]. However, I'm not sure how to account for large data - that's what discouraged me from creating a wrapper. The Python subprocess documentation says use communicate() but its doc says "The data read is buffered in memory, so do not use this method if the data
size is large or unlimited." [2] Do I have to do the buffering myself then or is it just fine? Is there some code like this in GRASS?<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Thanks for the feedback,<br></div><div class="gmail_extra">Vaclav<br><br>[1] <a href="https://trac.osgeo.org/grass/changeset/70996">https://trac.osgeo.org/grass/changeset/70996</a><br>[2] <a href="https://docs.python.org/2/library/subprocess.html#subprocess.Popen.communicate">https://docs.python.org/2/library/subprocess.html#subprocess.Popen.communicate</a><br></div></div>