GRASS logo

NAME

r.in.dem - Imports a DEM covering the current region (or an explicit area) from the Copernicus GLO-30/GLO-90 global DEM (public, no account/API-key needed), reprojecting on the fly.

KEYWORDS

raster, import, elevation, DEM

SYNOPSIS

r.in.dem
r.in.dem --help
r.in.dem [-n] output=name source=string [area=north,west,south,east] resample=string [cache_dir=name] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Flags:

-n
Import at the DEM's native resolution instead of the current region's (much slower over more than a small area -- every pixel is a separate network read; default matches the region's resolution/extent, which GDAL can serve from coarser overviews and is dramatically faster)
--overwrite
Allow output files to overwrite existing files
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

output=name [required]
Name for output raster map
source=string [required]
DEM source (GLO-30 ~30m, GLO-90 ~90m; both are seamless global land coverage, including areas SRTM lacks such as high latitudes)
Options: copernicus_glo30, copernicus_glo90
Default: copernicus_glo30
area=north,west,south,east
Bounding box in WGS84 degrees (north,west,south,east); default derived from the current region
resample=string [required]
Resampling method used by r.import while reprojecting
Options: nearest, bilinear, bicubic, lanczos
Default: bilinear
cache_dir=name
Directory to cache the mosaic VRT/tile index in (default a temporary, run-scoped directory)

Table of contents

DESCRIPTION

r.in.dem imports a DEM covering the current region (or an explicit area) from the Copernicus GLO-30/GLO-90 global DEM, published as Cloud-Optimized GeoTIFFs on the public AWS Open Data registry. Unlike most global DEM sources (SRTM via OpenTopography, etc.) this needs no account, no API key, and no signed S3 request -- the tiles are plain, publicly readable HTTPS objects -- so any study area on Earth can be given a real DEM with a single command, which r.hydro.hbv.basins (and anything else needing elevation) can then delineate on.

Coverage is seamless over all land, including areas SRTM lacks (above 60N or below 56S) -- ocean-only 1-degree tiles simply don't exist in the bucket and are skipped with a warning, not an error, as long as at least one requested tile has land in it.

NOTES

The module determines every 1-degree tile overlapping the requested area, checks each one actually exists (HEAD request -- ocean tiles don't), mosaics the existing ones into a GDAL VRT (/vsicurl/, no download of the whole tile needed up front -- r.import only reads the pixels it actually needs), and imports/reprojects the result into the current project.

By default the import matches the current region's extent and resolution (extent=region/resolution=region in r.import terms) -- GDAL can serve this from coarser overviews, so it stays fast regardless of how large the region is. Pass -n to import at the DEM's full native resolution instead; this is dramatically slower over more than a small area, since every output pixel then needs its own network read (a 3x2 degree area at GLO-30's native ~30m/1-arcsec resolution took around 8 minutes in testing, for reference) -- only use it when the extra detail is actually needed at the scale being worked at.

After import, r.colors color=elevation is applied to the output automatically, so the result is ready to display without an extra step.

EXAMPLE

g.region n=34 s=31 e=49 w=47 res=0:06
r.in.dem output=karkheh_dem source=copernicus_glo30

r.hydro.hbv.basins elevation=karkheh_dem outlets=outlets id_column=id \
  threshold=1000 snap_radius=30 parameters_template=bounds16.csv \
  basins=basins basins_vector=basins_v

SEE ALSO

r.hydro.hbv.basins, r.hydro.hbv, r.import, r.colors, t.in.era5

AUTHOR

Yann Chemin

SOURCE CODE

Available at: r.in.dem source code (history)

Accessed: Monday Jul 27 12:29:33 2026


Main index | Raster index | Topics index | Keywords index | Graphical index | Full index

© 2003-2026 GRASS Development Team, GRASS 8.5.1dev Reference Manual