[GRASS-user] hint about r.out.xyz

Hi again dear grass users,

fiddling with point cloud data, I notice a capability of r.out.xyz which
is neither documented nor allowed from the gui interface, at least in
GRASS 6.4.

In order to produce an ascii pointcloud file following this pattern :
x y z r g b
(i.e. each point of the cloud is described by its coordinates picked
from an elevation raster and a RGB value picked from an imagery raster)
I ran several r.out.xyz commands, then joined the result in a single
file cloud.dat by piping three join commands.

Anyway, later I accidentally typed :
r.out.xyz fs=" " in=elev,map.red,map.green,map.blue out=cloud.dat

... and it produced the right pointcloud in one go.

Perhaps it can be useful (tell me if I miss something rhedibitory with
this usage) :
- to update the module documentation
- to allow multiple input selection from the gui interface.

Yours,
Vincent.

On Mon, Nov 25, 2013 at 2:25 PM, Vincent Bain <bain@toraval.fr> wrote:

Hi again dear grass users,

fiddling with point cloud data, I notice a capability of r.out.xyz which
is neither documented nor allowed from the gui interface, at least in
GRASS 6.4.

In order to produce an ascii pointcloud file following this pattern :
x y z r g b
(i.e. each point of the cloud is described by its coordinates picked
from an elevation raster and a RGB value picked from an imagery raster)
I ran several r.out.xyz commands, then joined the result in a single
file cloud.dat by piping three join commands.

Anyway, later I accidentally typed :
r.out.xyz fs=" " in=elev,map.red,map.green,map.blue out=cloud.dat

... and it produced the right pointcloud in one go.

Welcome, you found an undocumented "bug" (here: feature) :slight_smile:

Perhaps it can be useful (tell me if I miss something rhedibitory with
this usage) :
- to update the module documentation
- to allow multiple input selection from the gui interface.

The reason is: r.out.xyz is simply a front-end to "r.stats -1gn" which
accepts multiple input.

The change (if desired) would be as simple as this:

svn diff
Index: r.out.xyz

--- r.out.xyz (revision 58314)
+++ r.out.xyz (working copy)
@@ -24,6 +24,7 @@
#% gisprompt: old,cell,raster
#% key_desc: name
#% description: Name of input raster map
+#% multiple: yes
#% required: yes
#%end
#%option

Then also the GUI supports it automatically...

If there are no objections, I could add this in SVN.
Perhaps you could send me a manual page snipped to be included?

Markus

On Wed, Nov 27, 2013 at 11:33 PM, Markus Neteler <neteler@osgeo.org> wrote:

On Mon, Nov 25, 2013 at 2:25 PM, Vincent Bain <bain@toraval.fr> wrote:

Hi again dear grass users,

fiddling with point cloud data, I notice a capability of r.out.xyz which
is neither documented nor allowed from the gui interface, at least in
GRASS 6.4.

In order to produce an ascii pointcloud file following this pattern :
x y z r g b

...

The change (if desired) would be as simple as this:

...

If there are no objections, I could add this in SVN.
Perhaps you could send me a manual page snipped to be included?

All available now in 6.4.svn, http://trac.osgeo.org/grass/changeset/58378
(likewise for G6.5.svn and G7.svn)

cheers
Markus