-
-
Notifications
You must be signed in to change notification settings - Fork 295
/
t.vect.export.py
executable file
·88 lines (75 loc) · 2.2 KB
/
t.vect.export.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/env python
# -*- coding: utf-8 -*-
############################################################################
#
# MODULE: t.vect.export
# AUTHOR(S): Soeren Gebbert
#
# PURPOSE: Export a space time vector dataset.as GRASS specific archive file
# COPYRIGHT: (C) 2011-2014 by the GRASS Development Team
#
# This program is free software under the GNU General Public
# License (version 2). Read the file COPYING that comes with GRASS
# for details.
#
#############################################################################
#%module
#% description: Exports a space time vector dataset as GRASS GIS specific archive file.
#% keyword: temporal
#% keyword: export
#% keyword: vector
#% keyword: time
#%end
#%option G_OPT_STVDS_INPUT
#%end
#%option G_OPT_F_OUTPUT
#% description: Name of a space time vector dataset archive
#%end
#%option G_OPT_M_DIR
#% key: directory
#% description: Path to the work directory, default is /tmp
#% required: no
#% answer: /tmp
#%end
#%option
#% key: compression
#% type: string
#% description: Compression method of the tar archive
#% required: no
#% multiple: no
#% options: no,gzip,bzip2
#% answer: bzip2
#%end
#%option
#% key: format
#% type: string
#% label: The export format of a single vector map
#% description: Supported are GML via v.out.ogr and the GRASS package format of v.pack
#% required: no
#% multiple: no
#% options: GML,pack
#% answer: GML
#%end
#%option G_OPT_T_WHERE
#%end
import grass.script as grass
############################################################################
def main():
# lazy imports
import grass.temporal as tgis
# Get the options
_input = options["input"]
output = options["output"]
compression = options["compression"]
directory = options["directory"]
where = options["where"]
_format = options["format"]
# Make sure the temporal database exists
tgis.init()
# Export the space time raster dataset
tgis.export_stds(
_input, output, compression, directory, where, _format, "stvds")
############################################################################
if __name__ == "__main__":
options, flags = grass.parser()
main()