GRASS logo

NAME - Download user-requested products through the USGS TNM API


import, raster, USGS, NED, NLCD, NAIP

SYNOPSIS --help [-ik] product=string output_name=name output_directory=name [ned_dataset=string] [nlcd_dataset=string] [nlcd_subset=string] [resampling_method=string] [--overwrite] [--help] [--verbose] [--quiet] [--ui]


Return USGS data information without downloading files
Keep extracted files after GRASS import and patch
Allow output files to overwrite existing files
Print usage summary
Verbose module output
Quiet module output
Force launching GUI dialog


product=string [required]
USGS data product
Available USGS data products to query
Options: ned, nlcd, naip
output_name=name [required]
Name for output raster map
output_directory=name [required]
Directory for USGS data download and processing
NED dataset
Available NED datasets to query
Options: ned1sec, ned13sec, ned19sec
Default: ned1sec
ned1sec: NED 1 arc-second
ned13sec: NED 1/3 arc-second
ned19sec: NED 1/9 arc-second
NLCD dataset
Available NLCD datasets to query
Options: nlcd2001, nlcd2006, nlcd2011
Default: nlcd2011
nlcd2001: National Land Cover Dataset - 2001
nlcd2006: National Land Cover Dataset - 2006
nlcd2011: National Land Cover Dataset - 2011
NLCD subset
Available NLCD subsets to query
Options: landcover, impervious, canopy
Default: landcover
landcover: Land Cover
impervious: Percent Developed Imperviousness
canopy: Percent Tree Canopy
Resampling method to use
Options: default, nearest, bilinear, bicubic, lanczos, bilinear_f, bicubic_f, lanczos_f
Default: default
default: default method based on product
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

Table of contents

DESCRIPTION downloads and patches selected USGS datasets (NED, NLCD, NAIP) to the current GRASS computational region and coordinate reference system. Associated parameters are automatically passed to The National Map Access API, downloaded to a user-specified local directory, then imported and patched. supports the following datasets:


NED data are available at resolutions of 1 arc-second (about 30 meters), 1/3 arc-second (about 10 meters), and in limited areas at 1/9 arc-second (about 3 meters).

NLCD data are available for years 2001, 2006, and 2011 (see nlcd_dataset option) at 30m resolution and include Land Cover, Percent Developed Imperviousness, and Percent Tree Canopy (see nlcd_subset option).

NAIP is available at 1 m resolution.

If the i flag is set, only information about data meeting the input parameters is displayed without downloading the data.

By default, downloaded files are kept in the specified output_direcory, so that they can be reused in case different computational region is required. However, unzipped files and imported rasters before patching are removed. If the k flag is set, extracted files from compressed archives are also kept within the download directory after the import.

By default, resampling method is chosen based on the nature of the dataset, bilinear for NED and nearest for NLCD and NAIP. This can be changed with option resampling_method.


We will download NED 1/9 arc-second digital elevation model in the extent of raster 'elevation'. First, we just list the files to be downloaded (change output directory depending on the operating system):
g.region raster=elevation product=ned ned_dataset=ned19sec output_directory=/tmp output_name=ned -i
USGS file(s) to download:
Total download size:	826.95 MB
Tile count:	4
USGS SRS:	wgs84
USGS tile titles:
USGS NED ned19_n35x75_w078x75_nc_statewide_2003 1/9 arc-second 2012 15 x 15 minute IMG
USGS NED ned19_n36x00_w078x75_nc_statewide_2003 1/9 arc-second 2012 15 x 15 minute IMG
USGS NED ned19_n35x75_w079x00_nc_statewide_2003 1/9 arc-second 2012 15 x 15 minute IMG
USGS NED ned19_n36x00_w079x00_nc_statewide_2003 1/9 arc-second 2012 15 x 15 minute IMG
To download USGS data, remove i flag, and rerun
We proceed with the download: product=ned ned_dataset=ned19sec output_directory=/tmp output_name=ned
r.colors map=ned_small color=grey
We change the computational region to a smaller extent and create a new DEM, downloaded files will be used.
g.region n=224649 s=222000 w=633000 e=636000 product=ned ned_dataset=ned19sec output_directory=/tmp output_name=ned_small
For a different extent we download NAIP imagery:
g.region n=224649 s=222000 w=636000 e=639000 product=naip output_directory=/tmp output_name=ortho
For a different extent we download NLCD land cover:
g.region n=224649 s=222000 w=639000 e=642000 product=nlcd nlcd_dataset=nlcd2011 nlcd_subset=landcover output_directory=/tmp output_name=nlcd
NED and ortho
Figure: Downloaded NED (large and small extent), NAIP orthoimagery, and NLCD land cover


TNM Access API Guide
National Elevation Dataset
National Land Cover Dataset


g.region, r.import, r.patch, r.colors


Zechariah Krautwurst, 2017 MGIST Candidate, North Carolina State University
Anna Petrasova, NCSU GeoForAll Lab
(Google Summer of Code 2017, mentors: Anna Petrasova, Vaclav Petras)


Available at: source code (history)

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

© 2003-2018 GRASS Development Team, GRASS GIS 7.4.1 Reference Manual