Opened 16 years ago

Closed 15 years ago

Last modified 15 years ago

#1190 closed bug (fixed)

GRASS modules: v.out.ogr wrong for PostGIS

Reported by: pcav Owned by: nobody
Priority: major: does not work as expected Milestone: Version 1.0.3
Component: GRASS Version: Trunk
Keywords: Cc: rblazek
Must Fix for Release: Yes Platform: All
Platform Version: Awaiting user input: no

Description

the module v.out.ogr does not work for exporting data to PostGIS, as the module misses the crucial parameters (dbname etc.) for this format.

Attachments (1)

qgis_grass_py.patch (1.3 KB ) - added by cgsbob 15 years ago.
patch to use the new python grass module

Download all attachments as: .zip

Change History (6)

comment:1 by neteler, 15 years ago

The problem is not clear to me, on cmd line one has to enter:

v.out.ogr input=polygons type=area \
          dsn="PG:host=localhost dbname=postgis user=postgres" \
          olayer=polymap format=PostgreSQL

Is it impossible to define dsn like that or just annoying? If the latter, could different fields be defined and composed on the fly to one dsn string?

comment:2 by rblazek, 15 years ago

Resolution: fixed
Status: newclosed

Fixed in revision 10899. Added new script + qgis module with separate fields for each db connection parameter.

Work sponsored by http://www.faunalia.it

Radim

in reply to:  2 comment:3 by cgsbob, 15 years ago

Replying to rblazek:

Fixed in revision 10899. Added new script + qgis module with separate fields for each db connection parameter.

Work sponsored by http://www.faunalia.it

Radim

I just tried those two scripts using QGIS 1.2 w/ GRASS 6.5.svn. I get a error message:

Traceback (most recent call last):
  File "/home/bobm/usr/share/qgis/grass/scripts/qgis.v.out.ogr.pg2.py", line 137, in <module>
    options, flags = grass.parser()
AttributeError: 'module' object has no attribute 'parser'

I did a little check and found that this errors is related to a reorganization of grass.py (see http://trac.osgeo.org/grass/changeset/37447). I'm attaching a patch that seems to fix this problem.

Btw, I wasn't sure if I should reopen this ticket or submit a new one?

by cgsbob, 15 years ago

Attachment: qgis_grass_py.patch added

patch to use the new python grass module

comment:4 by rblazek, 15 years ago

I have commited you patch in revision 10936. Non need to open a new ticket I believe. Thanks.

Radim

comment:5 by rblazek, 15 years ago

Cc: rblazek added
Note: See TracTickets for help on using tickets.