t.vect.import
Imports a space time vector dataset from a GRASS GIS specific archive file.
t.vect.import [-eoc] input=name output=name [basename=string] directory=name [title=string] [description=string] [project=string] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]
Example:
t.vect.import input=name output=name directory=name
grass.script.run_command("t.vect.import", input, output, basename=None, directory, title=None, description=None, project=None, flags=None, overwrite=False, verbose=False, quiet=False, superquiet=False)
Example:
gs.run_command("t.vect.import", input="name", output="name", directory="name")
Parameters
input=name [required]
Name of input file
output=name [required]
Name of the output space time vector dataset
basename=string
Basename of the new generated output maps
A numerical suffix separated by an underscore will be attached to create a unique identifier
directory=name [required]
Path to the extraction directory
title=string
Title of the new space time dataset
description=string
Description of the new space time dataset
project=string
Create a new project (location) and import the data into it. Do not run this module in parallel or interrupt it when a new project should be created
-e
Extend project extents based on new dataset
-o
Override projection check (use current projects's CRS)
Assume that the dataset has same coordinate reference system as the current project
-c
Create the project specified by the "project" parameter and exit. Do not import the space time vector datasets.
--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
input : str, required
Name of input file
Used as: input, file, name
output : str, required
Name of the output space time vector dataset
Used as: output, stvds, name
basename : str, optional
Basename of the new generated output maps
A numerical suffix separated by an underscore will be attached to create a unique identifier
directory : str, required
Path to the extraction directory
Used as: input, dir, name
title : str, optional
Title of the new space time dataset
description : str, optional
Description of the new space time dataset
project : str, optional
Create a new project (location) and import the data into it. Do not run this module in parallel or interrupt it when a new project should be created
flags : str, optional
Allowed values: e, o, c
e
Extend project extents based on new dataset
o
Override projection check (use current projects's CRS)
Assume that the dataset has same coordinate reference system as the current project
c
Create the project specified by the "project" parameter and exit. Do not import the space time vector datasets.
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
t.vect.import imports a space time vector dataset archive that was exported with t.vect.export.
NOTES
Optionally a base map name can be provided to avoid that existing vector maps are overwritten by the map names that are used in the STRDS archive.
The directory is used as work directory in case of import but can also be used as a data directory when using GML for the data exchange.
EXAMPLE
In this example, five vector maps are created and registered in a single space time vector dataset named random_locations. Each vector map represents random locations within the boundary of the state taken at 1 month intervals. The space time dataset is then exported and re-imported.
db.connect -d
for i in `seq 1 5` ; do
v.random output=map_$i n=500 restrict=boundary_state@PERMANENT
echo map_$i >> map_list.txt
done
t.create type=stvds temporaltype=absolute \
output=random_locations \
title="Random locations" \
description="Vector test dataset with random locations"
t.register -i type=vector input=random_locations \
file=map_list.txt start="2012-01-01" increment="1 months"
t.vect.list random_locations
t.vect.export input=random_locations output=random_locations.tar.gz \
compression=gzip
t.vect.import input=random_locations.tar.gz output=new_random_locations \
basename=new_map directory=/tmp
t.vect.list new_random_locations
id|name|layer|mapset|start_time|end_time
new_map_1@user1|new_map_1|None|user1|2012-01-01 00:00:00|2012-02-01 00:00:00
new_map_2@user1|new_map_2|None|user1|2012-02-01 00:00:00|2012-03-01 00:00:00
new_map_3@user1|new_map_3|None|user1|2012-03-01 00:00:00|2012-04-01 00:00:00
new_map_4@user1|new_map_4|None|user1|2012-04-01 00:00:00|2012-05-01 00:00:00
new_map_5@user1|new_map_5|None|user1|2012-05-01 00:00:00|2012-06-01 00:00:00
SEE ALSO
t.vect.export, t.create, t.info, v.in.ogr, v.pack, t.rast.import
AUTHOR
Sören Gebbert, Thünen Institute of Climate-Smart Agriculture
SOURCE CODE
Available at: t.vect.import source code
(history)
Latest change: Friday Feb 07 19:16:09 2025 in commit a82a39f