Skip to content

Commit

Permalink
Updated various GRASS modules - patches applied (thanks Giovanni Mang…
Browse files Browse the repository at this point in the history
…hi). Closes #2229 and #2046

git-svn-id: http://svn.osgeo.org/qgis/trunk@12473 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
pcav committed Dec 15, 2009
1 parent fbc814e commit edafb7e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
4 changes: 0 additions & 4 deletions src/plugins/grass/modules-6.4/v.buffer.qgm
Original file line number Diff line number Diff line change
Expand Up @@ -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>
1 change: 1 addition & 0 deletions src/plugins/grass/modules-6.4/v.out.ogr.pg.qgm
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/grass/modules-common/r.circle.qgm
Original file line number Diff line number Diff line change
@@ -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>
2 changes: 1 addition & 1 deletion src/plugins/grass/modules-common/r.watershed.qgm
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
8 changes: 7 additions & 1 deletion src/plugins/grass/scripts/v.out.ogr.pg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 edafb7e

Please sign in to comment.