GRASS GIS is one of the few GIS software packages with volume data support. Here data are stored as a 3D raster with a unit volume called a voxel (volume pixel). Voxels are designed to support representations of trivariate continuous fields.

GRASS GIS 3D raster maps use the same coordinate system as 2D raster maps (row count from north to south) with an additional z dimension (depth) counting from bottom to top. The upper left corner (NW) is the origin of the voxel. Volumes are stored using a tile cache based approach. This allows abritrary read and write operations in the created volume. The size of the tiles can be specified at import time with r3.in.ascii or the data can be retiled using r3.retile after import or creation.

The volume coordinate system and tile layout of the RASTER3D library

### 3D Raster (voxel) import

The module r3.in.ascii supports generic x,y,z import. Alternatively, volumes can be generated from 3D point vector data (v.to.rast3). Always the full map is imported. Volumes can also be created based on 2D elevation map(s) and value raster map(s) (r.to.rast3elev). Alternatively, a volume can be composed of several 2D raster map slices which are merged into one 3D raster (voxel) map (r.to.rast3).

### 3D region settings and 3D MASK

GRASS 3D raster map processing is always performed in the current 3D region settings (see g.region, -p3 flags), i.e. the current region extent, vertical extent and current 3D resolution are used. If the 3D resolution differs from that of the input raster map(s), on-the-fly resampling is performed (nearest neighbor resampling). If this is not desired, the input map(s) has/have to be reinterpolated beforehand with one of the dedicated modules. Masks can be set (r3.mask).

### Volume operations

Powerful 3D map algebra is implemented in r3.mapcalc. A 3D groundwater flow model is implemented in r3.gwflow.

### 3D raster conversion to vector or 2D raster maps

3D vector point data can be converted to a GRASS 3D raster map (v.to.rast3). Layers from a 3D raster map can be converted to a 2D raster map (r3.to.rast). Cross sectional 2D raster map can be extracted from 3D raster map based on a 2D elevation map (r3.cross.rast).

### 3D raster statistics

Volume statistics can be calculated with r3.stats and r3.univar.

### 3D rasterinterpolation

From 3D vector points, GRASS 3D raster maps can be interpolated (v.vol.rst). Results are volumes, or 2D raster maps can be also extracted.

### 3D raster export

GRASS 3D raster maps can be exported to VTK (r3.out.vtk). VTK files can be visualized with the VTK Toolkit, Paraview and MayaVi. GRASS 2D raster maps can be exported to VTK with r.out.vtk, GRASS vector maps can be exported to VTK with v.out.vtk.

Alternatively, GRASS 3D raster maps can be imported and exported from/to Vis5D (r3.in.v5d, r3.out.v5d). Note that Vis5D is limited in the number of supported volumes.

Finally, export to 3D ASCII is also available (r3.out.ascii).

### See also

- Introduction into raster data processing
- Introduction into vector data processing
- Introduction into image processing
- Database management
- Projections and spatial transformations