r.import.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <h2>DESCRIPTION</h2>
  2. <em>r.import</em> imports a map or selected bands from a GDAL raster datasource
  3. into the current location and mapset. If the projection of the input
  4. does not match the projection of the location, the input is reprojected
  5. into the current location. If the projection of the input does match
  6. the projection of the location, the input is imported directly with
  7. <a href="r.in.gdal.html">r.in.gdal</a>.
  8. <h2>NOTES</h2>
  9. <em>r.import</em> checks the projection metadata of the dataset to be
  10. imported against the current location's projection. If not identical a
  11. related error message is shown.
  12. <br>
  13. To override this projection check (i.e. to use current location's projection)
  14. by assuming that the dataset has the same projection as the current location
  15. the <b>-o</b> flag can be used. This is also useful when geodata to be
  16. imported do not contain any projection metadata at all. The user must be
  17. sure that the projection is identical in order to avoid to introduce data
  18. errors.
  19. <h3>Resolution</h3>
  20. <em>r.import</em> reports the estimated target resolution for each
  21. input band. The estimated resolution will usually be some floating
  22. point number, e.g. 271.301. In case option <b>resolution</b> is set to
  23. <em>estimated</em> (default), this floating point number will be used
  24. as target resolution. Since the target resolution should be typically the rounded
  25. estimated resolution, e.g. 250 or 300 instead of 271.301, flag <b>-e</b>
  26. can be used first to obtain the estimate without importing the raster bands.
  27. Then the desired resolution is set with option <b>resolution_value</b>
  28. and option <b>resolution</b>=<em>value</em>.
  29. For latlong locations, the resolution might be set to arc seconds, e.g. 1, 3, 7.5,
  30. 15, and 30 arc seconds are commonly used resolutions.
  31. <h3>Resampling methods</h3>
  32. When reprojecting a map to a new spatial reference system, the projected
  33. data is resampled with one of four different methods: nearest neighbor,
  34. bilinear, bicubic iterpolation or lanczos.
  35. <p>
  36. In the following common use cases:
  37. <p>
  38. <b>nearest</b> is the simplest method and the only possible method for
  39. categorical data.
  40. <p>
  41. <b>bilinear</b> does linear interpolation and provides smoother output
  42. than <b>nearest</b>. <b>bilinear</b> is recommended when reprojecting a
  43. DEM for hydrological analysis or for surfaces where overshoots must be
  44. avoided, e.g. precipitation should not become negative.
  45. <p>
  46. <b>bicubic</b> produces smoother output than <b>bilinear</b>, at
  47. the cost of overshoots.
  48. <p>
  49. <b>lanczos</b> produces the smoothest output of all methods and
  50. preserves contrast best. <b>lanczos</b> is recommended for imagery.
  51. Both <b>bicubic</b> and <b>lanczos</b> preserve linear features. With
  52. <b>nearest</b> or <b>bilinear</b>, linear features can become zigzag
  53. features after reprojection.
  54. <p>
  55. For explanation of the <b>-l</b> flag, please refer to the
  56. <a href="r.in.gdal.html">r.in.gdal</a> manual.
  57. <p>
  58. When importing whole-world maps the user should disable map-trimming with
  59. the <b>-n</b> flag. For further explanations of <b>-n</b> flag, please refer
  60. the to <a href="r.proj.html">r.proj</a> manual.
  61. <h2>EXAMPLES</h2>
  62. <h3>Import of SRTM V3 global data at 1 arc-seconds resolution</h3>
  63. The SRTM V3 1 arc-second global data (~30 meters resolution) are available
  64. from EarthExplorer (<a href="http://earthexplorer.usgs.gov/">http://earthexplorer.usgs.gov/</a>).
  65. The SRTM collections are located under the "Digital Elevation" category.
  66. <p>
  67. Example for North Carolina sample dataset (the tile name is "n35_w079_1arc_v3.tif"):
  68. <div class="code"><pre>
  69. # set computational region to e.g. 10m elevation model:
  70. g.region raster=elevation -p
  71. # Import with reprojection on the fly. Recommended parameters:
  72. # resample Resampling method to use for reprojection - bilinear
  73. # extent Output raster map extent - region: extent of current region
  74. # resolution Resolution of output raster map
  75. # - region: current region resolution - limit to g.region setting from above
  76. r.import input=n35_w079_1arc_v3.tif output=srtmv3_resamp10m resample=bilinear \
  77. extent=region resolution=region title="SRTM V3 resampled to 10m resolution"
  78. # beautify colors:
  79. r.colors srtmv3_resamp10m color=elevation
  80. </pre></div>
  81. <h3>Import of WorldClim data</h3>
  82. Import of a subset from WorldClim <a href="http://worldclim.org/bioclim">Bioclim data set</a>,
  83. to be reprojected to current location projection (North Carolina sample dataset).
  84. Different resolutions are available, in this example we use the 2.5 arc-minutes
  85. resolution data. During import, we spatially subset the world data to the
  86. North Carolina region using the <em>extent</em> parameter:
  87. <div class="code"><pre>
  88. # download selected Bioclim data (2.5 arc-minutes resolution)
  89. # optionally tiles are available for the 30 arc-sec resolution
  90. wget http://biogeo.ucdavis.edu/data/climate/worldclim/1_4/grid/cur/bio_2-5m_bil.zip
  91. # extract BIO1 from package (BIO1 = Annual Mean Temperature):
  92. unzip bio_2-5m_bil.zip bio1.bil bio1.hdr
  93. # prior to import, fix broken WorldClim extent using GDAL tool
  94. gdal_translate -a_ullr -180 90 180 -60 bio1.bil bio1_fixed.tif
  95. # set computational region to North Carolina, 4000 m target pixel resolution
  96. g.region -d res=4000 -ap
  97. # subset to current region and reproject on the fly to current location projection,
  98. # using -n since whole-world map is imported:
  99. r.import input=bio1_fixed.tif output=bioclim01 resample=bilinear \
  100. extent=region resolution=region -n
  101. # temperature data are in &deg;C * 10
  102. r.info bioclim01
  103. r.univar -e bioclim01
  104. </pre></div>
  105. <h2>SEE ALSO</h2>
  106. <em>
  107. <a href="r.in.gdal.html">r.in.gdal</a>,
  108. <a href="r.proj.html">r.proj</a>
  109. </em>
  110. <h2>AUTHORS</h2>
  111. Markus Metz<br>
  112. Improvements: Martin Landa, Anna Petrasova
  113. <p>
  114. <i>Last changed: $Date$</i>