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

Even Rouault even.rouault at spatialys.com
Mon Mar 20 15:39:19 PDT 2017


> 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

Perhaps we can avoid that extra parameter, and have the layer name prioritary over the layer 
id when both are found ?

> - 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

Not sure to what you are refering too, since I can see the layerName returned here:
https://github.com/qgis/QGIS/blob/master/src/providers/ogr/qgsogrprovider.cpp#L700

> 
> 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

The layer name can be stored in subLayers() for conveniency, since it has usually a short life. 
And for subLayers() / askUserForOGRSublayers() make the layer id what is used.


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20170320/47637918/attachment.html>


More information about the Qgis-developer mailing list