~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to temporal/t.rast.export/t.rast.export.py

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

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