Skip to content

r.in.srtm.region

Creates a DEM from 3 arcsec SRTM v2.1 or 1 arcsec SRTM v3 tiles.

r.in.srtm.region [-n21z] output=name username=string password=string [url=string] [local=name] [region=xmin,ymin,xmax,ymax] [memory=integer] [method=string] [resolution=float] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

r.in.srtm.region output=name username=string password=string

grass.script.run_command("r.in.srtm.region", output, username, password, url=None, local=None, region=None, memory=300, method=None, resolution=None, flags=None, overwrite=False, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("r.in.srtm.region", output="name", username="string", password="string")

Parameters

output=name [required]
    Name for output raster map
username=string [required]
    Username for authentication
password=string [required]
    Password for authentication
url=string
    Base URL to fetch SRTM tiles
local=name
    Local folder with SRTM tiles
    Use local folder instead of URL to retrieve SRTM tiles
region=xmin,ymin,xmax,ymax
    Import subregion only (default is current region)
    Format: xmin,ymin,xmax,ymax - usually W,S,E,N
memory=integer
    Memory in MB for interpolation
    Default: 300
method=string
    Resampling method to use for reprojection (required if location projection not longlat)
    Allowed values: nearest, bilinear, bicubic, lanczos, bilinear_f, bicubic_f, lanczos_f
    nearest: nearest neighbor
    bilinear: bilinear interpolation
    bicubic: bicubic interpolation
    lanczos: lanczos filter
    bilinear_f: bilinear interpolation with fallback
    bicubic_f: bicubic interpolation with fallback
    lanczos_f: lanczos filter with fallback
resolution=float
    Resolution of output raster map (required if location projection not longlat)
-n
    Fill null cells
-2
    Import SRTM v2 tiles
    Default: Import SRTM v3 tiles
-1
    Input is a 1-arcsec tile (default: 3-arcsec)
-z
    Create zero elevation for missing tiles
--overwrite
    Allow output files to overwrite existing files
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

output : str, required
    Name for output raster map
    Used as: output, raster, name
username : str, required
    Username for authentication
password : str, required
    Password for authentication
url : str, optional
    Base URL to fetch SRTM tiles
local : str, optional
    Local folder with SRTM tiles
    Use local folder instead of URL to retrieve SRTM tiles
    Used as: input, dir, name
region : tuple[float, float, float, float] | list[float] | str, optional
    Import subregion only (default is current region)
    Format: xmin,ymin,xmax,ymax - usually W,S,E,N
    Used as: xmin,ymin,xmax,ymax
memory : int, optional
    Memory in MB for interpolation
    Default: 300
method : str, optional
    Resampling method to use for reprojection (required if location projection not longlat)
    Allowed values: nearest, bilinear, bicubic, lanczos, bilinear_f, bicubic_f, lanczos_f
    nearest: nearest neighbor
    bilinear: bilinear interpolation
    bicubic: bicubic interpolation
    lanczos: lanczos filter
    bilinear_f: bilinear interpolation with fallback
    bicubic_f: bicubic interpolation with fallback
    lanczos_f: lanczos filter with fallback
resolution : float, optional
    Resolution of output raster map (required if location projection not longlat)
flags : str, optional
    Allowed values: n, 2, 1, z
    n
        Fill null cells
    2
        Import SRTM v2 tiles
        Default: Import SRTM v3 tiles
    1
        Input is a 1-arcsec tile (default: 3-arcsec)
    z
        Create zero elevation for missing tiles
overwrite: bool, optional
    Allow output files to overwrite existing files
    Default: False
verbose: bool, optional
    Verbose module output
    Default: False
quiet: bool, optional
    Quiet module output
    Default: False
superquiet: bool, optional
    Very quiet module output
    Default: False

DESCRIPTION

r.in.srtm.region imports all SRTM tiles covering the current region or region extents given with region into GRASS, patches the tiles together and optionally interpolates holes for SRTM V2.1. The SRTM V003 products are already void-filled.

r.in.srtm.region downloads (SRTM product description)

Importantly, for the SRTM tiles download a user registration is needed at https://urs.earthdata.nasa.gov/users/new

In the user profile, two specific applications must be approved in the "My application" tab:

  • "LP DAAC Data Pool" application, and
  • "Earthdata Search" application.

EXAMPLE

Import of SRTMGL1 V003 (1 arc seconds \~ 30m) covering the current computational region:

# run in LatLong location - Sicily East, Italy
g.region n=39 s=37 w=14 e=16 res=0:00:01 -p

# use own credentials here
r.in.srtm.region -1 user="my_nasa_user" password="my_nasa_pw" output=srtm_sicily_1arc memory=2000
r.univar srtm_sicily_1arc

image-alt
Figure: Eta volcano (Sicily, Italy) shown in NVIZ

SEE ALSO

r.in.srtm, r.in.nasadem (addon)

The Shuttle Radar Topography Mission homepage at NASA's JPL (see also MEaSUREs Data Product Table - SRTM).

The SRTM v3 documentation.

SRTMGL1: NASA Shuttle Radar Topography Mission Global 1 arc second V003

NASA JPL. (2013). NASA Shuttle Radar Topography Mission Global 1 arc second. NASA LP DAAC. https://doi.org/10.5067/MEaSUREs/SRTM/SRTMGL1.003

REFERENCES

M. Neteler, 2005. SRTM and VMAP0 data in OGR and GRASS. GRASS Newsletter, Vol.3, pp. 2-6, June 2005. ISSN 1614-8746.

AUTHORS

Markus Metz
Reprojection support: Anika Bettge, mundialis

SOURCE CODE

Available at: r.in.srtm.region source code (history)
Latest change: Friday Feb 21 10:10:05 2025 in commit 7d78fe3