NAME
t.rast.copytree - Transfer raster map files from STRDS in external GDAL format to target directory
KEYWORDS
temporal,
move,
copy,
GDAL,
directory
SYNOPSIS
t.rast.copytree
t.rast.copytree --help
t.rast.copytree [-mos] input=name [where=sql_query] output_directory=name [source_directory=name] [suffix=string] [temporal_tree=string] [nprocs=integer] [--help] [--verbose] [--quiet] [--ui]
Flags:
- -m
- Move files into destination (default is copy)
- Move files into destination (default is copy)
- -o
- Overwrite existing files
- Overwrite existing files
- -s
- Use semantic label in directory structure
- Use semantic label in directory structure
- --help
- Print usage summary
- --verbose
- Verbose module output
- --quiet
- Quiet module output
- --ui
- Force launching GUI dialog
Parameters:
- input=name [required]
- Name of the input space time raster dataset
- 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'
- output_directory=name [required]
- Path to the output / destination directory
- source_directory=name
- Path to the source directory
- suffix=string
- Suffix of files to transfer
- temporal_tree=string
- Strftime format to create temporal directory name or tree (e.g. "%Y/%m/%d")
- nprocs=integer
- Number of threads for parallel computing
- Default: 1
t.rast.copytree is a simple helper module to copy extrenal registered raster
maps from a STRDS into a temporal directory tree. The tree structure can be defined
with the
temporal_tree option and the
s-flag (to include the
semantic_label in the directory structure). The output directory needs to
exist, but the directory structure below will be created if necessary. Parallel
transfer of files is supported with the
nprocs option. Using the
m-flag
files can be moved instead of copied.
temp_dir=$(g.tempfile -d pid=1)
mkdir $temp_dir
target_dir=$(g.tempfile -d pid=1)
mkdir $target_dir
g.region -ag s=0 n=80 w=0 e=120 res=1
r.external.out format="GTiff" directory=$temp_dir extension="tif" options="COMPRESS=LZW"
for rmap_idx in 1 2 3
do
for prefix in a b
do
r.mapcalc expression="${prefix}_${rmap_idx} = ${rmap_idx}00 --overwrite
r.support map="${prefix}_${rmap_idx} semantic_label=$prefix
done
done
t.create type="strds" temporaltype="absolute" output="A" \
title="A test" description="A test" --overwrite
t.register -i type="raster" input="A" maps="a_1,a_2,a_3" \
start="2001-01-01" increment="3 months" --overwrite
t.create type="strds" temporaltype="absolute" output="B" \
title="B test" description="B test" --overwrite
t.register -i type="raster" input="B" maps="b_1,b_2,b_3" \
start="2001-01-01" increment="1 day" --overwrite
t.rast.copytree -m input="A" temporal_tree="%Y/%m" nprocs=2 \
output_directory=$target_dir
t.rast.copytree -s input="B" temporal_tree="%Y/%m/%d" nprocs=2 \
output_directory=$target_dir
Stefan Blumentrath
SOURCE CODE
Available at:
t.rast.copytree source code
(history)
Accessed: Friday Oct 25 13:33:14 2024
Main index |
Temporal index |
Topics index |
Keywords index |
Graphical index |
Full index
© 2003-2024
GRASS Development Team,
GRASS GIS 8.4.0 Reference Manual