Ticket #1190 (closed bug: fixed)

Opened 5 years ago

Last modified 4 years ago

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
Platform Version: Platform: All
Must Fix for Release: Yes 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

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

Change History

  Changed 5 years ago by neteler

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?

follow-up: ↓ 3   Changed 4 years ago by rblazek

  • status changed from new to closed
  • resolution set to fixed

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   Changed 4 years ago by cgsbob

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?

Changed 4 years ago by cgsbob

patch to use the new python grass module

  Changed 4 years ago by rblazek

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

Radim

  Changed 4 years ago by rblazek

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