[Qgis-developer] Corrections of QgsOgrProvider implementaion of GDAL 2.0

Mark Johnson mj10777 at googlemail.com
Mon Mar 20 15:25:05 PDT 2017


There are different issues you've raised and that we might want handle or
> not:
>
> 1) make sure that a URI points to the same layer if the datasource evolves
> (new layer)
>
> 2) be able to deal with the corner cases of layers with same name
>
>
>
> 1) involves that we cannot always rely on the index of the layer in the
> layer list returned by OGR
>
> 2) involves that we cannot always rely on the layer name to identify
> uniquely a layer (can happen in some drivers like KML)
>

The proposed solution deals with problem in QgsOgrProvider::subLayers()
- searches for duplicate names
-- an extra parameter tells QgsOgrProvider if the given id or layername
should be used
- default layername, otherwise id

All of this is stored in the URI for the project.

This was tested with the KML where the problem was reported
- it was then that the layername was removed (i.e. is no longer sent to
QgsOgrProvider by subLayers()) last June

On top of that, we need to add an extra argument to store the geometry
> column name in the URI and in the output of subLayers().

The layername is also needed for the display in QGIS

Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20170320/056959eb/attachment.html>


More information about the Qgis-developer mailing list