r.out.xyz.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <h2>DESCRIPTION</h2>
  2. The <em>r.out.xyz</em> module exports a raster map as a list of x,y,z
  3. values into an ASCII text file.
  4. <h2>NOTES</h2>
  5. This module will not export x,y coordinates for raster cells containing
  6. a NULL value. This includes cells masked by a raster MASK.
  7. <p>
  8. This module, as all GRASS raster modules, will export cells based on the
  9. current region settings. See the <em>g.region</em> module for details.
  10. <p>
  11. The <em>r.out.ascii</em> module should be used to export an array (of
  12. size row x column) containing z values.
  13. <p>
  14. <em>r.out.xyz</em> can combine several input raster maps, which can be
  15. convenient when it comes to e.g. produce ASCII point cloud files.
  16. <p>
  17. <em>r.out.xyz</em> is simply a front-end to "<tt>r.stats -1gn</tt>".
  18. <h2>EXAMPLES</h2>
  19. In this example, a LiDAR elevation map in the
  20. North Carolina sample dataset location is exported to CSV format.
  21. <div class="code"><pre>
  22. g.region rast=elev_lid792_1m -p
  23. r.out.xyz input=elev_lid792_1m output=elev_lid792_1m.csv separator=","
  24. </pre></div>
  25. <p>
  26. In this example, elevation data from the North Carolina dataset are
  27. exported along with R,G,B triplet of the related orthophoto into a
  28. combined file (requires the import of the supplementary high-resolution
  29. <a href="http://grass.osgeo.org/sampledata/north_carolina/ortho2010_t792_subset_20cm.tif">color orthophoto</a>, here called "ortho2010_t792"):
  30. <div class="code"><pre>
  31. g.region rast=elev_lid792_1m res=1 -a -p
  32. r.out.xyz input=elev_lid792_1m,ortho2010_t792.red,ortho2010_t792.green,ortho2010_t792.blue \
  33. separator=space output=pointcloud.asc
  34. # validate: X Y Z R G B
  35. head -n 3 pointcloud.asc
  36. 638300.5 220749.5 126.338218689 78 84 71
  37. 638301.5 220749.5 126.3381958008 93 101 86
  38. 638302.5 220749.5 126.3414840698 68 77 59
  39. </pre></div>
  40. <h2>TODO</h2>
  41. Implement this script as a <em>r.out.ascii</em> option?
  42. <h2>SEE ALSO</h2>
  43. <em>
  44. <a href="g.region.html">g.region</a>,
  45. <a href="r.mask.html">r.mask</a>
  46. <a href="r.out.ascii.html">r.out.ascii</a>,
  47. <a href="r.stats.html">r.stats</a>
  48. </em>
  49. <h2>AUTHOR</h2>
  50. M. Hamish Bowman<br>
  51. <i>Dept. Marine Science<br>
  52. Otago University, New Zealand</i>
  53. <p><i>Last changed: $Date$</i>