Skip to content
Permalink
Browse files

Updated various GRASS modules - patches applied (thanks Giovanni Mang…

…hi). Closes #2229 and #2046

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12473 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
pcav
pcav committed Dec 15, 2009
1 parent eabc1af commit 0f79635d5859176605019a35c0159267202eb894
@@ -2,11 +2,7 @@
<!DOCTYPE qgisgrassmodule SYSTEM "http://mrcc.com/qgisgrassmodule.dtd">

<qgisgrassmodule label="Vector buffer" module="v.buffer">
<flag key="s" answer="off" hidden="no" />
<flag key="c" answer="off" hidden="no" />
<option key="input" typeoption="type" layeroption="layer" />
<option key="distance"/>
<option key="minordistance"/>
<option key="angle"/>
<option key="output" />
</qgisgrassmodule>
@@ -2,6 +2,7 @@
<!DOCTYPE qgisgrassmodule SYSTEM "http://mrcc.com/qgisgrassmodule.dtd">

<qgisgrassmodule label="Export vector to PostGIS (PostgreSQL) database table." module="v.out.ogr.pg.py" manual="v.out.ogr">
<flag key="c" answer="off" hidden="no"/>
<option key="input" layeroption="layer" typeoption="type" />
<option key="olayer" />
<option key="database" />
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE qgisgrassmodule SYSTEM "http://mrcc.com/qgisgrassmodule.dtd">

<qgisgrassmodule label="Create a map conteining concentrinc rings" module="r.circle">
<qgisgrassmodule label="Create a map containing concentric rings" module="r.circle">
<option key="coordinate" />
<option key="min" answer="0" />
<option key="max" />
<option key="mult" answer="1"/>
<option key="output" />
</qgisgrassmodule>
</qgisgrassmodule>
@@ -6,7 +6,7 @@

<option key="elevation" />
<option key="threshold" />

<flag key="m" answer="off" hidden="no" />
<option key="accumulation" />
<option key="drainage" />
<option key="stream" />
@@ -103,6 +103,11 @@
#% required : no
#%end

#%flag
#% key: c
#% description: to export features with category (labeled) only. Otherwise all features are exported
#%end

import sys
import os
import string
@@ -132,9 +137,10 @@ def main():
if user: dsn += " user=" + user
if password: dsn += " password=" + password

if grass.run_command('v.out.ogr', input=input, layer=layer, type=type, format="PostgreSQL", dsn=dsn, olayer=olayer ) != 0:
if grass.run_command('v.out.ogr', flags=flags_string, input=input, layer=layer, type=type, format="PostgreSQL", dsn=dsn, olayer=olayer ) != 0:
grass.fatal("Cannot export vector to database.")

if __name__ == "__main__":
options, flags = grass.parser()
flags_string = "".join([k for k in flags.keys() if flags[k] and k != 'r'])
main()

0 comments on commit 0f79635

Please sign in to comment.
You can’t perform that action at this time.