1rasterintro(1) Grass User's Manual rasterintro(1)
2
3
4
6 Raster maps in general
7 The geographic boundaries of the raster map are described by the north,
8 south, east, and west fields. These values describe the lines which
9 bound the map at its edges. These lines do NOT pass through the center
10 of the grid cells at the edge of the map, but along the edge of the map
11 itself.
12
13 As a general rule in GRASS:
14
15 1
16 Raster output maps have their bounds and resolution equal to
17 those of the current region.
18
19 2
20 Raster input maps are automatically cropped/padded and rescaled
21 (using nearest-neighbour resampling) to match the current
22 region.
23
24 3
25 Raster input maps are automatically masked if a raster map
26 named MASK exists.
27
28 There are a few exceptions to this: r.in.* programs read the data cell-
29 for-cell, with no resampling. When reading non-georeferenced data, the
30 imported map will usually have its lower-left corner at (0,0) in the
31 location's coordinate system; the user needs to use r.region to "place"
32 the imported map.
33
34 Some programs which need to perform specific types of resampling (e.g.
35 r.resamp.rst) read the input maps at their original resolution then do
36 the resampling themselves.
37
38 r.proj has to deal with two regions (source and destination) simultane‐
39 ously; both will have an impact upon the final result.
40
41 Raster import and export
42 The module r.in.gdal offers a common interface for many different
43 raster formats. Additionally, it also offers options such as on-the-fly
44 location creation or extension of the default region to match the
45 extent of the imported raster map. For special cases, other import
46 modules are available. Always the full map is imported.
47
48 For importing scanned maps, the user will need to create a x,y-loca‐
49 tion, scan the map in the desired resolution and save it into an appro‐
50 priate raster format (e.g. tiff, jpeg, png, pbm) and then use r.in.gdal
51 to import it. Based on reference points the scanned map can be recified
52 to obtain geocoded data.
53
54 Raster maps are exported with r.out.gdal into common formats. Also
55 r.out.bin, r.out.vtk and other export modules are available.
56
57 Metadata
58 The r.info module displays general information about a map such as
59 region extent, data range, data type, creation history, and other meta‐
60 data. Metadata such as map title, units, vertical datum etc. can be
61 updated with r.support. Timestamps are managed with r.timestamp. Region
62 extent and resolution are mangaged with r.region.
63
64 Raster map operations
65 GRASS raster map processing is always performed in the current region
66 settings (see g.region), i.e. the current region extent and current
67 raster resolution is used. If the resolution differs from that of the
68 input raster map(s), on-the-fly resampling is performed (nearest neigh‐
69 bor resampling). If this is not desired, the input map(s) has/have to
70 be resampled beforehand with one of the dedicated modules.
71
72 If a raster map named "MASK" exists, most GRASS raster modules will
73 operate only on data falling inside the masked area, and treat any data
74 falling outside of the mask as if its value were NULL. The mask is only
75 applied when reading an existing GRASS raster map, for example when
76 used in a module as an input map. (see r.mask)
77
78 Raster map statistics
79 A couple of commands are available to calculate local statistics
80 (r.neighbors), and global statistics (r.surf.area, r.sum). Profiles
81 and transects can be generated (r.profile, r.transect) as well as his‐
82 tograms (d.histogram) and polar diagrams (d.polar). Univariate statis‐
83 tics (r.univar) and reports are also available (r.report,<a
84 href="r.stats.html">r.stats, r.volume).
85
86 Raster map algebra and aggregation
87 The r.mapcalc command provides raster map algebra methods. The
88 r.resamp.stats command resamples raster map layers using various aggre‐
89 gation methods, the r.average command aggregates one map based on a
90 second map. r.resamp.interp resamples raster map layers using interpo‐
91 lation.
92
93 Raster map resampling and interpolation methods
94 GRASS offers various raster resampling and interpolation methods:
95
96 Resampling with nearest neighbor, bilinear, and bicubic
97 method (r.resamp.interp)
98
99 Inverse distance weighted average (IDW) interpolation
100 (r.surf.idw2)
101
102 Regularized spline with tension (RST) interpolation 2D
103 (r.resamp.rst)
104
105 Bilinear interpolation (r.bilinear)
106
107 Interpolating from contour lines (r.contour)
108
109 Hydrologic modeling toolbox
110 Watershed modeling related modules are r.basins.fill, r.water.outlet,
111 r.watershed, and r.terraflow. Water flow related modules are r.carve,
112 r.drain, r.fill.dir, r.fillnulls, r.flow, and r.topidx. Flooding can
113 be simulated with r.lake. Hydrologic simulation model are available as
114 r.sim.sediment, r.sim.water, and r.topmodel.
115
116 Raster format
117 Raster data can be stored in GRASS as a 2D integer grid, 2D floating
118 point grid (single or double precision), or as a 3D floating point grid
119 (single or double precision). The internal raster format is architec‐
120 ture independent and portable between 32bit and 64bit machines. Inter‐
121 nally, the integer format is called CELL, single precision floating
122 point is called FCELL, double precision floating point is DCELL, and 3D
123 raster is called GRID3D. The choice of the integer or floating point
124 data depends on the application.
125
126 GRASS distinguishes NULL and zero. When working with NULL data, it is
127 important to know that operations on NULL cells lead to NULL cells.
128
129 See also
130 Introduction to GRASS vector map processing
131
132 Introduction to GRASS 3D raster map (voxel) processing
133
134 raster index - full index
135
136
137
138GRASS 6.3.0 rasterintro(1)