3
############################################################################
6
# AUTHOR(S): Anna Petrasova <kratochanna gmail.com>
7
# PURPOSE: Script for querying raster maps in d.mon
8
# COPYRIGHT: (C) 2014 by the GRASS Development Team
10
# This program is free software under the GNU General
11
# Public License (>=v2). Read the file COPYING that
12
# comes with GRASS for details.
14
#############################################################################
17
#% description: Allows the user to interactively query raster map layers at user-selected locations.
21
#%option G_OPT_R_INPUTS
26
from grass.script import core as gcore
30
options, flags = gcore.parser()
31
gisenv = gcore.gisenv()
32
if 'MONITOR' in gisenv:
33
cmd_file = gisenv['MONITOR_{monitor}_CMDFILE'.format(monitor=gisenv['MONITOR'].upper())]
34
dout_cmd = 'd.what.rast'
35
for param, val in options.iteritems():
37
dout_cmd += " {param}={val}".format(param=param, val=val)
38
with open(cmd_file, "a") as file_:
41
gcore.fatal(_("No graphics device selected. Use d.mon to select graphics device."))
44
if __name__ == "__main__":