[QGIS-Developer] Appending Features to a layer

Jorge Gustavo Rocha jgr at di.uminho.pt
Wed May 13 04:25:27 PDT 2020


Hola Luís,

The options are quite simple. You can see them in this SO question:
https://gis.stackexchange.com/questions/87404/how-to-write-a-new-layer-to-postgresql-from-qgis-plugin/360270#360270

You should create a temporary layer with the original one, plus the
features you want to append. Then you write it to the database.

Does it help?

Regards,

Jorge Gustavo

On 13/05/20 11:57, Luís Miguel Royo Pérez wrote:
> Hi all,
> I'm seeking a way to append features to a layer when exporting into a
> PostGIS layer.
> 
> For now I'm using the tool QgsVectorLayerExporter.
> 
> I'm doing something like this
> 
> QgsVectorLayerExporter(uri, "postgres", fields, layer.wkbType(),
> utils().crs, overwrite,{}).addFeatures([feat for feat in
> layer.getFeatures()])
> 
> Inside the curly brackets I know I can place the options, but I can't
> find where are these options documented. Or wether these options can
> help me in my task of append features to a QGIS layer.
> 
> Can anyone point me in the right direction in this task of appending
> features?
> 
> Kind regards.
> -- 
> Luís Miguel Royo Pérez.
> Analista-Programador GIS
> C/ Antic Regne de Valencia nº 4. Manises (Valencia)
> Teléfono:+34  679846103
> webs:
> inisig.com <http://inisig.com>
> geofibra.com <https://geofibra.com>
> 
> 
> 
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> 

J. Gustavo
-- 
Jorge Gustavo Rocha
Departamento de Informática
Universidade do Minho
4710-057 Braga
Gabinete 3.29 (Piso 3)
Tel: +351 253604480
Fax: +351 253604471
Móvel: +351 910333888
skype: nabocudnosor


More information about the QGIS-Developer mailing list