Note: A new GRASS GIS stable version has been released: GRASS GIS 7.4, available here.

Updated manual page: here

The geographic boundaries of the raster map are described by the north, south, east, and west fields. These values describe the lines which bound the map at its edges. These lines do NOT pass through the center of the grid cells at the edge of the map, but along the edge of the map itself. i.e. the geographic extent of the map is described by the outer bounds of all cells within the map.

As a general rule in GRASS GIS:

- Raster output maps have their bounds and resolution equal to those of the current computational region.
- Raster input maps are automatically cropped/padded and rescaled (using nearest-neighbour resampling) to match the current region.
- Raster input maps are automatically masked if a raster map named
MASK exists. The MASK is only applied when
*reading*maps from the disk.

Some programs which need to perform specific types of resampling (e.g. r.resamp.rst) read the input maps at their original resolution then do the resampling themselves.

r.proj has to deal with two regions (source and destination) simultaneously; both will have an impact upon the final result.

For importing scanned maps, the user will need to create a x,y-location, scan the map in the desired resolution and save it into an appropriate raster format (e.g. tiff, jpeg, png, pbm) and then use r.in.gdal to import it. Based on reference points the scanned map can be recified to obtain geocoded data.

Raster maps are exported with r.out.gdal into common formats. Also r.out.bin, r.out.vtk, r.out.ascii and other export modules are available. They export the data according to the current region settings. If those differ from the original map, the map is resampled on the fly (nearest neighbor algorithm). In other words, the output will have as many rows and columns as the current region. To export maps with various grid spacings (e.g, 500x500 or 200x500), you can just change the region resolution with g.region and then export the map. The resampling is done with nearest neighbor algorithm in this case. If you want some other form of resampling, first change the region, then explicitly resample the map with e.g. r.resamp.interp or r.resamp.stats, then export the resampled map.

GRASS GIS raster map exchange between different locations (same projection) can be done in a lossless way using the r.pack and r.unpack modules.

The built-in nearest-neighbour resampling of raster data calculates the centre of each region cell, and takes the value of the raster cell in which that point falls.

If the point falls exactly upon a grid line, the exact result will be determined by the direction of any rounding error. One consequence of this is that downsampling by a factor which is an even integer will always sample exactly on the boundary between cells, meaning that the result is ill-defined.

The following modules are available for reinterpolation of "filled" raster maps (continuous data) to a different resolution:

- r.resample uses the built-in resampling, so it should produce identical results as the on-the-fly resampling done via the raster import modules.
- r.resamp.interp Resampling with
nearest neighbor, bilinear, and bicubic method:
**method=nearest**uses the same algorithm as r.resample, but not the same code, so it may not produce identical results in cases which are decided by the rounding of floating-point numbers.

For r.resamp.interp**method=bilinear**and**method=bicubic**, the raster values are treated as samples at each raster cell's centre, defining a piecewise-continuous surface. The resulting raster values are obtained by sampling the surface at each region cell's centre. As the algorithm only interpolates, and doesn't extrapolate, a margin of 0.5 (for bilinear) or 1.5 (for bicubic) cells is lost from the extent of the original raster. Any samples taken within this margin will be null. - r.resamp.rst Regularized Spline with Tension (RST) interpolation 2D: Behaves similarly, i.e. it computes a surface assuming that the values are samples at each raster cell's centre, and samples the surface at each region cell's centre.
- r.resamp.bspline Bicubic or bilinear spline interpolation with Tykhonov regularization.
- For r.resamp.stats without
**-w**, the value of each region cell is the chosen aggregate of the values from all of the raster cells whose centres fall within the bounds of the region cell.

With**-w**, the samples are weighted according to the proportion of the raster cell which falls within the bounds of the region cell, so the result is normally unaffected by rounding error (a minuscule difference in the position of the boundary results in the addition or subtraction of a sample weighted by a minuscule factor; also, The min and max aggregates can't use weights, so**-w**has no effect for those). - r.fillnulls for Regularized Spline with Tension (RST) interpolation 2D for hole filling (e.g., SRTM DEM)

Furthermore, there are modules available for reinterpolation of "sparse" (scattered points or lines) maps:

- Inverse distance weighted average (IDW) interpolation (r.surf.idw)
- Interpolating from contour lines (r.contour)
- Various vector modules for interpolation

Otherwise, for interpolation of scattered data, use the *v.surf.** set of
modules.

The mask is read as an integer map. If MASK is actually a floating-point map, the values will be converted to integers using the map's quantisation rules (this defaults to round-to-nearest, but can be changed with r.quant).

(see r.mask)

- 32bit signed integer (CELL),
- single-precision floating-point (FCELL), and
- double-precision floating-point (DCELL).

The GRASS GIS raster format is architecture independent and portable between 32bit and 64bit machines.

- Introduction into 3D raster data (voxel) processing
- Introduction into vector data processing
- Introduction into image processing
- Introduction into temporal data processing
- Database management
- Projections and spatial transformations

Available at: Raster data processing in GRASS GIS source code (history)

Note: A new GRASS GIS stable version has been released: GRASS GIS 7.4, available here.

Updated manual page: here

Main index | raster index | Topics index | Keywords index | Full index

© 2003-2018 GRASS Development Team, GRASS GIS 7.0.7svn Reference Manual