Skip to content

t.vect.db.select

Prints attributes of vector maps registered in a space time vector dataset.

t.vect.db.select input=name [columns=name [,name,...]] [separator=character] [layer=string] [where=sql_query] [t_where=sql_query] [--verbose] [--quiet] [--qq] [--ui]

Example:

t.vect.db.select input=name

grass.script.run_command("t.vect.db.select", input, columns=None, separator="pipe", layer="1", where=None, t_where=None, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("t.vect.db.select", input="name")

Parameters

input=name [required]
    Name of the input space time vector dataset
columns=name [,name,...]
    Name of attribute column(s)
separator=character
    Field separator character between the output columns
    Special characters: pipe, comma, space, tab, newline
    Default: pipe
layer=string
    Layer number or name
    Vector features can have category values in different layers. This number determines which layer to use. When used with direct OGR access this is the layer name.
    Default: 1
where=sql_query
    WHERE conditions of SQL statement without 'where' keyword
    Example: income < 1000 and population >= 10000
t_where=sql_query
    WHERE conditions of SQL statement without 'where' keyword used in the temporal GIS framework
    Example: start_time > '2001-01-01 12:30:00'
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

input : str, required
    Name of the input space time vector dataset
    Used as: input, stvds, name
columns : str | list[str], optional
    Name of attribute column(s)
    Used as: input, dbcolumn, name
separator : str, optional
    Field separator character between the output columns
    Special characters: pipe, comma, space, tab, newline
    Used as: input, separator, character
    Default: pipe
layer : str, optional
    Layer number or name
    Vector features can have category values in different layers. This number determines which layer to use. When used with direct OGR access this is the layer name.
    Used as: input, layer
    Default: 1
where : str, optional
    WHERE conditions of SQL statement without 'where' keyword
    Example: income < 1000 and population >= 10000
    Used as: input, sql_query, sql_query
t_where : str, optional
    WHERE conditions of SQL statement without 'where' keyword used in the temporal GIS framework
    Example: start_time > '2001-01-01 12:30:00'
    Used as: sql_query
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

The module t.vect.db.select prints attributes of vector maps registered in a space time vector dataset.

EXAMPLE

The example is querying the shoreline space time dataset:

t.vect.db.select input=shoreline
start_time|end_time|cat|DESCR|SOURCE|DATE
1849|1873|1|T-736|NOAA/USGS|01/01/1858
1849|1873|2|T-657|NOAA/USGS|01/01/1857
1849|1873|3|T-381(2)|NOAA/USGS|01/01/1852
1849|1873|4|T-381(1)|NOAA/USGS|01/01/1852
1849|1873|5|T-381(1)|NOAA/USGS|01/01/1852
...
2009||44|2009 USDA NAIP|2009-07-11|VA, SAND, Wet / Dry
2009||45|2009 USDA NAIP|2009-07-11|Carolina Beach, SAND, Wet / Dry
2009||46|2009 USDA NAIP|2009-07-11|Carolina Beach, REVETMENT-ROCK, Hard Structure
2009||47|2009 USDA NAIP|2009-07-11|Fort Fisher, REVETMENT-ROCK, Hard Structure

In the following example it print only DATE and SOURCE columns for data before 1900-01-01.

t.vect.db.select input=shoreline column=DATE,SOURCE t_where="start_time < 1900"
start_time|end_time|DATE|SOURCE
1849|1873|01/01/1858|NOAA/USGS
1849|1873|01/01/1857|NOAA/USGS
1849|1873|01/01/1852|NOAA/USGS
1849|1873|01/01/1852|NOAA/USGS
...
1849|1873|01/01/1860|NOAA/USGS
1849|1873|01/01/1860|NOAA/USGS
1849|1873|01/01/1873|Coastal Carolina University
1849|1873|01/01/1873|Coastal Carolina University
1849|1873|01/01/1873|Coastal Carolina University

SEE ALSO

t.create, t.info

AUTHOR

Sören Gebbert, Thünen Institute of Climate-Smart Agriculture

SOURCE CODE

Available at: t.vect.db.select source code (history)
Latest change: Friday Feb 07 19:16:09 2025 in commit a82a39f