<div dir="ltr"><br><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p style="white-space:pre-wrap;font-family:"sans serif";font-size:12px;margin:0px">There are different issues you've raised and that we might want handle or not:</p><p style="white-space:pre-wrap;font-family:"sans serif";font-size:12px;margin:0px">1) make sure that a URI points to the same layer if the datasource evolves (new layer)</p><p style="white-space:pre-wrap;font-family:"sans serif";font-size:12px;margin:0px">2) be able to deal with the corner cases of layers with same name</p><p style="white-space:pre-wrap;font-family:"sans serif";font-size:12px;margin:0px"> </p><p style="white-space:pre-wrap;font-family:"sans serif";font-size:12px;margin:0px">1) involves that we cannot always rely on the index of the layer in the layer list returned by OGR</p><p style="white-space:pre-wrap;font-family:"sans serif";font-size:12px;margin:0px">2) involves that we cannot always rely on the layer name to identify uniquely a layer (can happen in some drivers like KML)</p></blockquote><div><br></div><div>The proposed solution deals with problem in QgsOgrProvider::subLayers()</div><div>- searches for duplicate names</div><div>-- an extra parameter tells QgsOgrProvider if the given id or layername should be used</div><div>- default layername, otherwise id</div><div><br></div><div>All of this is stored in the <span style="font-family:"sans serif";font-size:12px;white-space:pre-wrap">URI for the project.</span></div><div><br></div><div>This was tested with the KML where the problem was reported</div><div>- it was then that the layername was removed (i.e. is no longer sent to QgsOgrProvider by subLayers()) last June</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-family:"sans serif";font-size:12px;white-space:pre-wrap">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().</span></blockquote><div>The layername is also needed for the display in QGIS </div><div><br></div><div>Mark</div></div>