Skip to content

m.tnm.download

Downloads data for specified polygon codes from The National Map (TNM).

m.tnm.download [-dsufS] [dataset=string [,string,...]] [type=string] [code=string [,string,...]] [date_type=string] [start_date=string] [end_date=string] [separator=character] [--verbose] [--quiet] [--qq] [--ui]

Example:

m.tnm.download dataset=string

grass.tools.Tools.m_tnm_download(dataset=None, type="state", code=None, date_type="published", start_date=None, end_date=None, separator="pipe", flags=None, verbose=None, quiet=None, superquiet=None)

Example:

tools = Tools()
tools.m_tnm_download(dataset="string")

This grass.tools API is experimental in version 8.5 and expected to be stable in version 8.6.

grass.script.run_command("m.tnm.download", dataset=None, type="state", code=None, date_type="published", start_date=None, end_date=None, separator="pipe", flags=None, verbose=None, quiet=None, superquiet=None)

Example:

gs.run_command("m.tnm.download", dataset="string")

Parameters

dataset=string [,string,...]
    Dataset index, ID, or tag
type=string
    Polygon type
    Allowed values: state, huc2, huc4, huc8
    Default: state
code=string [,string,...]
    Polygon code (state name, USPS code, FIPS code, or HUC number)
date_type=string
    Date type for search
    Allowed values: created, updated, published
    Default: published
start_date=string
    Start date for search in YYYY-MM-DD
end_date=string
    End date for search in YYYY-MM-DD
separator=character
    Field separator
    Special characters: pipe, comma, space, tab, newline
    Default: pipe
-d
    List supported datasets and exit

-s
    List supported states and exit

-u
    List URLs only without downloading

-f
    List filenames only without downloading

-S
    Compare file size for skipping downloads

--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

dataset : str | list[str], optional
    Dataset index, ID, or tag
type : str, optional
    Polygon type
    Allowed values: state, huc2, huc4, huc8
    Default: state
code : str | list[str], optional
    Polygon code (state name, USPS code, FIPS code, or HUC number)
date_type : str, optional
    Date type for search
    Allowed values: created, updated, published
    Default: published
start_date : str, optional
    Start date for search in YYYY-MM-DD
end_date : str, optional
    End date for search in YYYY-MM-DD
separator : str, optional
    Field separator
    Special characters: pipe, comma, space, tab, newline
    Used as: input, separator, character
    Default: pipe
flags : str, optional
    Allowed values: d, s, u, f, S
    d
        List supported datasets and exit

    s
        List supported states and exit

    u
        List URLs only without downloading

    f
        List filenames only without downloading

    S
        Compare file size for skipping downloads

verbose : bool, optional
    Verbose module output
    Default: None
quiet : bool, optional
    Quiet module output
    Default: None
superquiet : bool, optional
    Very quiet module output
    Default: None

Returns:

result : grass.tools.support.ToolResult | None
If the tool produces text as standard output, a ToolResult object will be returned. Otherwise, None will be returned.

Raises:

grass.tools.ToolError: When the tool ended with an error.

dataset : str | list[str], optional
    Dataset index, ID, or tag
type : str, optional
    Polygon type
    Allowed values: state, huc2, huc4, huc8
    Default: state
code : str | list[str], optional
    Polygon code (state name, USPS code, FIPS code, or HUC number)
date_type : str, optional
    Date type for search
    Allowed values: created, updated, published
    Default: published
start_date : str, optional
    Start date for search in YYYY-MM-DD
end_date : str, optional
    End date for search in YYYY-MM-DD
separator : str, optional
    Field separator
    Special characters: pipe, comma, space, tab, newline
    Used as: input, separator, character
    Default: pipe
flags : str, optional
    Allowed values: d, s, u, f, S
    d
        List supported datasets and exit

    s
        List supported states and exit

    u
        List URLs only without downloading

    f
        List filenames only without downloading

    S
        Compare file size for skipping downloads

verbose : bool, optional
    Verbose module output
    Default: None
quiet : bool, optional
    Quiet module output
    Default: None
superquiet : bool, optional
    Very quiet module output
    Default: None

DESCRIPTION

m.tnm.download downloads data for specified polygon codes from The National Map (TNM).

NOTES

This module uses the TNM Access REST APIs to download TNM data.

EXAMPLES

List supported datasets and exit:

# use indices, IDs, or tags to select datasets, but indices can change between
# sessions
m.tnm.download -d

List supported states and exit:

# use FIPS codes, USPS codes, or names to select states for type=state
m.tnm.download -s

Download National Elevation Dataset (NED) 1-arcsecond files for Texas:

# find the dataset ID
m.tnm.download -d | grep "NED.* 1 arc-second"
m.tnm.download dataset=one-arc-second-dem type=state code=TX

Download National Watershed Boundary Dataset (WBD) files for HUC8 01010001:

# find the dataset ID
m.tnm.download -d | grep WBD
m.tnm.download dataset=watershed-boundary-dataset type=huc8 code=01010001

SEE ALSO

m.cdo.download

AUTHOR

Huidae Cho, New Mexico State University