~ubuntu-branches/ubuntu/precise/grass/precise

« back to all changes in this revision

Viewing changes to gui/wxpython/scripts/p.rast

  • Committer: Bazaar Package Importer
  • Author(s): Francesco Paolo Lovergine
  • Date: 2011-04-13 17:08:41 UTC
  • mfrom: (8.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20110413170841-ss1t9bic0d0uq0gz
Tags: 6.4.1-1
* New upstream version.
* Now build-dep on libjpeg-dev and current libreadline6-dev.
* Removed patch swig: obsolete.
* Policy bumped to 3.9.2, without changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
 
3
 
#%Module
4
 
#% description: Displays and overlays raster map layers in the active display frame on the graphics monitor
5
 
#% keywords: display
6
 
#%End
7
 
#%flag
8
 
#% key: i
9
 
#% description: Invert catlist
10
 
#%End
11
 
#%Option
12
 
#% key: map
13
 
#% type: string
14
 
#% required: yes
15
 
#% multiple: no
16
 
#% description: Raster map to be displayed
17
 
#% gisprompt: old,cell,raster
18
 
#%End
19
 
#%Option
20
 
#% key: catlist
21
 
#% type: string
22
 
#% required: no
23
 
#% multiple: yes
24
 
#% key_desc: cat[-cat]
25
 
#% description: List of categories to be displayed (INT maps)
26
 
#%End
27
 
#%Option
28
 
#% key: vallist
29
 
#% type: string
30
 
#% required: no
31
 
#% multiple: yes
32
 
#% key_desc: val[-val]
33
 
#% description: List of values to be displayed (FP maps)
34
 
#%End
35
 
#%Option
36
 
#% key: opacity
37
 
#% type: string
38
 
#% required: no
39
 
#% multiple: no
40
 
#% key_desc: val[-val]
41
 
#% description: Set opacity between 0-100%
42
 
#%End
43
 
 
44
 
 
45
 
if [ -z "$GISBASE" ] ; then
46
 
    echo "You must be in GRASS GIS to run this program." 1>&2
47
 
    exit 1
48
 
fi
49
 
 
50
 
if [ "$1" != "@ARGS_PARSED@" ] ; then
51
 
    exec g.parser "$0" "$@"
52
 
fi
53
 
 
54
 
# CODE GOES HERE
55
 
 
56
 
cmdfile="`g.gisenv get=GRASS_PYCMDFILE`"
57
 
 
58
 
if [ -e ${cmdfile} ] && [ -n "${cmdfile}" ]; then
59
 
    echo -n
60
 
else
61
 
    g.message -e "GRASS_PYCMDFILE - File not found. Run p.mon"
62
 
    exit 1
63
 
fi
64
 
 
65
 
 
66
 
eval "`echo ${GIS_OPT_MAP} | sed -e 's/^/NAME=/' -e 's/@/; MAPSET=/'`;"
67
 
 
68
 
#echo $NAME 
69
 
 
70
 
if [ -z "${MAPSET}" ]; then
71
 
    mapset=""
72
 
else
73
 
    mapset="mapset=${MAPSET}"
74
 
fi
75
 
 
76
 
#echo $MAPSET
77
 
 
78
 
eval "`g.findfile element=cell file=${NAME} ${mapset}`"
79
 
 
80
 
#echo $NAME 
81
 
#echo $MAPSET
82
 
 
83
 
if [ -z "${GIS_OPT_CATLIST}" ]; then
84
 
    CATLIST="None"
85
 
else
86
 
    CATLIST="${GIS_OPT_CATLIST}"
87
 
fi
88
 
 
89
 
if [ -z "${GIS_OPT_VALLIST}" ]; then
90
 
    VALLIST="None"
91
 
else
92
 
    VALLIST="${GIS_OPT_VALLIST}"
93
 
fi
94
 
 
95
 
if [ -z "${GIS_OPT_OPACITY}" ]; then
96
 
    OPACITY="100"
97
 
else
98
 
    OPACITY="${GIS_OPT_OPACITY}"
99
 
fi
100
 
 
101
 
if [ "${GIS_FLAG_I}" -eq "1" ]; then
102
 
    INVERT="True"
103
 
else
104
 
    INVERT="False"
105
 
fi
106
 
 
107
 
 
108
 
#cmd="self.map.AddRasterLayer(self, $NAME $MAPSET $CATLIST $VALLIST $INVERCATS $INVERT $OPACITY)"
109
 
 
110
 
cmd="addraster ${name} ${mapset} ${CATLIST} ${VALLIST} ${INVERT} ${OPACITY}"
111
 
 
112
 
#echo "${cmd}"
113
 
echo "${cmd}" >> "${cmdfile}"