r.out.xyz.html 2.2 KB

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