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

« back to all changes in this revision

Viewing changes to temporal/t.vect.univar/t.vect.univar.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.vect.univar
 
6
# AUTHOR(S):    Soeren Gebbert
 
7
#
 
8
# PURPOSE:      Calculates univariate statistics of attributes for each registered vector map of a space time vector 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: Calculates univariate statistics of attributes for each registered vector map of a space time vector dataset
 
19
#% keyword: temporal
 
20
#% keyword: statistics
 
21
#% keyword: vector
 
22
#%end
 
23
 
 
24
#%option G_OPT_STVDS_INPUT
 
25
#%end
 
26
 
 
27
#%option G_OPT_V_FIELD
 
28
#%end
 
29
 
 
30
#%option G_OPT_DB_COLUMN
 
31
#% required: yes
 
32
#%end
 
33
 
 
34
#%option G_OPT_T_WHERE
 
35
#% guisection: Selection
 
36
#% key: twhere
 
37
#%end
 
38
 
 
39
#%option G_OPT_DB_WHERE
 
40
#% guisection: Selection
 
41
#%end
 
42
 
 
43
#%option G_OPT_V_TYPE
 
44
#% options: point,line,boundary,centroid,area
 
45
#% multiple: no
 
46
#% answer: point
 
47
#%end
 
48
 
 
49
#%option G_OPT_F_SEP
 
50
#% description: Field separator character between the output columns
 
51
#% guisection: Formatting
 
52
#%end
 
53
 
 
54
#%flag
 
55
#% key: e
 
56
#% description: Calculate extended statistics
 
57
#%end
 
58
 
 
59
#%flag
 
60
#% key: s
 
61
#% description: Suppress printing of column names
 
62
#% guisection: Formatting
 
63
#%end
 
64
 
 
65
import grass.script as grass
 
66
import grass.temporal as tgis
 
67
 
 
68
############################################################################
 
69
 
 
70
def main():
 
71
 
 
72
    # Get the options
 
73
    input = options["input"]
 
74
    twhere = options["twhere"]
 
75
    layer = options["layer"]
 
76
    type = options["type"]
 
77
    column = options["column"]
 
78
    where = options["where"]
 
79
    extended = flags["e"]
 
80
    header = flags["s"]
 
81
    separator = grass.separator(options["separator"])
 
82
 
 
83
    # Make sure the temporal database exists
 
84
    tgis.init()
 
85
 
 
86
    tgis.print_vector_dataset_univar_statistics(
 
87
        input, twhere, layer, type, column, where, extended, header, separator)
 
88
 
 
89
if __name__ == "__main__":
 
90
    options, flags = grass.parser()
 
91
    main()