[GRASS-dev] r3.in.xyz

Hamish hamish_b at yahoo.com
Tue Dec 6 23:18:29 EST 2011


Helena wrote:
> has anybody considered writing r3.in.xyz? 
> It could be useful for analyzing multiple return lidar
> point clouds and terrestrial lidar point clouds of vertical
> features such as eroding stream banks.
> I wanted to ask before we look into it here,

yes, it is very easy; all you need to do is run r.in.xyz in a loop,
iterating on the zrange=. It is easily accomplished with a wrapper
script, no need to adjust (ie clutter) the C code. Stand by and I'll
upload one to addons. Due to memory concerns I don't think that
slicing up the segments in smaller 3D cubes versus larger 2D slices
would actually help much, except for very small 3D regions, so there
is not much of a performance hit by using a script.


from the r.in.xyz man page:
       The  zrange  parameter  may be used for filtering the input
       data by vertical extent. Example uses might include prepar-
       ing  multiple  raster  sections  to  be  combined into a 3D
       raster array with r.to.rast3, or for filtering outliers  on
       relatively flat terrain.


The only code change to consider is:
-  if (z < zrange_min || z > zrange_max) {
+  if (z < zrange_min || z >= zrange_max) {
        G_free_tokens(tokens);
        continue;
   }

so points falling exactly on the upper bound of the range are considered
only once, and belong to the horizontal slice above the current one.


Hamish


More information about the grass-dev mailing list