r.import(1)
π r.import(1) β GRASS GIS User's Manual π
okay bestie, gather round, because this is the page for r.import, and it's genuinely iconic. it's a GRASS GIS User's Manual page, and it's giving "import my raster data and reproject it on the fly, no big deal." π¦
β¨ NAME β¨
r.import β imports raster data into a GRASS raster map using the GDAL library and reprojects on the fly. no cap, that's literally the whole job and she does it flawlessly. π
πΈ KEYWORDS πΈ
raster, import, projection
π SYNOPSIS π
r.import
r.import --help
r.import [-enlo] input=name [band=integer[,integer,...]]
[memory=memory in MB] [output=name] [resample=string]
[extent=string] [resolution=string] [resolution_value=float]
[title=phrase] [--overwrite] [--help] [--verbose] [--quiet] [--ui]
π© Flags π©
-eβ Estimate resolution only. like, she'll tell you what she thinks the resolution should be and then dip, no importing. so efficient. π-nβ Do not perform region cropping optimization. bestie said "no cropping, thank you." π«Ά-lβ Force Lat/Lon maps to fit into geographic coordinates (90N,S; 180E,W). π-oβ Override projection check (use current project's CRS). This one assumes that the dataset has the same coordinate reference system (CRS) as the current project. β οΈ--overwriteβ Allow output files to overwrite existing files. bye bye old file π--helpβ Print usage summary.--verboseβ Verbose module output. she'll yap (affectionately) π¬--quietβ Quiet module output. she'll be mysterious π€«--uiβ Force launching GUI dialog. point-and-click girlies rise π±οΈβ¨
π§ Parameters π§
input=name[required] β Name of GDAL dataset to be imported. this one's mandatory, she's not optional, she's the moment. πband=integer[,integer,...]β Input band(s) to select (default is all bands). pick your faves or take the whole set πΈmemory=memory in MBβ Maximum memory to be used (in MB). Cache size for raster rows. Default:300. πoutput=nameβ Name for output raster map. name her, she deserves it πresample=stringβ Resampling method to use for reprojection.- Options:
nearest,bilinear,bicubic,lanczos,bilinear_f,bicubic_f,lanczos_f - Default:
nearest nearest: nearest neighborbilinear: bilinear interpolationbicubic: bicubic interpolationlanczos: lanczos filterbilinear_f: bilinear interpolation with fallbackbicubic_f: bicubic interpolation with fallbacklanczos_f: lanczos filter with fallback
- Options:
extent=stringβ Output raster map extent.- Options:
input,region - Default:
input input: extent of input mapregion: extent of current region
- Options:
resolution=stringβ Resolution of output raster map (default: estimated).- Options:
estimated,value,region - Default:
estimated estimated: estimated resolutionvalue: user-specified resolutionregion: current region resolution
- Options:
resolution_value=floatβ Resolution of output raster map (use with optionresolution=value). π’title=phraseβ Title for resultant raster map. give her a glow-up caption β¨
π DESCRIPTION π
r.import imports a map or selected bands from a GDAL raster datasource into the current project (previously called location) and mapset. If the coordinate reference system (CRS) of the input does not match the CRS of the project, the input is reprojected into the current project. If the CRS of the input does match the CRS of the project, the input is imported directly with r.in.gdal. two paths, one slay. π¦
π NOTES π
r.import checks the CRS metadata of the dataset to be imported against the current project's CRS. If not identical a related error message is shown.
To override this projection check (i.e. to use current project's CRS) by assuming that the dataset has the same CRS as the current project the -o flag can be used. This is also useful when geodata to be imported do not contain any CRS metadata at all.
β οΈ The user must be sure that the CRS is identical in order to avoid introducing data errors. like, fr fr, be sure. no vibes-based CRS guessing. π
π 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 projects, 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 interpolation or lanczos.
In the following, common use cases are:
nearestis the simplest method and the only possible method for categorical data. πbilineardoes linear interpolation and provides smoother output thannearest.bilinearis recommended when reprojecting a DEM for hydrological analysis or for surfaces where overshoots must be avoided, e.g. precipitation should not become negative. π§οΈbicubicproduces smoother output thanbilinear, at the cost of overshoots. Here, valid pixels that are adjacent to NULL pixels or edge pixels are set to NULL.lanczosproduces the smoothest output of all methods and preserves contrast best.lanczosis recommended for imagery. Bothbicubicandlanczospreserve linear features. Withnearestorbilinear, linear features can become zigzag features after reprojection. π¬
In the bilinear, bicubic and lanczos methods, if any of the surrounding cells used to interpolate the new cell value are NULL, the resulting cell will be NULL, even if the nearest cell is not NULL. This will cause some thinning along NULL borders, such as the coasts of land areas in a DEM. The bilinear_f, bicubic_f and lanczos_f interpolation methods can be used if thinning along NULL edges is not desired. These methods "fall back" to simpler interpolation methods along NULL borders. That is, from lanczos to bicubic to bilinear to nearest. πͺ
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.
π EXAMPLES π
ποΈ Import of SRTM V3 global data at 1 arc-seconds resolution
The SRTM V3 1 arc-second global data (~30 meters resolution) are available from EarthExplorer (https://earthexplorer.usgs.gov/). The SRTM collections are located under the "Digital Elevation" category.
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
π Import of WorldClim data
Import of a subset from WorldClim Bioclim data set, to be reprojected to current project CRS (North Carolina sample dataset). Different resolutions are available, in this example we use the 2.5 arc-minutes resolution data. During import, we spatially subset the world data to the North Carolina region using the extent parameter:
# download selected Bioclim data (2.5 arc-minutes resolution)
# optionally tiles are available for the 30 arc-sec resolution
wget https://geodata.ucdavis.edu/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 project CRS,
# 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
π SEE ALSO π
r.in.gdal, r.proj
π AUTHORS π
- Markus Metz
- Improvements: Martin Landa, Anna Petrasova
π¦ SOURCE CODE π¦
Available at: r.import source code (history)
Accessed: Saturday Jan 17 05:41:52 2026
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
and that's the whole page bestie π«Ά β this is r.import(1) from the GRASS GIS 8.4.2 Reference Manual, Β© 2003-2025 GRASS Development Team, accessed Saturday Jan 17 05:41:52 2026. version GRASS 8.4.2, manual page r.import(1). go import something gorgeous. πβ¨
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms