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

2019-04-26 Thread Tom Chadwin
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 >

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

2019-04-25 Thread Nyall Dawson
On Thu, 25 Apr 2019 at 21:19, Bo Victor Thomsen wrote: > > Hi all - > > I have a python plugin where I iterate through all vectorlayers and get the > source for each layer using > > mySource = myVectorLayer.source() > > The result could be something like this: (one line) > >

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

2019-04-25 Thread Tom Chadwin
I use: from urllib.parse import parse_qs d = parse_qs(layer.source()) if 'tileMatrixSet' in d: useWMTS = True wmts_url = d['url'][0].replace("request=getcapabilities", "") wmts_layer = d['layers'][0] wmts_format = d['format'][0] wmts_crs = d['crs'][0] wmts_style =

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

2019-04-25 Thread Bo Victor Thomsen
Hi all - I have a python plugin where I iterate through all vectorlayers and get the source for each layer using mySource = myVectorLayer.source() The result could be something like this: (one line) restrictToRequestBBOX='1' srsname='EPSG:25832'