rasterintro.html 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <title>Raster data processing in GRASS GIS</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  6. <meta name="Author" content="Markus Neteler/GRASS Development Team">
  7. <link rel="stylesheet" href="grassdocs.css" type="text/css">
  8. </head>
  9. <body bgcolor="white">
  10. <img src="grass_logo.png" alt="GRASS logo"><hr align=center size=6 noshade>
  11. <h2>Raster data processing in GRASS GIS</h2>
  12. <h3>Raster maps in general</h3>
  13. The geographic boundaries of the raster map are described by the north,
  14. south, east, and west fields. These values describe the lines which bound
  15. the map at its edges. These lines do NOT pass through the center of the
  16. grid cells at the edge of the map, but along the edge of the map itself.
  17. <P>
  18. As a general rule in GRASS:
  19. <ol>
  20. <li> Raster output maps have their bounds and resolution equal to those
  21. of the current region.
  22. <li> Raster input maps are automatically cropped/padded and rescaled
  23. (using nearest-neighbour resampling) to match the current region.
  24. <li> Raster input maps are automatically masked if a raster map named
  25. MASK exists.
  26. </ol>
  27. There are a few exceptions to this:
  28. <tt>r.in.*</tt> programs read the data cell-for-cell, with no resampling. When
  29. reading non-georeferenced data, the imported map will usually have its
  30. lower-left corner at (0,0) in the location's coordinate system; the user
  31. needs to use <a href="r.region.html">r.region</a> to "place" the imported map.
  32. <P>
  33. Some programs which need to perform specific types of resampling (e.g.
  34. <a href="r.resamp.rst.html">r.resamp.rst</a>) read the input maps at
  35. their original resolution then do the resampling themselves.
  36. <P>
  37. <a href="r.proj.html">r.proj</a> has to deal with two regions (source
  38. and destination) simultaneously; both will have an impact upon the
  39. final result.
  40. <h3>Raster import and export</h3>
  41. The module <a href="r.in.gdal.html">r.in.gdal</a> offers a common
  42. interface for many different raster formats. Additionally, it also
  43. offers options such as on-the-fly location creation or extension of
  44. the default region to match the extent of the imported raster map.
  45. For special cases, other import modules are available. Always the full
  46. map is imported.
  47. <P>
  48. For importing scanned maps, the user will need to create a
  49. x,y-location, scan the map in the desired resolution and save it into
  50. an appropriate raster format (e.g. tiff, jpeg, png, pbm) and then use
  51. <a href="r.in.gdal.html">r.in.gdal</a> to import it. Based on
  52. reference points the scanned map can be recified to obtain geocoded
  53. data.
  54. <P>
  55. Raster maps are exported with <a href="r.out.gdal.html">r.out.gdal</a>
  56. into common formats. Also <a href="r.out.bin.html">r.out.bin</a>,
  57. <a href="r.out.vtk.html">r.out.vtk</a> and other export modules are
  58. available.
  59. <h3>Metadata</h3>
  60. The <a href="r.info.html">r.info</a> module displays general information
  61. about a map such as region extent, data range, data type, creation history,
  62. and other metadata.
  63. Metadata such as map title, units, vertical datum etc. can be updated
  64. with <a href="r.support.html">r.support</a>. Timestamps are managed
  65. with <a href="r.timestamp.html">r.timestamp</a>. Region extent and
  66. resolution are mangaged with <a href="r.region.html">r.region</a>.
  67. <h3>Raster map operations</h3>
  68. GRASS raster map processing is always performed in the current region
  69. settings (see <a href="g.region.html">g.region</a>), i.e. the current
  70. region extent and current raster resolution is used. If the resolution
  71. differs from that of the input raster map(s), on-the-fly resampling is
  72. performed (nearest neighbor resampling). If this is not desired, the
  73. input map(s) has/have to be resampled beforehand with one of the dedicated
  74. modules.
  75. <h4>Raster MASKs</h4>
  76. If a raster map named "MASK" exists, most GRASS raster modules will operate
  77. only on data falling inside the masked area, and treat any data falling
  78. outside of the mask as if its value were NULL. The mask is only applied
  79. when <em>reading</em> an existing GRASS raster map, for example when used
  80. in a module as an input map.
  81. <P>
  82. The mask is read as an integer map. If MASK is actually a
  83. floating-point map, the values will be converted to integers using the
  84. map's quantisation rules (this defaults to round-to-nearest, but can
  85. be changed with r.quant).
  86. <P>
  87. (see <a href="r.mask.html">r.mask</a>)
  88. <h3>Raster map statistics</h3>
  89. A couple of commands are available to calculate local statistics
  90. (<a href="r.neighbors.html">r.neighbors</a>), and global statistics
  91. (<a href="r.statistics.html">r.statistics</a>, <a href="r.surf.area.html">r.surf.area</a>,
  92. <a href="r.sum.html">r.sum</a>). Profiles and transects can be generated
  93. (<a href="d.profile.html">d.profile</a>, <a href="r.profile.html">r.profile</a>,
  94. <a href="r.transect.html">r.transect</a>) as well as histograms
  95. (<a href="d.histogram.html">d.histogram</a>) and polar diagrams
  96. (<a href="d.polar.html">d.polar</a>).
  97. Univariate statistics (<a href="r.univar.html">r.univar</a>) and
  98. reports are also available (<a href="r.report.html">r.report</a>,<a
  99. href="r.stats.html">r.stats</a>, <a href="r.volume.html">r.volume</a>).
  100. <h3>Raster map algebra and aggregation</h3>
  101. The <a href="r.mapcalc.html">r.mapcalc</a> command provides raster map
  102. algebra methods.
  103. The <a href="r.resamp.stats.html">r.resamp.stats</a> command resamples raster
  104. map layers using various aggregation methods, the <a href="r.average.html">r.average</a>
  105. command aggregates one map based on a second map.
  106. <a href="r.resamp.interp.html">r.resamp.interp</a> resamples raster map layers using interpolation.
  107. <h3>Raster map resampling and interpolation methods</h3>
  108. GRASS offers various raster resampling and interpolation methods. There are
  109. available modules for reinterpolation of "filled" raster maps (continuous data)
  110. to a different resolution:
  111. <ul>
  112. <li> Resampling with nearest neighbor, bilinear, and bicubic method
  113. (<a href="r.resamp.interp.html">r.resamp.interp</a>)</li>
  114. <li> Regularized spline with tension (RST) interpolation 2D
  115. (<a href="r.resamp.rst.html">r.resamp.rst</a>)</li>
  116. <li> Regularized spline with tension (RST) interpolation 2D for hole filling (e.g., SRTM DEM)
  117. (<a href="r.fillnulls.html">r.fillnulls</a>)</li>
  118. </ul>
  119. Furthermore, there are modules available for reinterpolation of "sparse"
  120. (scattered points or lines) maps:
  121. <ul>
  122. <li> Inverse distance weighted average (IDW) interpolation
  123. (<a href="r.surf.idw.html">r.surf.idw</a> and <a href="r.surf.idw2.html">r.surf.idw2</a>)</li>
  124. <li> Interpolating from contour lines (<a href="r.contour.html">r.contour</a>)</li>
  125. </ul>
  126. For Lidar and similar data, <a href="r.in.xyz.html">r.in.xyz</a> supports loading
  127. and binning of ungridded x,y,z ASCII data into a new raster map. The user may choose from
  128. a variety of statistical methods in creating the new raster.
  129. <P>
  130. Otherwise, for interpolation of scattered data, use the <EM>v.surf.*</EM> set of
  131. modules.
  132. <h3>Hydrologic modeling toolbox</h3>
  133. Watershed modeling related modules are
  134. <a href="r.basins.fill.html">r.basins.fill</a>,
  135. <a href="r.water.outlet.html">r.water.outlet</a>,
  136. <a href="r.watershed.html">r.watershed</a>, and
  137. <a href="r.terraflow.html">r.terraflow</a>.
  138. Water flow related modules are
  139. <a href="r.carve.html">r.carve</a>,
  140. <a href="r.drain.html">r.drain</a>,
  141. <a href="r.fill.dir.html">r.fill.dir</a>,
  142. <a href="r.fillnulls.html">r.fillnulls</a>,
  143. <a href="r.flow.html">r.flow</a>, and
  144. <a href="r.topidx.html">r.topidx</a>.
  145. Flooding can be simulated with <a href="r.lake.html">r.lake</a>.
  146. Hydrologic simulation model are available as
  147. <a href="r.sim.sediment.html">r.sim.sediment</a>,
  148. <a href="r.sim.water.html">r.sim.water</a>, and
  149. <a href="r.topmodel.html">r.topmodel</a>.
  150. <h3>Raster format</h3>
  151. Raster data can be stored in GRASS as 2D or 3D grids. 2D rasters
  152. support 3 data types: 32bit signed integer, single- and double-precision
  153. floating-point. 3D rasters support only single- and double-precision
  154. floating-point. In most GRASS resources, 2D raster maps are usually
  155. called "raster", their integer data type "CELL", single-precision
  156. floating-point data type "FCELL" and double-precision floating-point
  157. "DCELL". The 3D raster map type is usually called "3D raster" but other
  158. names like "G3D", "voxel", "volume", "GRID3D" or "3d cell" are common.
  159. 3D raster's single-precision data type is most often called "float", and the
  160. double-precision one "double".
  161. <p>
  162. GRASS raster format is architecture independent and portable between
  163. 32bit and 64bit machines.
  164. <p>
  165. GRASS distinguishes NULL and zero. When working with NULL data, it is
  166. important to know that operations on NULL cells lead to NULL cells.
  167. <h3>See also</h3>
  168. <ul>
  169. <li><a href=vectorintro.html>Introduction to GRASS vector map processing</a></li>
  170. <li><a href=raster3dintro.html>Introduction to GRASS 3D raster map (voxel) processing</a></li>
  171. </ul>
  172. <HR>
  173. <P>
  174. <a href="index.html">Main index</a> - <a href="raster.html">raster index</a>
  175. - <a href="full_index.html">full index</a>
  176. </P>
  177. <P>&copy; 2008 <a href="http://grass.osgeo.org">GRASS Development Team</a></P>
  178. </body>
  179. </html>