*Raymond Nijssen*
/Wed Dec 7 07:39:50 PST 2022/
------------------------------------------------------------------------
I'm trying to change the dataSourceUri of an existing layer

Hi Raymond,
AFAIK you need to use setDataSource [1] directly on the layer an not setDataSourceUri on the data provider.

E.g.:

layer.setDataSource(new_ds, layer_name, 'ogr')


Best regards.

Andrea

[1] https://qgis.org/pyqgis/master/core/QgsMapLayer.html#qgis.core.QgsMapLayer.setDataSource
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to