.TH r.import 1grass "" "GRASS 8.3.2" "GRASS GIS User's Manual" .SH NAME \fI\fBr.import\fR\fR \- Imports raster data into a GRASS raster map using GDAL library and reprojects on the fly. .SH KEYWORDS raster, import, projection .SH SYNOPSIS \fBr.import\fR .br \fBr.import \-\-help\fR .br \fBr.import\fR [\-\fBenlo\fR] \fBinput\fR=\fIname\fR [\fBband\fR=\fIinteger\fR[,\fIinteger\fR,...]] [\fBmemory\fR=\fImemory in MB\fR] [\fBoutput\fR=\fIname\fR] [\fBresample\fR=\fIstring\fR] [\fBextent\fR=\fIstring\fR] [\fBresolution\fR=\fIstring\fR] [\fBresolution_value\fR=\fIfloat\fR] [\fBtitle\fR=\fIphrase\fR] [\-\-\fBoverwrite\fR] [\-\-\fBhelp\fR] [\-\-\fBverbose\fR] [\-\-\fBquiet\fR] [\-\-\fBui\fR] .SS Flags: .IP "\fB\-e\fR" 4m .br Estimate resolution only .IP "\fB\-n\fR" 4m .br Do not perform region cropping optimization .IP "\fB\-l\fR" 4m .br Force Lat/Lon maps to fit into geographic coordinates (90N,S; 180E,W) .IP "\fB\-o\fR" 4m .br Override projection check (use current location\(cqs projection) .br Assume that the dataset has the same projection as the current location .IP "\fB\-\-overwrite\fR" 4m .br Allow output files to overwrite existing files .IP "\fB\-\-help\fR" 4m .br Print usage summary .IP "\fB\-\-verbose\fR" 4m .br Verbose module output .IP "\fB\-\-quiet\fR" 4m .br Quiet module output .IP "\fB\-\-ui\fR" 4m .br Force launching GUI dialog .SS Parameters: .IP "\fBinput\fR=\fIname\fR \fB[required]\fR" 4m .br Name of GDAL dataset to be imported .IP "\fBband\fR=\fIinteger[,\fIinteger\fR,...]\fR" 4m .br Input band(s) to select (default is all bands) .IP "\fBmemory\fR=\fImemory in MB\fR" 4m .br Maximum memory to be used (in MB) .br Cache size for raster rows .br Default: \fI300\fR .IP "\fBoutput\fR=\fIname\fR" 4m .br Name for output raster map .IP "\fBresample\fR=\fIstring\fR" 4m .br Resampling method to use for reprojection .br Options: \fInearest, bilinear, bicubic, lanczos, bilinear_f, bicubic_f, lanczos_f\fR .br Default: \fInearest\fR .br \fBnearest\fR: nearest neighbor .br \fBbilinear\fR: bilinear interpolation .br \fBbicubic\fR: bicubic interpolation .br \fBlanczos\fR: lanczos filter .br \fBbilinear_f\fR: bilinear interpolation with fallback .br \fBbicubic_f\fR: bicubic interpolation with fallback .br \fBlanczos_f\fR: lanczos filter with fallback .IP "\fBextent\fR=\fIstring\fR" 4m .br Output raster map extent .br Options: \fIinput, region\fR .br Default: \fIinput\fR .br \fBinput\fR: extent of input map .br \fBregion\fR: extent of current region .IP "\fBresolution\fR=\fIstring\fR" 4m .br Resolution of output raster map (default: estimated) .br Options: \fIestimated, value, region\fR .br Default: \fIestimated\fR .br \fBestimated\fR: estimated resolution .br \fBvalue\fR: user\-specified resolution .br \fBregion\fR: current region resolution .IP "\fBresolution_value\fR=\fIfloat\fR" 4m .br Resolution of output raster map (use with option resolution=value) .IP "\fBtitle\fR=\fIphrase\fR" 4m .br Title for resultant raster map .SH DESCRIPTION \fIr.import\fR 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. .SH NOTES \fIr.import\fR checks the projection metadata of the dataset to be imported against the current location\(cqs projection. If not identical a related error message is shown. .br To override this projection check (i.e. to use current location\(cqs projection) by assuming that the dataset has the same projection as the current location the \fB\-o\fR flag can be used. This is also useful when geodata to be imported do not contain any projection metadata at all. The user must be sure that the projection is identical in order to avoid to introduce data errors. .SS Resolution \fIr.import\fR 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 \fBresolution\fR is set to \fIestimated\fR (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 \fB\-e\fR can be used first to obtain the estimate without importing the raster bands. Then the desired resolution is set with option \fBresolution_value\fR and option \fBresolution\fR=\fIvalue\fR. 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. .SS 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. .PP In the following, common use cases are: .PP \fBnearest\fR is the simplest method and the only possible method for categorical data. .PP \fBbilinear\fR does linear interpolation and provides smoother output than \fBnearest\fR. \fBbilinear\fR is recommended when reprojecting a DEM for hydrological analysis or for surfaces where overshoots must be avoided, e.g. precipitation should not become negative. .PP \fBbicubic\fR produces smoother output than \fBbilinear\fR, at the cost of overshoots. Here, valid pixels that are adjacent to NULL pixels or edge pixels are set to NULL. .PP \fBlanczos\fR produces the smoothest output of all methods and preserves contrast best. \fBlanczos\fR is recommended for imagery. Both \fBbicubic\fR and \fBlanczos\fR preserve linear features. With \fBnearest\fR or \fBbilinear\fR, linear features can become zigzag features after reprojection. .PP 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 \(dqfall back\(dq to simpler interpolation methods along NULL borders. That is, from lanczos to bicubic to bilinear to nearest. .PP For explanation of the \fB\-l\fR flag, please refer to the r.in.gdal manual. .PP When importing whole\-world maps the user should disable map\-trimming with the \fB\-n\fR flag. For further explanations of \fB\-n\fR flag, please refer the to r.proj manual. .SH EXAMPLES .SS 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 (http://earthexplorer.usgs.gov/). The SRTM collections are located under the \(dqDigital Elevation\(dq category. .PP Example for North Carolina sample dataset (the tile name is \(dqn35_w079_1arc_v3.tif\(dq): .br .nf \fC # 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 \(rs extent=region resolution=region title=\(dqSRTM V3 resampled to 10m resolution\(dq # beautify colors: r.colors srtmv3_resamp10m color=elevation \fR .fi .SS Import of WorldClim data Import of a subset from WorldClim Bioclim data set, to be reprojected to current location projection (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 \fIextent\fR parameter: .br .nf \fC # 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 \(rs extent=region resolution=region \-n # temperature data are in °C * 10 r.info bioclim01 r.univar \-e bioclim01 \fR .fi .SH SEE ALSO \fI r.in.gdal, r.proj \fR .SH AUTHORS Markus Metz .br Improvements: Martin Landa, Anna Petrasova .SH SOURCE CODE .PP Available at: r.import source code (history) .PP Accessed: Friday Mar 08 07:35:34 2024 .PP Main index | Raster index | Topics index | Keywords index | Graphical index | Full index .PP © 2003\-2024 GRASS Development Team, GRASS GIS 8.3.2 Reference Manual