r.out.vtk.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <h2>DESCRIPTION</h2>
  2. Outputs <i>raster</i> maps in <i>VTK-ASCII</i> format. <i>Map's</i> are
  3. valid raster map's in the current mapset. <i>output</i> is the name of
  4. an VTK-ASCII file which will be written in the current working directory.
  5. If <i>output</i> is not specified then <b>stdout</b> is used.
  6. The module is sensitive to region settings (set with g.region).
  7. <p>
  8. Elevation, scaling, point/celldata, vector and RGB Data are supported.
  9. If the map is in LL projection, the elevation values will automatically scaled to
  10. degrees. It is supposed that the elevation values are provided in meters.
  11. If the elevation values are in a different unit than meters, use
  12. the scale parameter to convert the units.
  13. <p>
  14. If no elevation map is given, the user can set the hight of the map by one value.
  15. Point or cell data are available. Also scaling is supported for this elevation value.
  16. The elevation value must be provided in meters.
  17. <p>
  18. The RGB input requires three raster maps: red, green, blue - in this order.
  19. The maps must have values between 0 and 255, otherwise you will get lots of warnings
  20. and the values are set to 0.
  21. More than one RGB dataset (3 maps) is not supported.
  22. <p>
  23. The vector input requires three raster maps: x, y, z -- defining the vector coordinates - in this order.
  24. More than one vector dataset (3 maps) is not supported.
  25. <h2>NOTES</h2>
  26. This filter generates:
  27. <ul>
  28. <li><i>structured points</i> with <i>celldata</i> or <i>pointdata</i> if no elevationfile is given</li>
  29. <li><i>structured grid</i> (not recommendet) with <i>pointdata</i> if an elevationfile is given</li>
  30. <li><i>polydataset</i> with <i>pointdata</i> if an elevationfile is given (default)</li>
  31. </ul>
  32. and puts this in a simple VTK-ASCII file. Nor XML or
  33. binary output are supported. It is possible to choose more then one raster map
  34. to be written to the VTK-ASCII file. Each cell-/pointdata is named like the raster map it represents.
  35. You can visualize this file with the
  36. <em><a href="http://www.vtk.org">VTK Toolkit</a></em>,
  37. <em><a href="http://www.paraview.org">Paraview</a></em> and
  38. <em><a href="http://mayavi.sourceforge.net">MayaVi</a></em> which are based on VTK.
  39. If you have a raster map with partly no data, use the threshold filter in paraview to
  40. visualize the valid data. Just filter all data which is greater/lesser than the
  41. chosen null value in the VTK-ASCII file.
  42. <br>
  43. If elevation map is chosen, a polygonal grid is created with <i>quads</i>,
  44. but the user can choose also <i>triangle strips</i> or <i>vertices</i>.
  45. These dataformats a documented at <em><a href="http://www.vtk.org">VTK Toolkit</a></em>.
  46. <p>
  47. If the "-c" flag is used and the data should be visualised together with other data exported via *.out.vtk
  48. modules, be sure the "-c" flag was also set in these modules.
  49. But this will only work with data from the SAME location
  50. (The reference point for the coordinates transformation is based on the center point of the default region).
  51. <h3>Difference between point- and celldata</h3>
  52. r.out.vtk can export raster cells with different representations.
  53. <ul>
  54. <li>
  55. <i>pointdata</i> -- the cells/values are represented by the center of the cell.
  56. Instead of cells, points are created. Each point can hold different values,
  57. but the user can only visualize one value at a time. These points can
  58. be connected in different ways.
  59. </li>
  60. <li>
  61. <i>celldata</i> -- is only provided if no elevation map is given.
  62. The cells are created with the same hight and width as in GRASS. Each cell
  63. can hold different values, but the user can only visualize one value at a time.
  64. </li>
  65. </ul>
  66. <h2>EXAMPLE</h2>
  67. <h3>Simple Spearfish example</h3>
  68. <div class="code"><pre>
  69. # set region
  70. g.region n=4926970 s=4914857 w=591583 e=607793 res=50 -p
  71. # export the data
  72. r.out.vtk input=elevation.10m,slope,aspect elevation=elevation.10m output=/tmp/out.vtk
  73. # visualize in Paraview or other VTK viewer:
  74. paraview --data=/tmp/out.vtk
  75. </pre></div>
  76. <h3>Spearfish example with RGB data</h3>
  77. <div class="code"><pre>
  78. #set the region
  79. g.region n=4926990 s=4914840 w=591570 e=607800 res=30 -p
  80. # using r.in.wms to create RGB data to get a satellite coverage
  81. r.in.wms layers=global_mosaic mapserver=http://wms.jpl.nasa.gov/wms.cgi \
  82. output=wms_global_mosaic
  83. # export the data to VTK
  84. r.out.vtk rgbmaps=wms_global_mosaic.red,wms_global_mosaic.green,wms_global_mosaic.blue \
  85. elevation=elevation.10m output=/tmp/out.vtk
  86. # visualize in Paraview or other VTK viewer:
  87. paraview --data=/tmp/out.vtk
  88. </pre></div>
  89. <b>Paraview RGB visualization notes</b><br>
  90. To achieve proper RGB overlay:
  91. <ul>
  92. <li> In Paraview, click "Apply"
  93. <li> Select the "Display" tab and choose "Color by" to switch from input scalars to rgb scalars
  94. <li> Disable the "Map Scalars" check button in the display tab to avoid the use of a lookup table
  95. </ul>
  96. <h2>SEE ALSO</h2>
  97. <em>
  98. <a href="r3.out.vtk.html">r3.out.vtk</a>,
  99. <a href="r.out.ascii.html">r.out.ascii</a>,
  100. <a href="g.region.html">g.region</a>
  101. </em>
  102. <br>
  103. <a href="http://grasswiki.osgeo.org/wiki/GRASS_and_Paraview">GRASS and Paraview Wiki page</a>
  104. <h2>AUTHOR</h2>
  105. Soeren Gebbert
  106. <p><i>Last changed: $Date$</i>