[Qgis-user] Append in Import Vector into PostGIS didn't

Frederico dos Santos Soares fssunb at gmail.com
Sat Oct 15 16:29:57 PDT 2016


--Sorted out

Sharing with the list the solution found.

In a current work process, I need to run several models using the
"processing" as "[OGR] Import into PostGIS" is the only tool that allows
the output of the models do "append" on a table of Postgres / PostGIS, I
had to solve the problem in the script.

Recalling I am using QGIS 2.8

The reference that I used to solve the problem, comes from the same tool in
version 2.14. Clarify that in version 2.14 Import into postgis did not work
if executed within a model, at least not work for me, I believe we have
another bug there.

Returning. The "Import into postgis" (for available connections) works in
ogr2ogrtopostgislist.py file in the ... \ QGIS Wien \ apps \ qgis-ltr \
python \ plugins \ processing \ algs \ gdal

The file in its original version builds the command of ogr2ogr with the
schema parameter "-lco" + schema outside the database configuration
parameters: -> ... -append -nlt MULTILINESTRING -lco SCHEMA = teste_geo ...

I changed the file so that the schema parameter was written into the
connection as follows "active_schema =" + schema -> PG: "host = localhost
port = 5432 dbname = gis password = xxx active_schema=temp

And voila it worked!

Attached the file, marked with # rows that were changed.

I hope that helps someone want to use this tool in their models. I'm using
it's pretty cool.

Best regards.

-- 

Frederico dos Santos Soares
GeĆ³grafo
55 61 8416 0105
fssunb at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20161015/b9f346e6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ogr2ogrtopostgislist.py
Type: application/octet-stream
Size: 12363 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20161015/b9f346e6/attachment.obj>


More information about the Qgis-user mailing list