[QGIS-Developer] How to split QGISMapLayer attribute "source" into parts (python)

Tom Chadwin tom.chadwin at nnpa.org.uk
Fri Apr 26 03:04:49 PDT 2019


Nyall Dawson wrote
>     uri = QgsDataSourceUri(layer.source())
>     table = uri.table()
>     user = uri.username()
>     restrict_bbox = uri.param("restrictToRequestBBOX")
> 
> etc
> 
> For non-db layers (eg disk based OGR/GDAL layers, you should use
> QgsProviderRegistry.instance().decodeUri(layer.source())

I had no idea - thanks v much for the info, Nyall.

Tom



-----
Buy Pie Spy: Adventures in British pastry 2010-11 on Amazon 
--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-f4099106.html


More information about the QGIS-Developer mailing list