DESCRIPTION
r.import imports a map or selected bands from a GDAL raster datasource
into the current location and mapset. If the projection of the input
does not match the projection of the location, the input is reprojected
into the current location. If the projection of the input does match
the projection of the location, the input is imported directly with
r.in.gdal.
NOTES
Resolution
r.import reports the estimated target resolution for each
input band. The estimated resolution will usually be some floating
point number, e.g. 271.301. In case option resolution is set to
estimated (default), this floating point number will be used
as target resolution. Since the target resolution should be typically the rounded
estimated resolution, e.g. 250 or 300 instead of 271.301, flag -e
can be used first to obtain the estimate without importing the raster bands.
Then the desired resolution is set with option resolution_value
and option resolution=value.
For latlong locations, the resolution might be set to arc seconds, e.g. 1, 3, 7.5,
15, and 30 arc seconds are commonly used resolutions.
Resampling methods
When reprojecting a map to a new spatial reference system, the projected
data is resampled with one of four different methods: nearest neighbor,
bilinear, bicubic iterpolation or lanczos.
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
Import of a subset from Bioclim data set, to be reprojected
to current location projection (North Carolina sample dataset). While normally
the full raster map is imported, we spatially subset using the extent
parameter:
# download selected Bioclim data
wget http://biogeo.ucdavis.edu/data/climate/worldclim/1_4/grid/cur/bio_2-5m_bil.zip
# extract BIO1 from package:
unzip bio_2-5m_bil.zip bio1.bil bio1.hdr
# 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.bil output=bioclim01 resample=bilinear \
extent=region resolution=region -n
r.info bioclim01
r.univar -e bioclim01
KNOWN ISSUES
The option extent=region only works when the dataset has a
different projection than the current location (i.e., internally
r.proj is invoked).
SEE ALSO
r.in.gdal,
r.proj
AUTHORS
Markus Metz
Improvements: Martin Landa, Anna Petrasova
Last changed: $Date: 2015-01-20 20:52:27 +0100 (Tue, 20 Jan 2015) $