raster3dintro.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <!-- meta page description: 3D raster data in GRASS GIS -->
  2. <!-- meta page index: raster3d -->
  3. <h3>3D raster maps in general</h3>
  4. GRASS GIS is one of the few GIS software packages with 3D raster data support.
  5. Data are stored as a 3D raster with 3D cells of a given volume.
  6. 3D rasters are designed to support representations of
  7. trivariate continuous fields.
  8. The vertical dimension supports spatial and temporal units.
  9. Hence space time 3D raster with different temporal resolutions
  10. can be created and processed.
  11. <p>
  12. GRASS GIS 3D raster maps use the same coordinate system as
  13. 2D raster maps (row count from north to south) with an additional z dimension (depth)
  14. counting from bottom to top. The upper left corner (NW) is the origin.
  15. 3D rasters are stored using a tile cache based approach. This allows arbitrary
  16. read and write operations in the created 3D raster. The size of the tiles
  17. can be specified at import time with a given import module such as
  18. <a href="r3.in.ascii.html">r3.in.ascii</a> or the data can be retiled using
  19. <a href="r3.retile.html">r3.retile</a> after import or creation.
  20. <div align="center" style="margin: 10px">
  21. <img src="raster3d_layout.png" border=0><br>
  22. <i>
  23. The 3D raster map coordinate system and the internal tile layout of
  24. the RASTER3D library
  25. </i>
  26. </div>
  27. <h3>Terminology and naming</h3>
  28. In GRASS GIS terminology, continuous 3D data represented by regular grid
  29. or lattice is called <em>3D raster map</em>.
  30. 3D raster map works in 3D in the same was as (2D) raster map in 2D,
  31. so it is called the same except for the additional 3D.
  32. Some literature or other software may use terms such as 3D grid, 3D lattice,
  33. 3D matrix, 3D array, volume, voxel, voxel model, or voxel cube.
  34. Note that terms volume and volumetric often refer to measuring
  35. volume (amount) of some substance which may or may not be related to 3D rasters.
  36. <p>
  37. Note that GRASS GIS uses the term 3D raster map or just 3D raster for short,
  38. rather than 3D raster layer because term map emphasizes
  39. the mapping of positions to values which is the purpose of 3D raster map
  40. (in mathematics, map or mapping is close to a term function)
  41. On the other hand, the term layer emphasizes overlaying or stacking up.
  42. The former is not the only operation done with data
  43. and the latter could be confusing in case of 3D raster data.
  44. <p>
  45. 3D raster map is divided into cells in the same way as the (2D) raster map.
  46. A cell is a cube or a (rectangular) cuboid depending on the resolution.
  47. The resolution influences volume of one cell.
  48. Some literature or other software may use terms such as volume, volume unit,
  49. volumetric pixel, volume pixel, or voxel.
  50. Note that voxel can be sometimes used to refer to a whole 3D raster
  51. and that for example in 3D computer graphics, voxel can denote object
  52. with some complicated shape.
  53. <p>
  54. Type of map and element name in GRASS GIS is called <code>raster_3d</code>.
  55. The module family prefix is <code>r3</code>.
  56. Occasionally, 3D raster related things can be
  57. referred differently, for example according to a programming language standards.
  58. This might be the case of some functions or classes in Python.
  59. <p>
  60. In GRASS GIS 3D rasters as stored in tiles which are hidden from user most
  61. of the time. When analyzing or visualizing 3D rasters user can create
  62. slices or cross sections. Slices can be horizontal, vertical, or general
  63. plains going through a 3D raster. Slices, especially the horizontal ones, may be
  64. called layers in some literature or some other software.
  65. Cross sections are general functions, e.g. defined by 2D raster, going through
  66. a 3D raster.
  67. Another often used term is an isosuface which has the same relation to
  68. 3D raster as contour (isoline) to a 2D raster. An isosurface is
  69. a surface that represent places with a constant value.
  70. <p>
  71. When 3D raster is used in the way that vertical dimension represents time
  72. 3D raster can be referred to as space time cubes (STC) or space time cube
  73. 3D raster. Some literature may also use space time voxel cube,
  74. space time voxel model or some other combination.
  75. <h3>3D raster import</h3>
  76. <h4>Import from external files</h4>
  77. The modules <a href="r3.in.ascii.html">r3.in.ascii</a> and
  78. <a href="r3.in.bin.html">r3.in.bin</a> supports
  79. generic x,y,z ASCII and binary array import.
  80. <p>
  81. In case of CSV tables, the modules <a href="v.in.ascii.html">v.in.ascii</a>
  82. (using the <b>-z</b> flag) may be a choice to first import the 3D points
  83. as vector points and the convert them to 3D raster (see below).
  84. <p>
  85. Import of 3D (LiDAR) points and their statistics can be done using
  86. <a href="r3.in.lidar.html">r3.in.lidar</a> for LiDAR data and
  87. <a href="r3.in.xyz.html">r3.in.xyz</a> for CSV and other ASCII text
  88. formats.
  89. <h4>Conversion from 3D vector points</h4>
  90. 3D rasters can be generated from 3D point vector data
  91. (<a href="v.to.rast3.html">v.to.rast3</a>). Always the full map is imported.
  92. <h4>Conversion from 2D raster maps</h4>
  93. 3D raster can also be created based on 2D elevation map(s) and value raster map(s)
  94. (<a href="r.to.rast3elev.html">r.to.rast3elev</a>). Alternatively,
  95. a 3D raster can be composed of several 2D raster maps (stack of maps).
  96. 2D rasters are considered as slices in this case and
  97. merged into one 3D raster map (<a href="r.to.rast3.html">r.to.rast3</a>).
  98. <h3>3D region settings and 3D MASK</h3>
  99. GRASS GIS 3D raster map processing is always performed in the current 3D region
  100. settings (see <a href="g.region.html">g.region</a>, <em>-p3</em> flags), i.e.
  101. the current region extent, vertical extent and current 3D resolution are used.
  102. If the 3D resolution differs from that of the input raster map(s),
  103. on-the-fly resampling is performed (nearest neighbor resampling).
  104. If this is not desired, the input map(s) has/have to be reinterpolated
  105. beforehand with one of the dedicated modules.
  106. Masks can be set (<a href="r3.mask.html">r3.mask</a>).
  107. <h3>3D raster analyses and operations</h3>
  108. Powerful 3D raster map algebra is implemented in
  109. <a href="r3.mapcalc.html">r3.mapcalc</a>.
  110. A 3D groundwater flow model is implemented in <a href="r3.gwflow.html">r3.gwflow</a>.
  111. <h3>3D raster conversion to vector or 2D raster maps</h3>
  112. Slices from a 3D raster map can be converted to a 2D raster map
  113. (<a href="r3.to.rast.html">r3.to.rast</a>).
  114. Cross sectional 2D raster map can be extracted from 3D raster map based
  115. on a 2D elevation map (<a href="r3.cross.rast.html">r3.cross.rast</a>).
  116. <h3>3D raster statistics</h3>
  117. 3D raster statistics can be calculated with <a href="r3.stats.html">r3.stats</a>
  118. and <a href="r3.univar.html">r3.univar</a>.
  119. <h3>3D raster interpolation</h3>
  120. From 3D vector points, GRASS 3D raster maps can be interpolated
  121. (<a href="v.vol.rst.html">v.vol.rst</a>).
  122. Results are 3D raster maps, however 2D raster maps can be also extracted.
  123. <h3>3D raster export</h3>
  124. The modules <a href="r3.out.ascii.html">r3.out.ascii</a> and
  125. <a href="r3.out.bin.html">r3.out.bin</a> support the export of
  126. 3D raster maps as ASCII or binary files. The output of these modules
  127. can be imported with the corresponding import modules noted above.
  128. <p>
  129. NetCDF export of 3D raster maps can be performed using the module
  130. <a href="r3.out.netcdf.html">r3.out.netcdf</a>. It supports 3D raster maps
  131. with spatial dimensions and temporal (vertical) dimension.
  132. <h3>Working with 3D visualization software</h3>
  133. GRASS GIS can be used for visualization of 3D rasters, however
  134. it has also tools to easily export the data into other visualization
  135. packages.
  136. <p>
  137. GRASS GIS 3D raster maps can be exported to VTK
  138. using <a href="r3.out.vtk.html">r3.out.vtk</a>.
  139. VTK files can be visualized with the
  140. <em><a href="http://www.vtk.org">VTK Toolkit</a></em>,
  141. <em><a href="http://www.paraview.org">Paraview</a></em> and
  142. <em><a href="http://mayavi.sourceforge.net">MayaVi</a></em>.
  143. Moreover, GRASS GIS 2D raster maps can be exported to VTK with
  144. <a href="r.out.vtk.html">r.out.vtk</a>
  145. and GRASS GIS vector maps can be exported to VTK with
  146. <a href="v.out.vtk.html">v.out.vtk</a>.
  147. <p>
  148. Alternatively, GRASS 3D raster maps can be imported and exported from/to
  149. <em><a href="http://vis5d.sourceforge.net/">Vis5D</a></em>
  150. (<a href="r3.in.v5d.html">r3.in.v5d</a>,
  151. <a href="r3.out.v5d.html">r3.out.v5d</a>).
  152. <h3>3D raster data types</h3>
  153. 3D raster's single-precision data type is most often called "FCELL" or "float",
  154. and the double-precision one "DCELL" or "double".
  155. <h3>See also</h3>
  156. <ul>
  157. <li><a href="rasterintro.html">Introduction into raster data processing</a></li>
  158. <li><a href="vectorintro.html">Introduction into vector data processing</a></li>
  159. <li><a href="imageryintro.html">Introduction into image processing</a></li>
  160. <li><a href="temporalintro.html">Introduction into temporal data processing</a></li>
  161. <li><a href="projectionintro.html">Projections and spatial transformations</a></li>
  162. <li><a href="wxGUI.nviz.html">wxGUI 3D View Mode</a></li>
  163. <li><em><a href="m.nviz.image.html">m.nviz.image</a></em></li>
  164. </ul>