In the following common use cases:
nearest is the simplest method and the only possible method for categorical data.
bilinear does linear interpolation and provides smoother output than nearest. bilinear is recommended when reprojecting a DEM for hydrological analysis or for surfaces where overshoots must be avoided, e.g. precipitation should not become negative.
bicubic produces smoother output than bilinear, at the cost of overshoots.
lanczos produces the smoothest output of all methods and preserves contrast best. lanczos is recommended for imagery. Both bicubic and lanczos preserve linear features. With nearest or bilinear, linear features can become zigzag features after reprojection.
For explanation of the -l flag, please refer to the r.in.gdal manual.
When importing whole-world maps the user should disable map-trimming with the -n flag. For further explanations of -n flag, please refer the to r.proj manual.
Example for North Carolina sample dataset (the tile name is "n35_w079_1arc_v3.tif"):
# set computational region to e.g. 10m elevation model: g.region raster=elevation -p # Import with reprojection on the fly. Recommended parameters: # resample Resampling method to use for reprojection - bilinear # extent Output raster map extent - region: extent of current region # resolution Resolution of output raster map # - region: current region resolution - limit to g.region setting from above r.import input=n35_w079_1arc_v3.tif output=srtmv3_resamp10m resample=bilinear \ extent=region resolution=region title="SRTM V3 resampled to 10m resolution" # beautify colors: r.colors srtmv3_resamp10m color=elevation
# download selected Bioclim data (2.5 arc-minutes resolution) # optionally tiles are available for the 30 arc-sec resolution wget http://biogeo.ucdavis.edu/data/climate/worldclim/1_4/grid/cur/bio_2-5m_bil.zip # extract BIO1 from package (BIO1 = Annual Mean Temperature): unzip bio_2-5m_bil.zip bio1.bil bio1.hdr # prior to import, fix broken WorldClim extent using GDAL tool gdal_translate -a_ullr -180 90 180 -60 bio1.bil bio1_fixed.tif # set computational region to North Carolina, 4000 m target pixel resolution g.region -d res=4000 -ap # subset to current region and reproject on the fly to current location projection, # using -n since whole-world map is imported: r.import input=bio1_fixed.tif output=bioclim01 resample=bilinear \ extent=region resolution=region -n # temperature data are in °C * 10 r.info bioclim01 r.univar -e bioclim01
Last changed: $Date$