[Qgis-developer] ogrLayerName in processing/tools/vector.py

Sandro Santilli strk at kbt.io
Tue Oct 18 02:11:32 PDT 2016


On Tue, Oct 18, 2016 at 11:00:54AM +0200, Mark Johnson wrote:

> Inside QgsOgrProvider all of this is done as needed, but when using the
> OGR-API directly each step must be done manually.

This is done in multi-step already, is it not ?
https://github.com/qgis/QGIS/blob/dc5abfed892c0e8d8eac0e016dc5ee37e7725632/python/plugins/processing/tools/vector.py#L573-L579

The problem, as Germán found out, is that the URI passed as parameter
is not necessarely an OGR provider URI, but a generic QGIS uri, from
any provider, so it cannot always be opened via ogr.Open.

In ogrConnectionString there seem to be an attempt to fetch the actual
layer from the uri, but doesn't seem to work always.

I've pushed a further tweak to the ogrLayerName function so to have
it properly documented AND correctly handle PostgreSQL provider URIs

--strk;


More information about the Qgis-developer mailing list