Skip to content

Commit f01dd39

Browse files
author
rblazek
committed
output opt fix
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12936 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 63429f0 commit f01dd39

File tree

2 files changed

+68
-1
lines changed

2 files changed

+68
-1
lines changed

src/plugins/grass/modules-common/v.kernel.qgm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE qgisgrassmodule SYSTEM "http://mrcc.com/qgisgrassmodule.dtd">
33

4-
<qgisgrassmodule label="Gaussian kernel density" module="v.kernel">
4+
<qgisgrassmodule label="Gaussian kernel density" module="qgis.v.kernel.rast.py">
55
<option key="input" />
66
<option key="stddeviation" />
77
<option key="output" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/usr/bin/env python
2+
3+
############################################################################
4+
#
5+
# MODULE: qgis.v.kernel.rast.py
6+
# AUTHOR(S): Radim Blazek
7+
#
8+
# PURPOSE: Export a vectore to PostGIS (PostgreSQL) database table
9+
# COPYRIGHT: (C) 2009 by Radim Blazek
10+
#
11+
# This program is free software under the GNU General Public
12+
# License (>=v2). Read the file COPYING that comes with GRASS
13+
# for details.
14+
#
15+
#############################################################################
16+
17+
#%Module
18+
#% description: Generates a raster density map from vector points data using a moving 2D isotropic Gaussian kernel.
19+
#% keywords: vector, export, database
20+
#%End
21+
22+
#%option
23+
#% key: input
24+
#% type: string
25+
#% gisprompt: old,vector,vector
26+
#% key_desc : name
27+
#% description: Input vector with training points
28+
#% required : yes
29+
#%end
30+
31+
#%option
32+
#% key: stddeviation
33+
#% type: double
34+
#% description: Standard deviation in map units
35+
#% required : yes
36+
#%end
37+
38+
#%option
39+
#% key: output
40+
#% type: string
41+
#% gisprompt: new,cell,raster
42+
#% key_desc : name
43+
#% description: Output raster map
44+
#% required : yes
45+
#%end
46+
47+
import sys
48+
import os
49+
import string
50+
try:
51+
from grass.script import core as grass
52+
except ImportError:
53+
import grass
54+
except:
55+
raise Exception ("Cannot find 'grass' Python module. Python is supported by GRASS from version >= 6.4" )
56+
57+
def main():
58+
input = options['input']
59+
output = options['output']
60+
stddeviation = options['stddeviation']
61+
62+
if grass.run_command('v.kernel', input=input, stddeviation=stddeviation, output=output ) != 0:
63+
grass.fatal("Cannot run v.kernel.")
64+
65+
if __name__ == "__main__":
66+
options, flags = grass.parser()
67+
main()

0 commit comments

Comments
 (0)